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

pq
 2005-09-16 12:29
#58062 #58062
User since
2003-08-04
12209 Artikel
Admin1
[Homepage]
user image
[quote=Strazke,16.09.2005, 00:58]Kannst du mir mal bitte sagen, was can macht? Bei perldoc -f can gibts nix und er meckert bei mir:

Usage: UNIVERSAL::can(object-ref, method) at ...[/quote]
tatsächlich... ja, dann würde ich sagen, in zeile 42 ist ein fehler.
Code: (dl )
1
2
3
4
5
6
7
8
9
perl -wle'
sub test {
 print "test"
}
my $x = "test";
if (my $code = main->can($x)) {
 $code->()
}'
test

ansonsten - wie überraschend - perldoc UNIVERSAL\n\n

<!--EDIT|pq|1126859412-->
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread variable sub