Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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
Replies are listed 'Best First'.
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 making s'mores by the fire in the courtyard of the Monastery: (14)
As of 2015-07-29 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls