Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: split and uninitialized variables

by antirice (Priest)
on Sep 03, 2004 at 15:33 UTC ( #388312=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    > perl -wl
    my ($x,$y,$z) = ('','','');
    ...
    print "$x $y $z";
    __END__
    a  b
    
  2. or download this
    perl -wl
    my ($x, $y, $z) = map defined $_ ? $_ : '', (split(',', 'a,0,b'))[0..2
    +];
    print "$x $y $z";
    __END__
    a 0 b
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://388312]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (14)
As of 2014-12-19 15:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (85 votes), past polls