On Tue, Oct 06, 2015 at 01:39:25PM -0400, Ricardo Signes wrote: > * Dave Mitchell <davem@iabyn.com> [2015-10-06T12:03:30] > > So for final clarity, is > > > > when (EXPR) {...} > > > > intended to always be exactly equal to > > > > if ($_ =~ EXPR) {...; break } > > Yes. > > > If so, how does one write something functionally equivalent to when(1) > > now? > > when { $_ == 1 } { ... } But by the definition above, that is equivalent to if ($_ =~ ($_ == 1)) {...; break } On Tue, Oct 06, 2015 at 02:47:47PM -0400, Eric Brine wrote: > On Tue, Oct 6, 2015 at 12:03 PM, Dave Mitchell <davem@iabyn.com> wrote: > > If so, how does one write something functionally equivalent to when(1) > > now? > > > > You need a helper that returns an object that overrides smartmatch. > > when (num(1)) I guess this is the correct answer. In which case, yuck. We seem to have thrown the baby out with the bath water :-(. -- "You may not work around any technical limitations in the software" -- Windows Vista licenseThread Previous | Thread Next