foo instead of $foo, buried deeply in a mountain of shit source code. A bareword, meant to be a variable-reference, but acceptable to the Perl compiler.
How would "the Perl compiler" accept 'foo' as a bareword if you were using strict and/or warnings? Couldn't you find the problem immediately if you turned those on?
#! perl # 1134136.pl use strict; my ($bottom, $top); my @mountain = ($bottom, $top, foo); exit;
[05:38][nick:~/monks]$ perl 1134136.pl Bareword "foo" not allowed while "strict subs" in use at 1134136.pl li +ne 4. Execution of 1134136.pl aborted due to compilation errors.
#! perl # 1134136-2.pl use warnings; my ($bottom, $top); my @mountain = ($bottom, $top, foo); exit;
[05:41][nick:~/monks]$ perl 1134136-2.pl Unquoted string "foo" may clash with future reserved word at 1134136-2 +.pl line 5.
In reply to Re^2: Optional quotes: to use or not to
by 1nickt
in thread Optional quotes: to use or not to
by hurricup
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |