[bcn-pm] bug amb until

Salvador Fandino sfandino a yahoo.com
dim ago 23 02:46:06 PDT 2011






>________________________________
>From: Toni <devegades en gmail.com>
>To: barcelona-pm en pm.org
>Sent: Tuesday, August 23, 2011 11:37 AM
>Subject: [bcn-pm] bug amb until
>
>Hola mongers,
>
>Mireu que em passa:
>
>$ perl -e 'do { print "hola\n" } until 1'
>hola
>$
>
>OK, és el que esperava.
>
>$ perl -e 'print "hola\n" until 1'
>$
>
>WTF! Perquè no escriu hola?
>
>És un bug meu o del Perl?
>
>
¡es una "feature"!

Esta documentado en perlsyn:

"The "while" and "until" modifiers have the usual ""while" loop" semantics (conditional evaluated first), except when applied to a "do"-BLOCK (or to the deprecated "do"-SUBROUTINE statement), in which case the block executes once before the conditional is evaluated."
------------ pr?a parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://mail.pm.org/pipermail/barcelona-pm/attachments/20110823/24fd3ed4/attachment.html>


Més informació sobre la llista de correu Barcelona-pm