in reply to How do you get around the lexical scoping of use pragmas?

Write a script to paste them in for you :)


DWIM is Perl's answer to Gödel
  • Comment on Re: How do you get around the lexical scoping of use pragmas?

Replies are listed 'Best First'.
Re^2: How do you get around the lexical scoping of use pragmas?
by Fletch (Bishop) on Aug 26, 2006 at 23:50 UTC

    Well, a more usual approach would to be to use whatever templating or skeleton facilities your editor provides (something like tempo mode or skeleton mode for Emacsen; I'm sure a vim using heathen will chime in with what they use :) to start off new programs from a base with everything you normally use.

    Even if your editor doesn't provide such a facility natively you can always write your own template once and then copy that into a new file (perhaps even getting fancy and using Template Toolkit or the like to fill in variable parts).

      Indeed. In fact I have used Komodo's template facility to do that in the past, except that it's pretty much as quick to type the two use lines so mostly I don't bother with the template.

      OP's immediate problem seems to be different however - 50+ (presumed existing) files that need to be updated. Sounds like a Perl script to me rather than editor fu.


      DWIM is Perl's answer to Gödel