There's more than one way to do things | |
PerlMonks |
Re: Strange behaviour of m and $_by Fletch (Bishop) |
on Oct 17, 2006 at 22:20 UTC ( [id://578913]=note: print w/replies, xml ) | Need Help?? |
Subroutine invocations don't interpolate in double quoted strings (of which m// is a special kind). Either store the results from your function in a scalar and let that interpolate, or use something like /@{[ test_reg1() ]}/ instead. And an aside, don't use the leading ampersand on subroutine calls; it does things to how the sub is called and unless you specifically have a reason to (and know why you're doing it) you should just omit it.
In Section
Seekers of Perl Wisdom
|
|