Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
We don't bite newbies here... much
 
PerlMonks  

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

by Aragorn (Curate)
on May 24, 2005 at 08:01 UTC ( #459840=note: print w/ replies, xml ) Need Help??


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


Comment on Re: Why do you need to escape a string used as a paramater?
Select or Download Code
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://459840]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (20)
As of 2014-04-16 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (431 votes), past polls