Thakns this worked!!!
Is there any simple method to do to parent directory.
similar to "cd .."??
Quote:
Originally Posted by MobileUser
Hi,
It should work fine. I tried the following...
Code:
#!/usr/bin/perl -w
use strict;
# Program to accept a file path and store it in a array
my $dir = "/abc/def/ghi/";
my @Dir = split(/\//, $dir);
pop(@Dir);
my $PreviousDir = join("/", @Dir);
print "The original Directory is $dir\n";
print "The new Directory is $PreviousDir\n";
|