in reply to What for sigils were allowed to be separated from identifiers?
Good example of why you should always use warnings;?
$ perl -wE '$name = q(Fred); $debt = 50; say qq(You pay me ${debt}$ 00 + cents, $name, or else!)' Use of uninitialized value $00 in concatenation (.) or string at -e li +ne 1. You pay me 50 cents, Fred, or else!
Update: Also a good demo of why interpolation can be dangerous and the case for using sprintf?
$ perl -E '$name = q(Fred); $debt = 50; say sprintf q(You pay me %s$ 0 +0 cents, %s, or else!), $debt, $name' You pay me 50$ 00 cents, Fred, or else!
|
|---|