Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: In place replace, ignoring between quotes

by SuicideJunkie (Vicar)
on Oct 25, 2013 at 19:20 UTC ( [id://1059736]=note: print w/replies, xml ) Need Help??


in reply to Re^2: In place replace, ignoring between quotes
in thread In place replace, ignoring between quotes

If $var is true, then !$var is false ('').
If $var is false, then !$var is true (1).

That new value is then assigned to $var

Alternatively, you could say $var ^= 1 to do the same sort of thing, just with 1 and 0 instead of 1 and ''.

Replies are listed 'Best First'.
Re^4: In place replace, ignoring between quotes
by trippledubs (Deacon) on Oct 25, 2013 at 19:47 UTC

    Nice. ^=1 makes more sense to me.

    I guess I have a hard time understanding because if $var = 0 (or "") then you say $var = ! $var, why 1? Why not, 50? I mean practically speaking it works and that is what is important. I guess it doesn't have to exactly translate to English. Thanks for sharing!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-19 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found