Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 musing on the Monastery: (8)
As of 2015-07-03 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (56 votes), past polls