You forgot to add g (global)in the end...
$dirstruct =~ s/([\W])/-/g;

Cheers
Shishir

-----Original Message-----
From: Ankit Gupta [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 31, 2002 10:53 AM
To: [EMAIL PROTECTED]
Subject: help in regular expression


Hello Friends,

 I need help in the below written script.

$dirstruct =~ s/([\W])/-/;
  print $dirstruct;

here $dirstruct is c:\ankit\test

what I need as output is c--ankit-test but the output given by my script is
c-\ankit\test

Thanx

Ankit



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to