<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On May 10, 2007, at 5:37 PM, Solli Honorio wrote:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BLOCKQUOTE type="cite"><DIV><BLOCKQUOTE class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><DIV style=""><DIV><DIV><BR></DIV><DIV>elvis:~ igorsutton$ perl -MO=Deparse -we '$dir = q{.}; opendir my $file, $dir'</DIV><DIV>BEGIN { $^W = 1; }</DIV><DIV>$dir = '.';</DIV><DIV> opendir my $file, $dir;</DIV><DIV>-e syntax OK</DIV></DIV></DIV></BLOCKQUOTE><DIV><BR><SPAN style="font-family: courier new,monospace;">Seria porque neste caso o compilador está declarando e utilizando a variável $file, e utilizando a variável já declarada.... </SPAN><BR></DIV><BR><BLOCKQUOTE class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><DIV style=""><DIV><DIV>elvis:~ igorsutton$ perl -MO=Deparse -we '$dir = q{.}; opendir my $file, $dir;' </DIV><SPAN class="q"><DIV>Parentheses missing around "my" list at -e line 1.</DIV></SPAN><DIV>BEGIN { $^W = 1; }</DIV><DIV>$dir = '.';</DIV><DIV>opendir my $file, $dir;</DIV><DIV>-e syntax OK</DIV></DIV> </DIV></BLOCKQUOTE><DIV><BR><SPAN style="font-family: courier new,monospace;">... e aqui o cara esta achando que você quer declarar as variáveis $file e $dir.</SPAN> <BR></DIV><DIV><BR class="khtml-block-placeholder"></DIV></DIV></BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Acredito que seja um problema no warnings.pm mesmo, como o Wendel falou antes. Veja a árvore de operações gerada pelo Perl nas duas situações:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>elvis:~ igorsutton$ perl -MO=Terse -we '$dir = q{.}; opendir my $file, $dir;'</DIV><DIV>Parentheses missing around "my" list at -e line 1.</DIV><DIV>LISTOP (0x404a80) leave [1] </DIV><DIV> OP (0x401170) enter </DIV><DIV> COP (0x404a40) nextstate </DIV><DIV> BINOP (0x404a20) sassign </DIV><DIV> SVOP (0x405130) const PV (0x1800ec8) "." </DIV><DIV> UNOP (0x4050c0) null [15] </DIV><DIV> SVOP (0x404a00) gvsv GV (0x1800f40) *dir </DIV><DIV> COP (0x404b60) nextstate </DIV><DIV> LISTOP (0x4050e0) open_dir </DIV><DIV> OP (0x404b20) null [3] </DIV><DIV> UNOP (0x404b40) rv2gv [2] </DIV><DIV> OP (0x404aa0) padsv [1] </DIV><DIV> UNOP (0x405110) null [15] </DIV><DIV> SVOP (0x404ac0) gvsv GV (0x1800f40) *dir </DIV><DIV>-e syntax OK</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>elvis:~ igorsutton$ perl -MO=Terse -we '$dir = q{.}; opendir my $file, $dir'</DIV><DIV>LISTOP (0x404a80) leave [1] </DIV><DIV> OP (0x404b00) enter </DIV><DIV> COP (0x404a40) nextstate </DIV><DIV> BINOP (0x404a20) sassign </DIV><DIV> SVOP (0x405130) const PV (0x1800ec8) "." </DIV><DIV> UNOP (0x4050c0) null [15] </DIV><DIV> SVOP (0x404a00) gvsv GV (0x1800f40) *dir </DIV><DIV> COP (0x404ac0) nextstate </DIV><DIV> LISTOP (0x401170) open_dir </DIV><DIV> OP (0x401190) null [3] </DIV><DIV> UNOP (0x4011b0) rv2gv [2] </DIV><DIV> OP (0x404aa0) padsv [1] </DIV><DIV> UNOP (0x405100) null [15] </DIV><DIV> SVOP (0x4050e0) gvsv GV (0x1800f40) *dir </DIV><DIV>-e syntax OK</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>No arquivo 'op.c' (perl 5.9.5 DEVEL30932):</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV> 2274 while (1) {</DIV><DIV> 2275 if (*s && strchr("@$%*", *s) && *++s</DIV><DIV> 2276 && (isALNUM(*s) || UTF8_IS_CONTINUED(*s))) {</DIV><DIV> 2277 s++;</DIV><DIV> 2278 sigil = TRUE;</DIV><DIV> 2279 while (*s && (isALNUM(*s) || UTF8_IS_CONTINUED(*s)))</DIV><DIV> 2280 s++;</DIV><DIV> 2281 while (*s && (strchr(", \t\n", *s)))</DIV><DIV> 2282 s++;</DIV><DIV> 2283 }</DIV><DIV> 2284 else</DIV><DIV> 2285 break;</DIV><DIV> 2286 }</DIV><DIV> 2287 if (sigil && (*s == ';' || *s == '=')) {</DIV><DIV> 2288 Perl_warner(aTHX_ packWARN(WARN_PARENTHESIS),</DIV><DIV> 2289 "Parentheses missing around \"%s\" list",</DIV><DIV> 2290 lex ? (PL_in_my == KEY_our ? "our" : PL_in_my == KEY_state ? "state" : "my")</DIV><DIV> 2291 : "local");</DIV><DIV> 2292 }</DIV><DIV> 2293 }</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>O erro, pelo que eu entendi, acontece quando têm C<;> por que o resultado da linha 2287 C<(*s == ';' || *s == '=')> devolve verdadeiro e entra no erro, caso contrário, não.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Boa sorte ;-)</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>--</DIV><DIV>Igor Sutton</DIV><DIV><A href="mailto:igor.sutton@gmail.com">igor.sutton@gmail.com</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>