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 { ... }
In reply to Re: or with a block
by dws
in thread or with a block
by GhodMode
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |