On Jun 3, 2010, at 7:33 AM, Ken Williams via RT wrote:
Show quoted text
thats a separate issue. seems a bit of an API change though as currently if it fails you get a warning
and slurp returns nothing. could catch out a few people with unexpected failures
Show quoted text> 2) the "<" mode can get tangled up with the iolayers, so if people pass a layer of
> e.g. "&=3" or something, it won't act like an iolayer. That might be useful too, but probably
Show quoted text> shouldn't be part of the 'iolayers' parameter. Any way to isolate the '<'?
my thought was to ensure the open was a read.
See IO::File->open documentation and 3-arg open in perlfunc
Change the arg to be called iomode if you like and drop the adding of '<'. open will
default to read anyway. They can then pass anything that is a valid open mode and if they
do something funky like
file($foobar)->slurp(iomode => '<&=3');
then they get what they get, as long as the open succeeds
Just default iomode to 'r', ie
my $fh = $self->open($args{iomode} || 'r');
Graham.