Thread variable sub (11 answers)
Opened by Strazke at 2005-09-15 21:11

[E|B]
 2005-09-15 22:27
#58053 #58053
User since
2003-08-08
2561 Artikel
HausmeisterIn
[Homepage] [default_avatar]
Was ist bei dir eine variable Sub?

Code: (dl )
1
2
3
4
5
6
my $sub = sub { print "Ich bin eine Sub!" };
if(ref($sub) eq "CODE"){
&$sub;
}else{
print "Ich bin keine Sub!";
}
Gruß, Erik!

s))91\&\/\^z->sub{}\(\@new\)=>69\&\/\^z->sub{}\(\@new\)=>124\&\/\^z->sub{}\(\@new\)=>);
$_.=qq~66\&\/\^z->sub{}\(\@new\)=>93~;for(@_=split(/\&\/\^z->sub{}\(\@new\)=>/)){print chr;}

It's not a bug, it's a feature! - [CGI-World.de]

View full thread variable sub