Is there any advantage to using an array over a string here?
I guess it depends on how the variable is used afterwards - if there are additional values being pushed onto the array, it might make sense. It's just assigning a single value to the array; personally I would have written my @sqltt = (<<EOF); to make it explicit that yes, I meant to assign a single value to this array. But if the code then goes on to use $sqltt[0] everywhere, and especially if it doesn't add elements to the array, then it would definitely have been better to just use a plain scalar in the first place.
use warnings; use strict; use Data::Dump; my @sqltt = <<EOF; Hello, World! EOF dd @sqltt; __END__ "Hello,\nWorld!\n"
Minor update to wording.
In reply to Re: Legacy code question
by haukex
in thread Legacy code question
by Zenzizenzizenzic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |