Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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
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 examining the Monastery: (6)
As of 2014-12-26 22:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (176 votes), past polls