A
Ashok
I am having some problem with the substitution operation. This is what
I am trying to do:
Get a directory path from the user and also the search string in the
path and remove the string from the path.
Input String: c:\ashok\temp\perl
Search String: c:\ashok
So the output should be temp\perl.
The Program I wrote looks like this:
$input = <STDIN>;
$search = <STDIN>;
$input =~ s/$search//;
print $input;
But this does not work. It looks like there is some confusion with the
special characters :, \ .
Can somebody tell me what's wrong and how do I fix this?
Thanks,
Ashok.
I am trying to do:
Get a directory path from the user and also the search string in the
path and remove the string from the path.
Input String: c:\ashok\temp\perl
Search String: c:\ashok
So the output should be temp\perl.
The Program I wrote looks like this:
$input = <STDIN>;
$search = <STDIN>;
$input =~ s/$search//;
print $input;
But this does not work. It looks like there is some confusion with the
special characters :, \ .
Can somebody tell me what's wrong and how do I fix this?
Thanks,
Ashok.