
dareno
New User
Jul 28, 2009, 3:35 AM
Post #1 of 4
(1386 views)
|
|
Unrecognized escape \M passed through in regex
|
Can't Post
|
|
I'm new to Perl, I'm using ActivePerl v5.10.0 and Komodo Edit, running on windows. My code is:
#!/usr/bin/perl -w #use strict; my $filename = "C:\\Documents and Settings\\pie\\Moje dokumenty\\perl\\dictionary.txt"; my $word = "fiche"; open $filehandle, $filename or die "I couldn't get file: $!"; while ($line = <$filehandle>) { if ($line =~ /$filename/) { print $line; last; } } And the error is: Unrecognized escape \M passed through in regex; marked by <-- HERE in m/C:\Documents and Settings\pie\M <-- HERE oje dokumenty\perl\dictionary.txt/ at C:\Documents and Settings\pie\Moje dokumenty\perl\dict.pl line 10, <$filehandle> line 1. Could you help?
|