Hi all,

 

As a part of one program I need to get the current working directory. So I
get this using cwd(). I want to replace forward slash (/) by backslash (\)
in the path which I get because I work on windows.

 

Kindly look at the code below:

 

use warnings;

use strict;

use Cwd;

 

my $current_path = cwd();

print "$current_path";

 

$current_path =~ s|/|\|;

print "$current_path";

 

When I run this I get the below error:

Substitution replacement not terminated at line 8.

 

However if I replace 's|/|\|' with 's////\/' it works. Can anyone tell me
why this happens & how to overcome it?

 

Thanks & Regards,

Sanket Vaidya


_____________________________________________________________________ 

This e-mail message may contain proprietary, confidential or legally privileged 
information for the sole use of the person or entity to whom this message was 
originally addressed. Any review, e-transmission dissemination or other use of 
or taking of any action in reliance upon this information by persons or 
entities other than the intended recipient is prohibited. If you have received 
this e-mail in error kindly delete this e-mail from your records. If it appears 
that this mail has been forwarded to you without proper authority, please 
notify us immediately at netad...@patni.com and delete this mail.
_____________________________________________________________________

Reply via email to