Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
more useful options
 
PerlMonks  

Re: A better non-existant string...

by Adam (Vicar)
on Jan 22, 2001 at 22:36 UTC ( [id://53620]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to A better non-existant string...

I don't think there is any significant difference between "" and ''. Consider that the metachar \ is still checked in single quoted strings, this means that both types undergo some char check. I find '' to be easier to read, which is a good enough reason to use it (in my book).

Another point, however, is that I generally encourage people to put the constant first in a comparison. This may seem odd, because its the reverse of how we like to read it, but it results in fewer typos of = versus == type. Really this is the only place it matters, but how often have you tweaked a >= into an = or tweaked an eq into an = ??? So I would check that ( '' ne $teststring ). Also, you know that '' is the equivalence of false. (Of course, so is "0", which is why you would want to be explicit.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://53620]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.