|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Comment on |
| ( #3333=superdoc: print w/ replies, xml ) | Need Help?? |
|
System calls tend to make a little uneasy.
Today I needed to do mkdir in the middle of something unwieldy and I thought, uh oh, how do I error check against this. perlfunc mkdir wasn't real helpful, and perlmonks didn't pop anything up right away either. My shortcut was to use the google "site:" syntax to search stonehenge.com repository of merlyn articles There, in the third result, was my answer. Since google gives such nice summaries, with the key words bolded for easier viewing, I saw it right away: -d $CORRUPT or mkdir $CORRUPT, 0755 or die "Cannot mkdir $CORRUPT: $!"; So, that's all. If there's ever a bit of idiom that you *almost* know, but can't quite nail, and you're too shy to ask on the chatterbox, do a site query on stonhenge.com or (who else is good for this?) and sometimes the answer pops right out. Cheers :) *************** UPDATE: Actually, though, what I really wanted was
Because system returns 0 on success, whereas perl mkdir returns 0 on failure. So much for magic bullets ;) In reply to How to find code written by smart people by tphyahoo
|
|