Message-Id: <
200402241132.34656.kvale@phy.ucsf.edu>
p4raw-id: //depot/perl@22368
perform variable substitutions once. If you don't want any
substitutions at all, use the special delimiter C<m''>:
- $pattern = 'Seuss';
- m'$pattern'; # matches '$pattern', not 'Seuss'
+ @pattern = ('Seuss');
+ m/@pattern/; # matches 'Seuss'
+ m'@pattern'; # matches the literal string '@pattern'
The global modifier C<//g> allows the matching operator to match
within a string as many times as possible. In scalar context,
will ignore it. If you don't want any substitutions at all, use the
special delimiter C<m''>:
- $pattern = 'Seuss';
+ @pattern = ('Seuss');
while (<>) {
- print if m'$pattern'; # matches '$pattern', not 'Seuss'
+ print if m'@pattern'; # matches literal '@pattern', not 'Seuss'
}
C<m''> acts like single quotes on a regexp; all other C<m> delimiters