Quantcast
Channel: When I run a file which is begin with "#!/usr/bin/perl -w", I get a error: "syntax error at line 153, near "=~ ?"" - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by zdim for When I run a file which is begin with "#!/usr/bin/perl -w", I get a error: "syntax error at line 153, near "=~ ?""

$
0
0

That is Perl code so the first error message is meaningful.

With delimiters other than // in the match operator you must have the explicit m for it, so

$output_volume =~ m?^([\S]+).mnc?

It is only with // delimiters that the m may be omitted; from Regex Quote-Like Operators (perlop)

If "/" is the delimiter then the initial m is optional.

See perlretut for a tutorial introduction to regex and perlre for reference.

Also note that the particular delimiters of ? trigger specific regex behavior in a special case. This is discussed by the end of the documentation section in perlop linked above.


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>