SPUG: minimal unmatching regex
ssandv at gmail.com
Fri Aug 21 23:33:27 PDT 2009
$^ isn't a regex and therefore doesn't fill your spec anyway. So if
you assign "" to it (one = is assignment, even on Friday, as I proved
to myself repeatedly today...), it matches *anything*. Sure, that's
probably bad form--but that isn't the point. At that point I could
just as well have used any other obscure perlvar, I just happened to
get one by accident while trying to get a regex that was short,
understandable, and contradictory by its nature when it was a bit late
for me to be thinking regexly.
I hit it out of bounds. And Ingy noticed before I could kick it back
onto the fairway. :-)
At least, that's what Ingy's reply sounded like from here.
On Fri, Aug 21, 2009 at 11:12 PM, Michael R. Wolf<MichaelRWolf at att.net> wrote:
> On Aug 19, 2009, at 12:38 AM, Ingy dot Net wrote:
>> On Tue, Aug 18, 2009 at 10:33 PM, Steve Sandvik <ssandv at gmail.com> wrote:
>> well, /$^/ seems like a plausible starting point. Or ending point.
>> Or something. :-)
>> $^ = "";
>> $anything =~ /$^/;
> I'm missing your point.
> If you mean to indicate that interpolation happens inside m//, and that $^
> is an internal perlvar (with $FORMAT_TOP_NAME as a 'use English'
> equivalent), then it is *not* an empty string. Here's the one-liner to show
> $ perl -le 'print $^'
> But, perhaps I missed your intent.
> Michael R. Wolf
> All mammals learn by playing!
> MichaelRWolf at att.net
More information about the spug-list