Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 browsing the Monastery: (5)
As of 2014-10-22 02:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (112 votes), past polls