in reply to Regexp and object's methods.
You may use (?{ code }), with the perlre-warning in mind:
WARNING: This extended regular expression fea
ture is considered highly experimental, and may
be changed or deleted without notice.
An example:
#!/usr/bin/perl package Test; sub test { return 'test_1'; } package main; if ( 'test_1' =~ m/(?{ Test::test() })/) { print "ok\n"; } else { print "not ok\n"; } __END__ ok
regards,
tomte
Hlade's Law:
If you have a difficult task, give it to a lazy person --
they will find an easier way to do it.
|
|---|