1. The EOUSAGE is just how the program is supposed to be used, inside of a here document. With here documents, you don't have to escape characters or anything and they can interpolate variables as well. You should read up on them.
2.
The $0 variable is just what you said, it is the path to where the script is executing. What happens is with that substitution, it gets everything up to a slash in $0 (the
.* part does that which should really be
$0 =~ m#.*\\(.*)#; or so...) and deletes it.
Almost a Perl hacker.
Dave AKA damian
I encourage you to email me