Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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
Replies are listed 'Best First'.
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.
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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2015-10-13 19:35 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (314 votes), past polls