in reply to Re: perldelta unclear on 'given's fate
in thread perldelta unclear on 'given's fate
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: perldelta unclear on 'given's fate
by LanX (Saint) on Jan 04, 2014 at 15:35 UTC | |
by morelenmir (Beadle) on Jan 04, 2014 at 15:47 UTC | |
by LanX (Saint) on Jan 04, 2014 at 16:00 UTC | |
by Tommy (Chaplain) on Jan 05, 2014 at 21:15 UTC | |
by Bloodnok (Vicar) on Jan 06, 2014 at 14:18 UTC | |
by dasgar (Priest) on Jan 04, 2014 at 16:31 UTC | |
by tobyink (Canon) on Jan 04, 2014 at 17:06 UTC |