Thread kein break? (12 answers)
Opened by Noisebreath at 2006-09-19 15:37

pq
 2006-09-19 17:04
#70020 #70020
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
[quote=vayu,19.09.2006, 14:41]btw, die sache mit dem wantarray kapier ich irgendwie nicht.[/quote]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
perl -wle'
sub test {
 my $context = wantarray()
   ? "list context"
   : defined wantarray()
   ? "scalar context"
   : "void context";
 print $context;
}
my @x = test;
my $x = test;
test;'
list context
scalar context
void context
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 kein break?