NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
May not be too far off (Score:1)
Nifty.
---ict / Spoon
Reply to This
COW (Score:1)
Meanwhile, I thought I could use
tie()to emulate$&. It works with a tied hash actually (a scalar wont work), where the key is taken as the string against which the match was carried out:#!
package Tie::MATCH;
use Carp;
sub TIEHASH { bless \my $dummy => __PACKAGE__ }
sub STORE { croak "Variable is read-only" }
sub FETCH { return substr $_[1], $-[0], $+[0] - $-[0] }
p