![]() |
|
The stupid question is the question not asked | |
PerlMonks |
Re: Eval and system()by dragonchild (Archbishop) |
on Sep 05, 2001 at 17:24 UTC ( #110284=note: print w/replies, xml ) | Need Help?? |
It's not being caught in the compile phase. The program compiles just fine.
You are working just fine with eval ... it's system (specifically on Unix) that's tripping you up. Try doing: Unix commands are built off of the C libraries (for the most part). The standard C libraries, for reasons which will be left to your imagination, use '0' to indicate success and non-zero to indicate failure. Thus, the Unix commands tend to follow this (rather stupid) paradigm. In addition, system handles all the cleanup from failed commands. If you want to test $@, try Try them both - they exhibit different behaviors of eval and die. ------ Vote paco for President!
In Section
Seekers of Perl Wisdom
|
|