inputfile:
base {
LOCATION:../set/projects/all/files
}
My code:
my $fn="inputfile";
open ( my $fh, '<', $fn ) or die "Could not open file '$fn': $!";
while ( <$fh> ) {
chomp;
if (/^LOCATION:\s*(\S+)/) {
$input_dir = $1;
print $input_dir;
}
My output is as follows:
../set/projects/all/files
expected one:
/set/projects/all/files
In the above code the location line has directory location.These directory location starts with ..
How can i remove the .. from the directory line and read only the location of the directory