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

1
perl -le"print for keys %::" perl -le"print for keys %main::"
2
$ perl -le"package stuff; $soy =1; $sauce =2; print for keys %stuff::" sauce soy
3
$ perl -MData::Dumper -le"package stuff; $soy =1; $sauce =2; print &: +:Dumper( \%stuff:: ) " $VAR1 = { 'sauce' => *stuff::sauce, 'soy' => *stuff::soy };

Replies are listed 'Best First'.
Re^2: "Globbing" over variable names in Perl?
by pat_mc (Pilgrim) on Sep 29, 2010 at 17:33 UTC
    Thanks, this is cool stuff ... solution 2 is exactly what I was looking for! At least it returns a clean list of all variables defined. Could you briefly expand on the syntax, please? I am not familiar with package stuff.

    Thanks again -

    Pat
      I am not familiar with package stuff.

      See package.