laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I suppose that would be another way to write itIt is not. But in short, if you want to check if a variable is in false condition, use if (! $var) {..., or unless ($var) {..., or the example I gave above. A false condition includes 0, "" (empty string), and undefined value. On the other hand, defined is checking a null condition (not initialized, undefed). In other words, a variable given "" or 0 also consider as defined, because value already inside. And a proper usage on defined should following a variable, like if ( defined $x ). In your code, ... !defined is checking with $_ which is what you read from <FH>, which I believe is not what you wanted.
"$z[7]" $z is Zipcode...That's why I quoted my @z = 90005; in your code snip, as this is not even a proper array, thus there will be no $z[7] existed. Finally, please read other's responds, you can't read Excel by simply open.... , not even CSV. Use a proper module for the job. In reply to Re^3: Parsing error
by exilepanda
|
|