nathaniels has asked for the wisdom of the Perl Monks concerning the following question:
Hello All!
I've been wracking my brain over a good way to do this in as few lines as possible and I feel like I'm missing something obvious. I'm trying to figure out how to do error handling with a variable assignment. I have a statement like this:
$var = func( $var );
If the function should fail, I would like the $var to stay the same, not be assigned to the failed 0 returned by the function. Is there a way to do this without creating a new variable to hold the value before the assignment?
|
|---|