If you are converting a 'string' then you must escape the backslash.
Try running this:
##########--perl--##########
while (<DATA>){
s/\\r/\r/gi;
print;
}
__END__
Here are \r some \r slash \r r's for your \r substitution.
#############################
Regards,
Jack
-----Original Message-----
From: Samuel [mailto:[EMAIL PROTECTED]]
Sent: May 27, 2000 4:48 AM
To: Perl-Win32-Users Mailing List
Subject: Perl Regular Expressions
Hi.
I'm having problems evaluating regular expressions in Perl.
Either someone's not being clear enough in the Perl documentation, which I
have read through (perlop mostly) now repeatedly during the day, or there
is something wrong with me or my OS.
I'm trying to convert the string '\r' to the corresponding CR character.
my $value = '\r'; # <-- as defined somewhere else, being read from a file.
$value = qr/$value/x; # <-- yields the string: "(?:x-ism\r)".
$value =~ s/(\\.)/$1/egx; <-- yields some wierd memory scalar location.
$value =~ s/(\\(.))/\\$2/egx; <-- yields the same.
What's wrong with me? I can't get this right from reading the
documentation, and it can't be impossible to do this. Could someone please
give me a clue?
Currently using the Win32 Perl version 5.6.0, running on Win98.
- Samuel
---
You are currently subscribed to perl-win32-users as:
[EMAIL PROTECTED]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]