SPUG: FW: Switch's "case" matching doesn't set $1 !

Joshua ben Jore twists at gmail.com
Thu Feb 15 09:04:55 PST 2007

On 2/15/07, Michael R. Wolf <MichaelRWolf at att.net> wrote:
> Yitzchak Scott-Thoennes wrote:
> >There's no schedule.  There was talk of converting Switch to no longer
> >use a source filter for 5.10, but no one has actually done it.
> Since it's Damianiacal code, I wouldn't want to go in there alone!  :-)
> Sounds like a good candidate for a hack-a-thon or a pair-wise hacking at a
> SPUG meeting, perhaps next week.  If I weren't already on a 4-week/4-state
> Perl training tour (i.e. I'll miss next week's meeting again), I'd be
> interested.
> Anyone (or anytwo) else interested?

I'm still somewhat impressed and revolted that Switch is still getting
maintained. It's a source of bugs and I don't see any reason that this
thing ought to be used by anyone. I see it as an experiment that just
didn't turn out well. Oh well.

If you're going to run 5.10 anyway, you can use the native syntax
that's been backported from Perl 6. To get there from Switch syntax
you'll still likely need to do source filtering and that hasn't gotten
any easier. Switch.pm is still a pariah module.

Yitzchak, do you recall the strategy for making Switch not be a source
filter? Hack on toke.c to make switch/case be aliases for given/when?


More information about the spug-list mailing list