Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Parsing error

by exilepanda (Friar)
on Feb 01, 2023 at 03:01 UTC ( [id://11150061]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Parsing error
in thread Parsing error

I suppose that would be another way to write it
It 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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found