Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: Command line question

by igotlongestname (Acolyte)
on Jun 19, 2008 at 17:31 UTC ( [id://692975]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Command line question
in thread Command line question

Yeah, you're dead on. This line is from a Makefile from an old code. This line has been stumping us a bit, and I'm the only one that knows Perl (and I don't know it that well), so I got lost trying to search this through as so many of the delimiters were odd to me (the s+ and ++g etc...).

So this is working code that does what it's supposed to, but I'm having trouble totally seeing what it does. I'd like to actually get the .depend file before the Perl script, then again after it to compare ... it may shed some light for me.

So what you're thinking is that each instance of ${something} is actually some value, stored in ${something} being passed in to the Perl script? Is that roughly correct?

Finally, could the $${OBJECT} be right? Could it be substituting the value of ${OBJECT}, with a preceding "$" sign into the code, to be read and interpreted by the shell?

I may be way off and talking over my head too, if it doesn't make sense, don't try to make it as it's probably wrong.

Thanks!

~Jack

Replies are listed 'Best First'.
Re^5: Command line question
by kyle (Abbot) on Jun 19, 2008 at 18:58 UTC

    I'd like to actually get the .depend file before the Perl script, then again after it to compare

    No problem! Change "perl -ni -e" to "perl -ni.bak -e", and you'll find a ".depend.bak" file that has its contents before perl got a hold of it. If there's already a .bak file being produced, you can use "perl -ni.before.tha.mangalang -e" or whatever.

    So what you're thinking is that each instance of ${something} is actually some value, stored in ${something} being passed in to the Perl script? Is that roughly correct?

    That's roughly correct, yes. Perl actually never sees them as variables. The interpolation is done by the shell (or make) before Perl comes into it. From its point of view, they're literal strings.

    Finally, could the $${OBJECT} be right?

    I don't think so. If that's really what perl sees, it's going to come out as an empty string because within the context of the Perl that's running, there is no $OBJECT variable with a value. I think that it's actually coming out as "\${OBJECT}", and winds up in the .depend file that way. This is one part of this whole thing I'm really not sure about, so take my words with salt, please.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 22:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found