in reply to dynamic variables

It's possible, but you don't want to. Instead, you want to use a hash. You can think of the elements in the hash as if they're variables on their own.

$foo = 'bar'; $hash{$foo} = "Hello, World!\n"; print $hash{bar}; # prints Hello, World! and a linefeed


(Note: Variables are put in a hash themselves (%package:: (or just %::)), You could use ${$foo} = "Hello, World!\n" (maybe ${package::}{foo} and $::{foo} can help understanding this) and then print $bar, but it's ugly. Fortunately, use strict prevents you from doing so (unless you use no strict 'refs'))

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$