piped open and shell metacharacters

C

C.DeRykus

...
When in "random position" in a list, => MAY be confusing.  On the
other hand, it may be a tool to attract attention to most important
element(s) of the list.

When used between two "logically connected" parts of the list (as in
$^X, -I => $INC, ...), it is, IMO, very appropriate.

some non-word cautions for the unwary:

perl -wle ' %h =( 12:00 => "lunch")'

syntax error at ... near "12:"

perl -MO=Deparse -wle ' x( area-54 => 'verboten' );'

Unquoted string "area" may clash ...
x('area' - 54, 'verboten');
-e syntax OK
 
U

Uri Guttman

CD> some non-word cautions for the unwary:

CD> perl -wle ' %h =( 12:00 => "lunch")'

CD> syntax error at ... near "12:"

CD> perl -MO=Deparse -wle ' x( area-54 => 'verboten' );'

CD> Unquoted string "area" may clash ...
CD> x('area' - 54, 'verboten');
CD> -e syntax OK

well the docs say => quotes perl word (also words starting with -) to its
left and those aren't perl words. i don't use => except for real pairs
in hashes or arrays (that will eventually be copied to hashes). i also
find the cute style of using it with some args to be wrong.

uri
 
I

Ilya Zakharevich

i don't use => except for real pairs
in hashes or arrays (that will eventually be copied to hashes)

Note that if system($foo, -I => $INC) is used with a GetOpt Perl
program $foo, what we deal is an array (well, list) that will
eventually be copied to a hash. 1/3 ;-)

Ilya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top