alwynpan has asked for the wisdom of the Perl Monks concerning the following question:
I am not quite understand what does $, = " "; do in this package. Thank you.package DUMPVAR; sub dumpvar { my ($packageName) = @_; local (*alias); # a local typeglob # We want to get access to the stash corresponding to the package # name *stash = *{"${packageName}::"}; # Now %stash is the symbol table $, = " "; # Output separator for print # Iterate through the symbol table, which contains glob values # indexed by symbol names. while (($varName, $globValue) = each %stash) { print "$varName ============================= \n"; *alias = $globValue; if (defined ($alias)) { print "\t \$$varName $alias \n"; } if (defined (@alias)) { print "\t \@$varName @alias \n"; } if (defined (%alias)) { print "\t \%$varName ",%alias," \n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What does $, = " " do in this code?
by haukex (Archbishop) on Oct 31, 2016 at 07:34 UTC | |
by Laurent_R (Canon) on Oct 31, 2016 at 12:43 UTC | |
by alwynpan (Acolyte) on Nov 01, 2016 at 03:04 UTC | |
|
Re: What does $, = " " do in this code?
by shmem (Chancellor) on Oct 31, 2016 at 18:16 UTC | |
|
Re: What does $, = " " do in this code?
by Phenomanan (Monk) on Oct 31, 2016 at 14:58 UTC | |
|
Re: What does $, = " " do in this code?
by Anonymous Monk on Oct 31, 2016 at 06:49 UTC | |
by alwynpan (Acolyte) on Oct 31, 2016 at 07:10 UTC | |
by Anonymous Monk on Oct 31, 2016 at 07:24 UTC | |
by alwynpan (Acolyte) on Oct 31, 2016 at 07:03 UTC | |
by Anonymous Monk on Oct 31, 2016 at 07:24 UTC |