Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Data::Table - empty values - avoid warnings

by ikegami (Patriarch)
on Oct 24, 2007 at 16:09 UTC ( [id://646921]=note: print w/replies, xml ) Need Help??


in reply to Re: Data::Table - empty values - avoid warnings
in thread Data::Table - empty values - avoid warnings

Wrong warning category.

>perl -wle"no warnings 'uninitialized'; print '' + 4" Argument "" isn't numeric in addition (+) at -e line 1. 4 >perl -wle"no warnings 'numeric'; print '' + 4" 4

When in doubt use diagnostics or consult perldiag.

>perl -Mdiagnostics -wle"print '' + 4" Argument "" isn't numeric in addition (+) at -e line 1 (#1) (W numeric) The indicated string was fed as an argument to an oper +ator that expected a numeric value instead. If you're fortunate the me +ssage will identify which operator was so unfortunate. 4

Replies are listed 'Best First'.
Re^3: Data::Table - empty values - avoid warnings
by GertMT (Hermit) on Oct 24, 2007 at 19:26 UTC
    Thanks, often it directs me to the solution as well but couldn't think of a 'generic' enough fix. I tried something like:

    $t->colsMap(sub { $_->[2] = $_->[0] + $_->[1] if ( length( $_->[1] ) > 0 ) } );

    but that only worked in case of blanks. Happy to have found some alternatives.
    thanks again.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-20 02:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found