On 28/08/2011 19:48, Mike McClain wrote:
On Sat, Aug 27, 2011 at 08:16:50PM +0200, Dr.Ruud wrote:
I would like 'lazy' syntax like:

   <$fh>  x {/^#/ or print};

to process a list.

When I tried your code like so:
     open my $fh, '<', $file     or die qq(Unable to open $file: $! );
     <$fh>  x {/^\s*#/ or print};
     close $fh                   or die qq(Unable to close $file: $! );

I get these errors:
     Useless use of repeat (x) in void context at ./test line 48.
     Use of uninitialized value in pattern match (m//) at ./test line 48,
         <$fh>  line 1.
     Use of uninitialized value in print at ./test line 48,<$fh>  line 1.
     Odd number of elements in anonymous hash at ./test line 48,<$fh>  line 1.
     Out of memory!

Hey Mike. Ruud was just proposing a "wouldn't it be nice if" syntax. It
isn't valid Perl!

Rob

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to