in reply to Printing Variable Variables

I'm baffled as to why anyone would recommend eval for this. What you're asking for (though not what you should use) is clearly just another application of symbolic references. Of course, you're not going to get that to work without removing a stricture.
use strict; my $string0 = "Jessy"; my $string1 = "Bob"; my $string2 = "Nancy"; for my $num (0..3) { no strict 'refs'; # Thanks for the correction, tinita print "${qq(string$num)}\n"; }
Common Beginner Mistakes has a good explanation of why you almost never want to use symbolic refs.

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Printing Variable Variables
by tinita (Parson) on Sep 13, 2005 at 19:29 UTC
    no strict 'references';
    uhm... Unknown 'strict' tag(s) 'references' at -e line 2
    you meant no strict 'refs' i guess =)