!/usr/bin/perl -w use strict; use Image::Size; use Data::Dumper; use File::Find; use File::Spec; use vars qw/*name *dir/; *name = *File::Find::name; *dir = *File::Find::dir; die "Usage: filecomp \n" unless (@ARGV == 2); my ($path, $pat) = @ARGV; my $qpat = qr/$pat/i; chomp (my $cwd = `pwd`); my $abspath = File::Spec->rel2abs($path, $cwd); print "Absolute base path is ",$abspath, "\n"; print "Location Filesize\n"; File::Find::find({wanted => \&wanted, # follow => 1 }, $path); sub wanted { /^$qpat/ && do { my $fullname = File::Spec->rel2abs($name, $abspath); printf "\n ------------- \n\$fullname is %s\n", $fullname; printf "\$name is %s\n", $name; --Results, with output from find to show that the files do exist-- [eggie@sunlink eggie]$ find tmp -name 'term*' -ls 4103 1 -rw------- 1 eggie eggie 160 Sep 2 16:52 tmp/terminal.txt 675863 1 -rw------- 1 eggie eggie 160 Sep 3 14:35 tmp/foo/terminal.txt [eggie@sunlink eggie]$ filecomp.pl tmp 'term.*' Absolute base path is /home/eggie/tmp Location Filesize ------------- $fullname is /home/eggie/tmp/tmp/terminal.txt $name is tmp/terminal.txt ------------- $fullname is /home/eggie/tmp/tmp/foo/terminal.txt $name is tmp/foo/terminal.txt