develooper Front page | perl.perl5.porters | Postings from January 2010

Where is the yada yada operator legal?

Thread Next
From:
brian d foy
Date:
January 27, 2010 19:02
Subject:
Where is the yada yada operator legal?
Message ID:
270120102101491610%brian.d.foy@gmail.com
It appears that the yada yada operator is less useful than the very
short documentation for it suggests. It works almost nowhere that I
want to use it.

I guess it doesn't work as part of a statement. However, I would have
thought thta if it works in a block, it would have also worked in a 
block I give to map or grep.

I'd like to clarify this in perlop, but I have to know what it's
supposed to do and if it's actually doing what it is supposed to do. )

     #!perl

     use 5.011;

     # these work
     { ... }

      sub foo { ... }

     ...;

      eval { ... };

     # these do not work
      my @list = map { ... } qw(a b c);

      my @found = grep { ... } qw(a b c);

      print ...;

      open my($fh), '>', '/dev/passwd' or ...;

      if( 1 && ... ) { print "Hello\n" };

-- 
brian d foy <brian.d.foy@gmail.com>

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About