Return fullpathname if arg starts with "." else return arg value.

This commit is contained in:
Janet B. Anderson
2005-02-03 14:46:37 +00:00
parent f317abed5e
commit 880664adbb

View File

@@ -1,10 +1,19 @@
eval 'exec perl -S -w $0 ${1+"$@"}' # -*- Mode: perl -*-
if 0;
#
# Determine fullpathname if argument starts with "."
# else return argument value.
#
use Cwd 'abs_path';
my $dir;
if( $ARGV[0] )
{
$dir = abs_path("$ARGV[0]");
print "$dir\n";
if( $ARGV[0] ) {
if( $ARGV[0] =~ /^\./ )
{
$dir = abs_path("$ARGV[0]");
print "$dir\n";
} else {
print "$ARGV[0]\n";
}
}