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] }
In reply to Re^2: Undefined regexp objects?
by diotalevi
in thread Undefined regexp objects?
by diotalevi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |