There are a couple ways to approach this problem. For our solution, we used the Cwd (current working directory) module to find out where we were in the filesystem. We used a glob to get the list of all the files in the current directory; the names don't have the directory information, so we have to add that. You could have used opendir too, but glob is less typing. Our glob pattern includes .* to get the Unix hidden files, which don't match the * pattern.
Once we have all the filenames, we go through them with foreach. For every name, we call File::Spec->catfile( ) just like what that module shows in its documentation. We save the result in $path, then print that to standard output:
#!/usr/bin/perl
use Cwd; # Current Working Directory
use File::Spec;
my $cwd = getcwd;
my @files = glob ".* *";
foreach my $file ( @files )
{
my $path = File::Spec->catfile( $cwd, $file );
print "$path\n";
}