in reply to Re^2: appending a variable
in thread appending a variable
Aktchually they compile down to the same thing under the hood (because the former is just syntactic sugar for the latter more or less):
$ perl -MO=Deparse,-p,-q -E 'my $foo = qq{a_${blah}_b}; my $bar = q{a_ +} . $blah . q{_b};' use feature 'current_sub', 'bitwise', 'evalbytes', 'fc', 'postderef_qq +', 'say', 'state', 'switch', 'unicode_strings', 'unicode_eval'; (my $foo = 'a_' . $blah . '_b'); (my $bar = 'a_' . $blah . '_b'); -e syntax OK
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: appending a variable
by pragovnj (Acolyte) on Apr 28, 2022 at 21:13 UTC | |
by hippo (Archbishop) on Apr 28, 2022 at 21:35 UTC | |
by pragovnj (Acolyte) on Apr 28, 2022 at 22:26 UTC | |
by GrandFather (Saint) on Apr 28, 2022 at 23:36 UTC | |
by Marshall (Canon) on Apr 29, 2022 at 01:28 UTC | |
by pragovnj (Acolyte) on Apr 29, 2022 at 13:35 UTC | |
|