GhodMode has asked for the wisdom of the Perl Monks concerning the following question:
but I get a syntax error near warn and the closing bracket of the block. This works, but seems sloppy:opendir(DIR, "$path") or { warn "Could not open directory, $path: $!\n"; next; };
What's the best way to do it?opendir (CLEANPATH, "$path") or my $openfailed = "TRUE"; if ( defined $openfailed ) { warn "Could not open directory, $path : $!\n"; next; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: or with a block
by dws (Chancellor) on May 31, 2002 at 18:35 UTC | |
by Abigail-II (Bishop) on Jun 03, 2002 at 11:13 UTC | |
by GhodMode (Pilgrim) on May 31, 2002 at 19:07 UTC | |
|
Re: or with a block
by maverick (Curate) on May 31, 2002 at 18:42 UTC | |
|
Re: or with a block
by kpo (Initiate) on Jun 01, 2002 at 06:55 UTC |