in reply to construct variable name on the fly

They don't really mention it because it's a bad idea. In your case you want an array @var; in the more general class you'd use a hash. See perldoc perlref for discussion about symbolic references.

Update: See also Program Repair Shop and Red Flags (and while not directly relevant there's another two Red Flag articles here and here that are well worth checking out).

Replies are listed 'Best First'.
Re^2: construct variable name on the fly
by aquarium (Curate) on Oct 19, 2004 at 01:29 UTC
    i know it's a bad idea.....and i will rectify when i have time. right now i have a report overdue (work) and need to get it going. Any help on getting the keys from a hash whose name is constructed from other variables would be appreciated. e.g. keys %this.${somevar}.name; doesnt work.