in reply to or with a block
The word you're looking for is "do". Try opendir(CLEANPATH, $path) or do { ... }; This still leaves you with a flow-of-control issue. You still need a closedir() if the opendir() succeeds. (Yeah, you can neglect this in a short script, though coding as if each script could be long-running has benefits.) For this, I prefer to be a do
if ( opendir(CLEANPATH, $path) ) { ... closedir(CLEANPATH); } else { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: or with a block
by Abigail-II (Bishop) on Jun 03, 2002 at 11:13 UTC | |
|
Re: Re: or with a block
by GhodMode (Pilgrim) on May 31, 2002 at 19:07 UTC |