in reply to Re: Re: Undefined regexp objects?
in thread Undefined regexp objects?
In fact... you can also call methods off of it and rebless the object into a different package and it keeps it's Regexp nature.
use strict; use warnings; my $r = qr/test/; print $r -> match( 'test' ) ? "Match\n" : "No match\n"; bless $r, 'beans'; print $r -> match( 'test' ) ? "Match\n" : "No match\n"; package beans; sub match { $_[1] =~ $_[0] } package Regexp; sub match { $_[1] =~ $_[0] }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^2: Undefined regexp objects?
by ihb (Deacon) on Jan 20, 2003 at 13:21 UTC | |
by ysth (Canon) on Nov 19, 2003 at 23:31 UTC | |
|
Re: Re^2: Undefined regexp objects?
by steves (Curate) on Jan 16, 2003 at 01:10 UTC | |
by ihb (Deacon) on Jan 16, 2003 at 01:26 UTC | |
by diotalevi (Canon) on Jan 16, 2003 at 03:00 UTC |