[Melbourne-pm] Postfix conditionals and creating lexicals

Sam Watkins sam at nipl.net
Sat Jul 14 02:11:20 PDT 2012

>     my $foo if 1;
> is perfectly legal and does exactly what you'd expect.

it's a perfectly useless extra clause

> It's only when the 'if' fails that Perl omits the run-time
> aspect of a 'my', leaving only the compile-time
> declaration...which leads to the static-like behaviour.

an if that never fails is perfectly useless.
If it fails, we get bogus behaviour

> you can actually create a "selectably static" variable

I figured.

> As you can see, it's quite a difficult philosophical and moral problem
> to decide whether this is (a) genius, (b) demented, (c) evil, (d) all of
> the above. And until you can agree on that, how can you decide whether
> it warrants a warning?
> >;-)

This could only happen with perl. I guess you're joking. But I take perl
bugs seriously. Our business (Armaguard) relies heavily on perl, and it
has proved very reliable. But this kind of nonsense bug should not go
unfixed for the best part of a decade. Can you imagine such a scenario
with python or ruby? No way. If you illuminated perl hackers can't be
bothered to fix it, I will brave the jungle of perl internals and
have a go (sacrificing my blissful ignorance of said jungle for the
greater good).

Sam (do you have any more old OS X macs going cheap? :)

More information about the Melbourne-pm mailing list