in reply to Re: Getting Value from joining 2 variables
in thread Getting Value from joining 2 variables

"$pax_$plus" simply creates a string. If $pax is "foo", and $plus is "100", then "$pax_$plus" creates the string "foo_100"

Not at all. It tries to look up the variable $pax_ (since an underscore is valid part of a variable name), and fails (and thus interpolates the empty string for $pax_).

use strict; use warnings; would have caught the problem, and can only be highly recommended to Noverast.

Replies are listed 'Best First'.
Re^3: Getting Value from joining 2 variables
by ELISHEVA (Prior) on Jan 02, 2011 at 13:47 UTC

    Good catch!

    I frequently trip on that one and also $sClass::Blah when I mean ${sClass}::Blah. Thanks.