Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.

Quick

  • ($a, $b....) = unpack("A2A7...", $packed)
  • push( array, list )

Friday, June 19, 2015

local and do

'local modifies the listed variables to be local to the enclosing block, file, or eval' - but
  • a do is only 'largely' like an eval - this is one of the respects in which it differs
  • the script that you do may be physically in another file, but when you do it, it is as if it is part of the file where the do is
Or to put it more succinctly, if a.pl uses a filehandle FH, and so does b.pl, and you do b.pl from a.pl, you cannot use local(*FH) in b.pl to stop b.pl's FH from being the same handle as a.pl's.

I worked round this by putting a package X at the top of b.pl, no doubt there are other ways.

Followers

Blog Archive