Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Yep, sure enough. That method of using 'foreach' looks to be almost identical to 'given' and provides nearly the same results. Although I will say manhandling 'foreach' to work like this seems more of bodge than having a proper 'switch' analogue. For now I'll follow you're advice toolic and swap over to 'foreach' until it is clear one way or the other if 'given' is going to make the cut. Reading that "perlsym" page and indeed, other posts here and at "stackoverflow" I get the feeling there is a fair bit of hostility towards poor old 'given/when'. Can you fill me in on why that might be? However... On trying it I still get warnings for 'when'. So... I guess the safest thing is just to trudge on with an ugly if/elsif construct for now. In reply to Re^2: perldelta unclear on 'given's fate
by morelenmir
|
|