in reply to Here document syntax, what is $0 (was: Newbie need a clue)

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

Replies are listed 'Best First'.
(redmist) Re: Re: Newbie need a clue
by redmist (Deacon) on Mar 29, 2001 at 10:14 UTC

    Aha! But beware! Dot star will cause you trouble for Many Moons. See why here.

    redmist
    Silicon Cowboy
      Thank you and I am glad you pointed that out. I tried to get all the greediness I could on that because I wanted the expression to get all of the characters up to the last slash, and then the script's name that would follow. So, greediness can be good at times.

      Almost a Perl hacker.
      Dave AKA damian

      I encourage you to email me