Hi Andrew,
Thank you for the correction. It looks it was a bug in book.
I am interested only for curiosity. Hope I don't need to work with the symbol
table and typeglobs. :-)
- Original Message -
I did this on my v5.14.2 and got the same result, so I resorted to reading
$
I did this on my v5.14.2 and got the same result, so I resorted to reading
$ perldoc perlmod
(it's rather long so search for "PACKAGE")
A minor modification has the desired result:
#!/usr/bin/perl
# typeglob-name-package.pl
use v5.10;
my $foo = "Some value";
my $bar = "Another value";
who_am
Same output here, with perl 5, version 20, subversion 2 (v5.20.2) built
for x86_64-linux-thread-multi.
I'm from package main
My name is glob
I'm from package main
My name is glob
Le 03/05/2015 10:01, Octavian Rasnita a écrit :
> Hello,
>
> I've seen the following example in Mastering Perl book,
Hello,
I've seen the following example in Mastering Perl book, with the comment at
the end telling what should be the result:
#!/usr/bin/perl
# typeglob-name-package.pl
use v5.10;
$foo = "Some value";
$bar = "Another value";
who_am_i( *foo );
who_am_i( *bar );
sub who_am_i {
local *glob = s