You can also do it via string interpolation:
#!/usr/bin/perl -w my $string = "more than one part\nanother sentence more than"; sub getone { qr/(more)/ } sub gettwo { qr/(than)/ } my @array = $string =~ /(\s@{[ getone() ]}\s@{[ gettwo() ]})/g;
In reply to Re: Subroutine Reference in a Regexp?
by jwkrahn
in thread Subroutine Reference in a Regexp?
by Amblikai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |