I'm working on something that involves using a switch() statement to call different subroutines based on the values inside a hash. Here is what the code looks like:
use Switch; switch(%A) { case 'sloven' { $responseXML .= sloven('xml') } case 'leggert' { $responseXML .= wiggedy() } ... }
...And so on. This is all well and good, but in every single case, I'm appending to $responseXML. In keeping with the Perlish quality of laziness, is there a way to append to $responseXML in every case, without having to type it every time?
Thanks,In reply to Appending to variable with a switch statement? by Spidy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |