Home  |  Linux  | Mysql  | PHP  | XML
From:sanket vaidya Date:Wed Jul  1 04:26:17 2009
Subject:Substitution question
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 netadmin@patni.com and delete this mail.
_____________________________________________________________________


Navigate in group perl.beginners at sever nntp.perl.org
Previous Next


Your recent visits
Re: Auto detect timezone
mysqli error
Re: Need help with a login script
Re: Global scope
Re: [PHP] generally, where in cPanel can one set the default page to load?


  
© No Copyright
You are free to use Anything
Site Maintained by Zareef Ahmed
Powered By PHP Consultants