Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 having an uproarious good time at the Monastery: (12)
As of 2016-07-01 13:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (412 votes). Check out past polls.