Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Newbie need a clue

by damian1301 (Curate)
on Mar 29, 2001 at 06:52 UTC ( [id://68030]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://68030]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-23 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found