Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 about the Monastery: (10)
As of 2016-07-28 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (255 votes). Check out past polls.