in reply to Re: Get My Own Name
in thread Get My Own Name

This assumes you are not going deeper into the tree than the current dir. In that case, you may want to use:

use File::Basename; my ($scriptname, $scriptdir) = fileparse($0); while($file = shift(@files)){ my($name, $dir) = fileparse($file); unless($dir eq $scriptdir and $scriptname eq $name){ ... } }

Note: This code is drawn from memory, and not directly tested. I really should take the lead of some of the monks and just put a disclaimer in my sig. OTOH, I did check the perl docs to be sure I hadn't typoed names, and sure enough, I had, so at least it's not typo-rific.