On Aug 2, Michael Fowler said:

>You can only print a string.  When print is given multiple arguments it
>joins them with $" before printing.  This is documented in perldoc -f print.

*Cough* $, not $".

$" is used when you put an array (or array slice) in double quotes.

<WIZARDRY>

And, upon checking the source, you're incorrect.

/* from pp_hot.c:pp_print() */

            while (MARK <= SP) {
                if (!do_print(*MARK, fp))
                    break;
                MARK++;
                if (MARK <= SP) {
                    if (!do_print(PL_ofs_sv, fp)) { /* $, */
                        MARK--;
                        break;
                    }
                }
            }

That loop, in Perl, would look like:

  $_ = 0;
  while ($_ < @output) {
    last unless NATIVE_PRINT($output[$_]);
    $_++;
    if ($_ < @output) {
      $_--, last unless NATIVE_PRINT($,);
    }
  }

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to