Jenda Krynicky wrote:

> From: "Dan Muey" <[EMAIL PROTECTED]>
> > I was curious if there is a way to simply list all of perl's built in
> > variables and their values.
>
> You can list all variables in the main package:
> (Beware! Ugly code follows!)

The output could be a bit prettier, though, without too much trouble


>
>         print "\$$_ = ", Dumper(${$::{$_}}), "\n\n" if defined ${$::{$_}};
>         print "[EMAIL PROTECTED] = ", Dumper([EMAIL PROTECTED]::{$_}}), "\n\n" if 
> defined @{$::{$_}};
>
>         print "\%$_ = ", Dumper(\%{$::{$_}}), "\n\n" if defined %{$::{$_}};

Should also be a bit easier to read.  Mostly it's the %ENV and @INC that clog
it up, and a little white space does wonders to distinguish the i ndividual
variables.

...
$_<..\perlio.c = "..\\perlio.c"

$$ = 3528

$- = 0

$_<..\universal.c = "..\\universal.c"

$0 = "-"

 = 256

$@ = ""
...

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to