http://www.perlmonks.org?node_id=459840


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

The "\" in this case makes a reference to the variable $intr_html. When a "normal" variable is given to HTML::TokeParser::new, it is taken to be a filename to open and read. When a reference is given, it is taken to be a "pointer" to the text in $intr_html to be parsed.

See perlreftut for a tutorial on references and perlref for all the details.

Arjen

Replies are listed 'Best First'.
Re^2: Why do you need to escape a string used as a paramater?
by Tomtom (Scribe) on May 24, 2005 at 09:09 UTC
    Could we consider a reference "\" in Perl the same thing as a "&" in C, for example ?

    Tomtom
      Superficially, yes. "Under water", there's a lot more going on with Perl references, like automatic memory management.

      Arjen