in reply to "Globbing" over variable names in Perl?

perl -le '$a1 = 3; $a2 = 4; $c = 2; print join " | ",(keys %main:: ); +'

This works only for global variables, not the ones declared with 'my'

Replies are listed 'Best First'.
Re^2: "Globbing" over variable names in Perl?
by pat_mc (Pilgrim) on Sep 29, 2010 at 17:28 UTC
    Thanks, jethro... this is a good point to start from. However, print keys %main:: returns an awful lot of gibberish along with the desired variable names. Still, this array of hash keys would be a helpful starting point.

    Thanks again for your help!

    Pat