Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: HTML::Parser fun

by FreakyGreenLeaky (Sexton)
on Jun 04, 2008 at 14:13 UTC ( #690145=note: print w/ replies, xml ) Need Help??


in reply to Re: HTML::Parser fun
in thread HTML::Parser fun

Cool! I should remember that. My experience with perl is somewhat lacking.

Speaking of which, what's up with the propensity of perl gurus to use qq{} and q{} so much when plain old '' or "" would do?


Comment on Re^2: HTML::Parser fun
Re^3: HTML::Parser fun
by hilitai (Monk) on Jun 04, 2008 at 14:31 UTC
    ...what's up with the propensity of perl gurus to use qq{} and q{} so much when plain old '' or "" would do?

    I think it's mainly a scaling thing – unless your list contains only one or two items, qq{} will save your fingers a bunch of trips to the [Shift] and ['] keys. Sorry, misread the question in my haste. Please disregard.

Re^3: HTML::Parser fun
by kyle (Abbot) on Jun 04, 2008 at 14:40 UTC

    I can't speak for others, but here are a couple of the benefits I see.

    • Less escaping necessary. q{brace {fun}} does what I want. I can say q{"quote" 'fun'} too. You do need to escape braces in a q{} if they're unbalanced, but otherwise it just works.
    • It stands out a little more for small expressions (q{} vs '').
    • Even if I don't have to escape anything now, I might have to later. If I code with q{} today, it saves me having to change to it later.
    • Likewise, it's easier to go from q{} to qq{} than it is to go from '' to "" if my interpolation behavior needs to change.
      OK - I understand. Something akin to the philosophy of always including a dangling comma in a list declaration - easy to add elements later without error, etc.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2014-07-11 04:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (218 votes), past polls