in reply to Perl::Critic and Subroutines
'Useless interpolation of literal string' means that you're using double-quoted strings when single-quoted would do.
'Expression form of "eval"' means you're using stringy eval (i.e. eval "code") rather than block eval (eval { code }).
By the way, what you're doing (passing around names of variables and evaling them) is kinda dumb. Notice how this doesn't work:
sub define_var_and_print_it { my $xyz = "hello"; print_var_with_err("\$xyz", "\$xyz"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl::Critic and Subroutines
by daugh016 (Initiate) on Nov 27, 2012 at 22:26 UTC | |
by tobyink (Canon) on Nov 28, 2012 at 08:17 UTC | |
by daugh016 (Initiate) on Nov 28, 2012 at 20:46 UTC |