in reply to using s/// to remove file extensions

You may also wish to check out File::Find as this will help you to recursively scan an entire directory structure and do something with each file that you find. The code below should work OK for you.
use File::Find; my @directories = @ARGV ? @ARGV : ('.'); find(\&wanted, @directories); sub wanted { return unless /\.pdf$/i; print "working with $File::Find::name\n"; }