#perl - Thu 29 Mar 2007 between 11:28 and 11:32

NY Lost Funds



RandalFlawless yes
f00li5hFlawless: why not stuff foo() in a module?
Randalbut you should really learn about modules
FlawlessRandal: I know
Randal: It's on my todo list ;)
Randalthen you can do "selective import"
can't do that with require
actionf00li5h has pattern recognition
f00li5hhas pattern recognition
Flawlessf00li5h: would it make sense to put a module in /etc/fooapp.pm ?
f00li5hFlawless: no.
you want to put it somewhere listed in @INC
Flawlessf00li5h: it just seems a small simple require'd file would make more sense?
Randalthey always start out simle
simple
f00li5hFlawless: only if you don't know modules
Flawlessf00li5h: I could add /etc/fooapp/ to @INC..
f00li5hFlawless: that's true
Randalthis gets scarier and scarier
Flawlessis that considered a hack?
f00li5hFlawless: it's all global
and /etc/ is for config files
you're looking for more of a /lib
RandalFlawless - in the privacy of your own cube, do what you want
FlawlessRandal: hehe, thanks ;)
Randalbut please learn how it's done properly, soon
FlawlessRandal: I will
RandalI can recommend a good book!
(or two)
FlawlessThis is the situation: Suppose I have quite a few perl subs that perform useful actions on a firewall
Randalon the top of the wall?
teetering there, precariously?
Flawlessnow, writing a config file format (even with a very neat package that reads and parses the file), would take a very long time
Randalyou don't have to write the config file *format*
that comes along with the module. :)
I recommend Config::Scoped
Flawlesshaving a file somewhere in /etc/ that would call the subs, would be much easier
f00li5hFlawless: and here's one i prepared earlier
Randalit allows nested definitions
actionFlawless looks at Scoped
Flawlesslooks at Scoped
Randaland limited Perl execution

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 100 107 

IrcArchive

NY Lost Funds