#!/usr/bin/perl use Cwd; use strict; use warnings; use Cwd 'abs_path'; my $file = $ARGV[0]; my $dir = getcwd; my $abs_path = abs_path($file); print $abs_path . "\n";