develooper Front page | perl.perl5.porters | Postings from February 2013

Re: perlopentut modernization

Thread Previous | Thread Next
Ricardo Signes
February 14, 2013 02:52
Re: perlopentut modernization
Message ID:
* Alexander Hartmaier <> [2013-01-19T06:54:56]
> ...

Sorry for the delay.  I'm finally reviewing!

This is a sort of random collection of reactions.  Sorry for any confusion to
my thoughts.

special variable C<$!>  -- should link to perlvar, since $! is a bit weird

You write:

  "The other important thing to notice is that, just as in the shell, any
  whitespace before or after the filename is ignored."


  ~$ perl -E "open( my \$fh, '>', 'foo '); print {\$fh} 'hi'; close \$fh; say
  -e 'foo ' ? 1 : 0; say -e 'foo' ? 1 : 0"

...which indicates that you are wrong.  I believe this is only true of two-arg
open.  I am concerned by this inaccuracy, as it may foretell more to come on
subtler points.

For example, again:

  ~$ head -1 dupes
  use 5.16.0;
  ~$ perl -E 'my $x = "dupes\n"; open my $fh, "<", $x or die "cannot open $x:
  cannot open dupes
  : No such file or directory at -e line 1.


  ~$ cat files.txt
  ~$ perl -E 'while (<>) { open my $fh, "<", $_ or die "cannot open $_: $!";
  print <$fh>; }' files.txt
  cannot open dupes
  : No such file or directory at -e line 1, <> line 1.

I think at this point I'm going to stop.  The whole document needs to be
checked for accuracy of these kind of claims before it is possible to even
consider merging.

Committers: do not merge this branch yet.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About