Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: a simple question...

by Nkuvu (Priest)
on Nov 28, 2007 at 17:29 UTC ( [id://653593]=note: print w/replies, xml ) Need Help??


in reply to a simple question...

Just tried this simple script:

use strict; use warnings; my (%info, $quack); # If this is commented out, "no quack" $info{baz} = 3; # Assignment intentional in conditional if ($quack = $info{foo} or $quack = $info{bar} or $quack = $info{baz}) + { print "Quack is $quack\n"; } else { print "No quack\n"; }

Prints "Quack is 3".

Replies are listed 'Best First'.
Re^2: a simple question...
by Anonymous Monk on Nov 28, 2007 at 17:39 UTC
    well rather than getting Quack is 3, I want it to say Quack = baz. Is that possible?

      Then it looks like wind's reply is more along the lines of what you want.

        Yes it is. Thanks wind and everyone for help!!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2026-02-09 21:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    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.