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!!