Local::Module 1.5; $ perl ‐e 'use Data::Dumper 500' Data::Dumper version 500 required‐‐this is only version 2.130_02 at ‐e line 1. BEGIN failed‐‐compilation aborted at ‐e line 1. 27 / 70
'use warnings; print(5+"a")' Argument "a" isn't numeric in addition (+) at ‐e line 1. $ perl ‐we 'print(5+"a")' Argument "a" isn't numeric in addition (+) at ‐e line 1. 36 / 70
Argument "a" isn't numeric in addition (+) at ‐e line 1 (#1) (W numeric) The indicated string was fed as an argument to an operator that expected a numeric value instead. If you're fortunate the message will identify which operator was so unfortunate. 37 / 70
# 'croak' will be removed sub bar { 23 } # 'bar' will be removed # remove all previously defined functions use namespace::clean; sub baz { bar() } # 'baz' still defined, 'bar' still bound # begin to collection function names from here again no namespace::clean; sub quux { baz() } # 'quux' will be removed # remove all functions defined after the 'no' unimport use namespace::clean; use namespace::autoclean 52 / 70
make $foo dynamically local local (@wid, %get); # make list of variables local local $foo = "flurp"; # make $foo dynamic, and init it local @oof = @bar; # make @oof dynamic, and init it local $hash{key} = "val"; # sets a local value for this hash entry delete local $hash{key}; # delete this entry for the current block local ($cond ? $v1 : $v2); # several types of lvalues support localization # localization of symbols local *FH; # localize $FH, @FH, %FH, &FH ... local *merlyn = *randal; # now $merlyn is really $randal, plus # @merlyn is really @randal, etc local *merlyn = 'randal'; # SAME THING: promote 'randal' to *randal local *merlyn = \$randal; # just alias $merlyn, not @merlyn etc 55 / 70
‐ module for manipulating JSON‐formatted data libjson‐pp‐perl ‐ module for manipulating JSON‐formatted data (Pure Perl) libjson‐xs‐perl ‐ module for manipulating JSON‐formatted data (C/XS‐accelerated) $ apt‐get install libjson‐perl 59 / 70