in reply to RE: (redmist) RE: RE: (redmist) RE: Welcome baby @ISA...
in thread Welcome baby @ISA...

No, because "Bob" is the program in this case, so he would be referring to himself if he used $0 because $0 is the name of the script that is running.

redmist
redmist.dyndns.org
email::redmist
  • Comment on (redmist) RE: RE: (redmist) RE: RE: (redmist) RE: Welcome baby @ISA...

Replies are listed 'Best First'.
RE: (redmist) RE: RE: (redmist) RE: RE: (redmist) RE: Welcome baby @ISA...
by myocom (Deacon) on Nov 01, 2000 at 04:23 UTC

    Right, so if you name your child '$0' (note the non-interpolating quotes), when other people try to refer to him/her, they'll force interpolation.

    $Bob->Salutation($0);
    Bob: Hey, Bob.
    $0 : Why are you talking to yourself...?

    ...and this may very well be the geekiest conversation I've ever had. ++ for that! :-)

      "Right, so if you name your child '$0' (note the non-interpolating quotes), when other people try to refer to him/her, they'll force interpolation."

      Wait, don't single quotes force the variable to not be interpolated? (My question is this: Why does Bob mentioning the name of my kid force interpolation?)

      redmist
      redmist.dyndns.org
      email::redmist

        Yes, so you're naming your kid $0 (the quotes were there so that the myocom script didn't interpolate $0).

        I guess in my world, everyone interpolates when they speak (so 'that over there' actually refers to an object). Arguably, though, that happens when you hear/read, so when someone says "What's that over there?" you interpolate that to "What's the hairy monster" (assuming there's a hairy monster over there) and you can answer accordingly.

        But for the purposes of our script here, when Bob says "Hey, $0.", $0 (the kid) hears "Hey, Bob." Bob is incapable of producing '$0' without escaping it in some way.