in reply to Why do you need to escape a string used as a paramater?

That's not an escape as in quotes, it takes a reference to $intr_html. That speeds up parameter passing by removing the need to make a copy.

After Compline,
Zaxo

  • Comment on Re: Why do you need to escape a string used as a paramater?

Replies are listed 'Best First'.
Re^2: Why do you need to escape a string used as a paramater?
by bart (Canon) on May 24, 2005 at 08:20 UTC
    That speeds up parameter passing by removing the need to make a copy.

    That's only part of the story. It's also, even most of all, the way HTML::TokeParser distinguishes between literal HTML in a string, and a string holding the file name of a file containing the HTML:

    $p = HTML::TokeParser->new( $filename ); $p = HTML::TokeParser->new( $filehandle ); $p = HTML::TokeParser->new( \$document );
    Note cases 1 and 2.

    Choosing this convention instead of the other way around, was indeed the wisest choice with regard to efficiency.