Thread Exporter und local (9 answers)
Opened by betterworld at 2003-09-27 20:21

coax
 2003-09-28 08:34
#57525 #57525
User since
2003-08-11
457 Artikel
BenutzerIn
[default_avatar]
Ich glaube verstanden zu haben was du moechtest :).
Exportier einfach den Typeglob von foovar.
Code: (dl )
1
2
3
4
5
6
7
8
9
package Foo;

use Exporter;
use vars qw/@ISA @EXPORT/;

@ISA = qw(Exporter);
@EXPORT = qw(*foovar);

$foovar = 'old';


Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use Foo;

print "\$foovar\t\t\$Foo::foovar\n";
print "-" x 30,"\n";


print "$foovar\t\t$Foo::$foovar\n";

$foovar = 'new';

print "$foovar\t\t$Foo::$foovar\n";

# Ausgabe:
# $foovar         $Foo::foovar
# ------------------------------
# old             old
# new             new
\n\n

<!--EDIT|coax|1064723770-->
,,Das perlt aber heute wieder...'' -- Dittsche

View full thread Exporter und local