Problems? Is your data what you think it is? | |
PerlMonks |
Re: Naked quotes work like m//?by tachyon (Chancellor) |
on Dec 03, 2004 at 23:25 UTC ( [id://412310]=note: print w/replies, xml ) | Need Help?? |
I too have noted that 'bug' as well which as you note turns out not to be one. It is possibly a documentation bug. Probably like me you remembered reading If ``/'' is the delimiter then the initial m is optional in perlre and then made the assumption (IMHO justified) that this implicitly indicates that: If ``/'' is NOT the delimiter then the initial m is NOT optional. This of course is an implicit assumption. perlre does not define the behaviour when the delimiter is not a / and the m is missing. As you note the m is optional with a (small) range of other delimiters. This dates back to Perl 5.6.0 and perhaps earlier. There are actually only a limited number of delimiters that will work in this /* m free, non /* context. Essentially any perl expression that will evaluate as a stringy thing and is a valid RVALUE can be used:
Practically speaking that means " and ' with most of the other commonly used non / regex delims like ! , | {} all creating syntax errors or not matching. cheers tachyon
In Section
Seekers of Perl Wisdom
|
|