in reply to Re: Grade me! TAC
in thread Grade me! TAC

Ok, I'll bite. Why? \n requires simple double-quotish interpolation to work. $/ requires double-quotish interpolation, plus variable lookup in the symbol table.

$/ can also be re-set by the script to some other value (other than \n). If the script sets $/ to "End of Record", and you use $/ in place of \n... well, you know what it's going to print.

I don't mind seeing $/ here and there in one-off scripts, but can't imagine why you would use it to represent \n in a script that's going to be around awhile. It's definately not something you would read in perlstyle.

Maybe I missed the point?

UPDATE: Yes, I missed the point. The italics font made $! look like $/. Sorry everyone. :)


Dave

Replies are listed 'Best First'.
Re^3: Grade me! TAC
by runrig (Abbot) on Jun 11, 2004 at 16:05 UTC
    Look closely. grid6507 is advocating the use of dollar-bang, not dollar-slash. (Though it does look kind of like a slash in italics, doesn't it?).
      Good grief, the font got me! Yes, by all means use $! (dollar bang). Sorry folks, pay no attention. ;)

      Dave