Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Wrong content of variable passed to sub

by jwkrahn (Monsignor)
on Aug 21, 2013 at 04:53 UTC ( #1050279=note: print w/ replies, xml ) Need Help??


in reply to Wrong content of variable passed to sub

my @fields = split(/\|/); my $name = $fields[0]; $name =~ s/\s*//; $name =~ s/\s*$//; my $value = $fields[1]; $value =~ s/\s*//; $value =~ s/\s*$//; my $status = $fields[3]; $status =~ s/\s*//; $status =~ s/\s*$//;

That should be:

my ( $name, $value, undef, $status ) = split /\|/; s/^\s+//, s/\s+$// for $name, $value, $status;


Comment on Re: Wrong content of variable passed to sub
Select or Download Code
Re^2: Wrong content of variable passed to sub
by olafmar (Novice) on Aug 21, 2013 at 20:29 UTC
    I implemented your suggestion too, thanks!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2014-08-20 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (125 votes), past polls