Thread use if: ? (9 answers)
Opened by vayu at 2007-02-14 13:17

bloonix
 2007-02-14 13:57
#74322 #74322
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
[quote=vayu,14.02.2007, 12:40]
Code: (dl )
1
2
3
4
5
6
if($debug) {
  no warnings;
  print Dumper \$var;
} else {
  print $var;
}


wenn ich das no warnings hier nicht setze schmeisst mir perl ne warning,
Dumper used only once ...[/quote]
mit

Code: (dl )
1
2
3
4
5
f($debug) {
  print Dumper(\$var);
} else {
  print $var;
}


erscheint die Meldung nicht mehr. "used only once" kommt an dieser
Stelle, weil die Routine Dumper zunächst für ein globales Filehandle
gehalten wird, welches nur einmal im Skript vorkommt, also weder
deklariert noch mit open() geöffnet wurde. Schätze ich mal...\n\n

<!--EDIT|opi|1171454604-->
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread use if: ?