Hi..
I am facing one strange problem. I cant split and rejoin this on a winNt platform. The example follows:
$input=c:\final\test\test1.txt
I want to get rid of the last part and check whether the path is valid or not.
my desired output should be
$output= c:\final\test
but i cant split the directories into fields with field speparator.
My script follows:
$input=$ARGV[0];
@edit_array=split(/\/,$input);
pop(@edit_array);
$pattern=join(/\/,@edit_array);
$path_final=$pattern."/" ;
print "The edited path is: $path_final\n";
...But.. i find lotz of error regarding "Backslash found where operator expected.. run away multiline "..etc...etc..
Can any1 help me regarding this?
Ejaj
I am facing one strange problem. I cant split and rejoin this on a winNt platform. The example follows:
$input=c:\final\test\test1.txt
I want to get rid of the last part and check whether the path is valid or not.
my desired output should be
$output= c:\final\test
but i cant split the directories into fields with field speparator.
My script follows:
$input=$ARGV[0];
@edit_array=split(/\/,$input);
pop(@edit_array);
$pattern=join(/\/,@edit_array);
$path_final=$pattern."/" ;
print "The edited path is: $path_final\n";
...But.. i find lotz of error regarding "Backslash found where operator expected.. run away multiline "..etc...etc..
Can any1 help me regarding this?
Ejaj