Hi,
I'm trying to replace a character in a string. was facing problem in it.
$string = "D:\Folder\TEST \abc.txt"
i wanted to transform this string to "D:/Folder/TEST/abc.txt"
this is wot i tried, but doesn't work
$string = ~ s/\\/\//;
Another Q is related to fileparse.
I am getting the values as follows:
$name = abc
$path = /
$extension =
Where am I going wrong. Do i need to install anything thing for this. I have included File::Basename in the file.
Any help is appreciated.
Ravi
I'm trying to replace a character in a string. was facing problem in it.
$string = "D:\Folder\TEST \abc.txt"
i wanted to transform this string to "D:/Folder/TEST/abc.txt"
this is wot i tried, but doesn't work
$string = ~ s/\\/\//;
Another Q is related to fileparse.
Code:
$value = D:/Folder/TEST/abc.txt my ( $name, $path, $extension ) = fileparse ( $value, '\..*' ); $filename = $name . $extension;
$name = abc
$path = /
$extension =
Where am I going wrong. Do i need to install anything thing for this. I have included File::Basename in the file.
Any help is appreciated.
Ravi
Comment