Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Perl Concatenate vs Append Operator

by Jim (Curate)
on Aug 19, 2014 at 16:59 UTC ( #1098002=note: print w/replies, xml ) Need Help??


in reply to Perl Concatenate vs Append Operator

Neither is more correct than the other. TMTOWTDI, that's all.

I prefer to use the assignment operators because I think they're more intuitive and more idiomatic. And I prefer auto-increment and auto-decrement to the assignment operators. So I'd do this…

$total_days++;

…instead of this…

$total_days += 1;

…and I'd never do this…

$total_days = $total_days + 1;

UPDATE:  I concur with Your Mother's remarks about the concatenation operator. I hardly ever use it. In most cases, there's a better way to accomplish one's string-building tasks using other methods, particularly join().

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2021-01-27 21:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?