Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: Short version of database push for multiple variables

by Anonymous Monk
on May 13, 2012 at 20:59 UTC ( #970331=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Short version of database push for multiple variables
in thread Short version of database push for multiple variables

Thanks Eliya that worked great. However as jwkrahn wrote the split need -1 so it won't miss the last element. Jwkrahn your code gives me "Warning: Use of "length" without parentheses is ambiguous at" which is a shame cause it's a nice and easy to understand code.


Comment on Re^4: Short version of database push for multiple variables
Replies are listed 'Best First'.
Re^5: Short version of database push for multiple variables
by jwkrahn (Monsignor) on May 15, 2012 at 23:25 UTC

    Then you just need to add parentheses:

    my @fields = map length() ? $_ : 'NA', split /\t/, $Line, -1;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2015-07-30 09:31 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 (270 votes), past polls