Thread scalar comma operator (25 answers)
Opened by KurtZ at 2008-12-31 02:05

pq
 2008-12-31 13:26
#104310 #104310
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
KurtZ+2007-12-31 03:04:56--
my $foo = (tuwas(), tu_nochwas(), 23); # $foo = 23

sollte doch äquivalent sein zu

my $foo = eval { tuwas(); tu_nochwas(); 23 };

nein. das zweite beispiel hat ein block-eval, das ist überhaupt
nicht aequivalent. wenn dann eher do {}; aber ein do drumherum
ist eine extra operation und mehr zu schreiben.
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 scalar comma operator