Thread Sub nur für aktelles File... (23 answers)
Opened by master at 2006-04-06 15:23

betterworld
 2006-04-07 02:00
#64486 #64486
User since
2003-08-21
2614 Artikel
ModeratorIn

user image
Man kann es ja auch ueber local() machen:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl -l
#
# main.pl
#
use strict;
use warnings;

sub foo {
'foo';
}

sub bar {
'bar';
}

print foo();
{
no warnings 'redefine';
local *foo=\&bar;
do "inc.pl";
}
print foo();
Code: (dl )
1
2
3
4
#
# inc.pl
#
print foo();

View full thread Sub nur für aktelles File...