The stupid question is the question not asked | |
PerlMonks |
Re^3: substituted text is being interpretedby dakkar (Hermit) |
on Jan 06, 2005 at 16:13 UTC ( [id://419972]=note: print w/replies, xml ) | Need Help?? |
It's a bit subtler than that. When you write string literals, single-quoting them make them contain exactly the characters you typed, while double-quoting them activates the interpolation mechanism. On the other hand, when you use a string as a regular expression, it gets interpreted by the regex engine. For example:
This prints:
The first two lines are hopefully obvious. As for the others:
OK, for the pedants: the string between the // is interpolated, but its contents are not further expanded. I felt that this was more noise than signal, in this case.
-- dakkar - Mobilis in mobile Most of my code is tested...
In Section
Seekers of Perl Wisdom
|
|