Can't see internal variable in epic - eclipse

557 views Asked by At

I have installed epic in eclipse for debugging perl. at first I couldn't see any variable while debugging. I found that I need to install PadWalker. That partially solved the problem because I could see all variable BUT I was missing Internal Variables (like @ARGV). Any advise ? using centOS 6, eclipse Version: Kepler Service Release 1 Build id: 20130919-0819 and epic

1

There are 1 answers

0
alex On

All variables in the local scope can bee seen from the %main:: namespace:

use Data::Dumper;

my @val;
my @names;
for my $name (keys %main::){

    my $glob = $main::{$name};
    if (defined ${$glob}) {
        push @names, '$' . $name;
        push @val, ${$glob};
    }

    if (defined @{$glob}) {
        push @names, '@' . $name;
        push @val, [@{$glob}];
    }

    if (defined %{$glob}) {
        push @names, '%' . $name;
        push @val, {%{$glob}};
    }
}
my $d = Data::Dumper->new(\@val, \@names);
print STDERR $d->Dump

The output will be like this:

$@ARGV = [
           'aaa',
           'bbb',
           'ccc'
         ];
$@INC = [
          '/usr/lib/perl5/5.10/i686-cygwin',
          '/usr/lib/perl5/5.10',
          '/usr/lib/perl5/site_perl/5.10/i686-cygwin',
          '/usr/lib/perl5/site_perl/5.10',
          '/usr/lib/perl5/vendor_perl/5.10/i686-cygwin',
          '/usr/lib/perl5/vendor_perl/5.10',
          '/usr/lib/perl5/vendor_perl/5.10',
          '/usr/lib/perl5/site_perl/5.8',
          '/usr/lib/perl5/vendor_perl/5.8',
          '.'
        ];
$%INC = {
          'warnings.pm' => '/usr/lib/perl5/5.10/warnings.pm',
          'Carp.pm' => '/usr/lib/perl5/5.10/Carp.pm',
          'XSLoader.pm' => '/usr/lib/perl5/5.10/i686-cygwin/XSLoader.pm',
          'bytes.pm' => '/usr/lib/perl5/5.10/bytes.pm',
          'warnings/register.pm' => '/usr/lib/perl5/5.10/warnings/register.pm',
          'overload.pm' => '/usr/lib/perl5/5.10/overload.pm',
          'strict.pm' => '/usr/lib/perl5/5.10/strict.pm',
          'Exporter.pm' => '/usr/lib/perl5/5.10/Exporter.pm',
          'Data/Dumper.pm' => '/usr/lib/perl5/5.10/i686-cygwin/Data/Dumper.pm'
        };
$%ENV = {
          'USERPROFILE' => 'C:\\Users\\Alex',
          'HOMEDRIVE' => 'C:',
          'PS1' => '\\[\\e]0;\\w\\a\\]\\n\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\$ ',
          'COMMONPROGRAMFILES' => 'C:\\Program Files (x86)\\Common Files',
          'APPDATA' => 'C:\\Users\\Alex\\AppData\\Roaming',
          'PROGRAMFILES' => 'C:\\Program Files (x86)',
          'OS' => 'Windows_NT',
          'CommonProgramFiles(x86)' => 'C:\\Program Files (x86)\\Common Files',
          'LOCALAPPDATA' => 'C:\\Users\\Alex\\AppData\\Local',
          'PWD' => '/home/Alex',
          'USER' => 'Alex',
          'LANG' => 'C.UTF-8',
          'PATHEXT' => '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC',
          'PRINTER' => 'HP Officejet 4620 series (Network)',
          'SHLVL' => '1',
          'NUMBER_OF_PROCESSORS' => '8',
          'HOMEPATH' => '\\Users\\Alex',
          'FP_NO_HOST_CHECK' => 'NO',
          'QMAKESPEC' => 'cygwin-g++',
...