note
zakb
<p>Well for me, maintainability should be one of our highest concerns as developers: will the developer who follows me understand my code? But that's probably a good subject for a meditation later!</p>
<p>You're close with catching the error; this should work:</p>
<code>$var = `...` or die "System failed: $!\n";</code>
<p>Basically, you don't need the if; the left hand side of the expression will be undef (false) if it fails, so the <code>or</code> will evaluate the right hand side. You'll see this form of error catching quite a bit, especially when using <code>open</code> and the like to operate on files. Note the use of <code>$!</code>, which will tell you what the system error message was - see [perlvar] for more information about this.</p>
240283
240290