Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Useless use of string eq

by jrsimmon (Hermit)
on Dec 06, 2007 at 16:03 UTC ( [id://655441]=note: print w/replies, xml ) Need Help??


in reply to Useless use of string eq

To summarize some of the answers above:

1. Why is this a useless use?
Because eq is used to compare things. You are trying to use it to assign a value. You muse use = for that.

2. What is a void context?
{$cust eq "SMC";} is a void context, because you are performing a comparison (see 1.) but not doing anything with the result. There is not context for the compare, hence it is a void (empty) context.

3. What can I do to do this better?
The first reply Re: Useless use of string eq to your post by Fletch (++) explains best how to rewrite your code.

Perhaps you should ask him about the whole children bearing thing...

Log In?
Username:
Password:

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

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

    No recent polls found