I'd first try to figure out why $_->[4] is undefined, or if it is, don't try testing its value or interpolating it into a string. But this should prevent the test that causes the warning without resorting to disabling warnings:
if(
defined $_->[4]
and $_->[4] ne ""
) {
$float = join ',', @{$_}[1..4];
}
Note: The $_->[4] notation is functionally equivilant to, but IMHO easier to read than ${$_}[4]. I also happen to like using join on an array slice instead of typing out "${$_}[1],${$_}[2],${$_}[3],${$_}[4]", but that's not crucial to fixing your problem. The key is the defined test.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.