Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Variable assignment error checkingby nathaniels (Acolyte) |
on Dec 15, 2013 at 00:06 UTC ( [id://1067192]=perlquestion: print w/replies, xml ) | Need Help?? |
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:
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?
Back to
Seekers of Perl Wisdom
|
|