[ABE.pm] review of last night's hacking
Faber J. Fedor
faber at linuxnj.com
Fri May 9 06:38:23 PDT 2008
On 08/05/08 22:35 -0400, Ricardo SIGNES wrote:
> > Actually, I'm more interested in some of your programming techniques,
> > like the *_PATTERNS/dispatch table trick. I want to see what else
> > you've got hidden in there.
>
> I could've sworn I posted about that here. I guess not, though.
>
> http://rjbs.manxome.org/rubric/entry/1564
Not the named capture stuff, this stuff:
my ($pattern, $method) = @MSG_PATTERNS[ $i, $i + 1 ];
next unless $msg =~ /\A$pattern\z/;
my $result = $self->$method({%+});
I never thought to A) put a regex in the first index(?) of an array and
B) I didn't know you could use a variable name as a method call like that.
Where does '{%+}' come from? Is that the Moose stuff?
--
Regards,
Faber Fedor
President
Linux New Jersey, Inc.
908-320-0357
800-706-0701
http://www.linuxnj.com
More information about the ABE-pm
mailing list