Hello, I think you have to distinguish in your mind between having a multi source-file program (as you would often do in C) and writing a library of functions (as in libc). If you can imagine your routines as in a library, then can put them quite easily into a Perl module. The point is that library routines are self-contained. You don't, for example, consider printf as part of your program; it is just a library routine you use. In Perl, this is a potential problem with the scope of objects as variables in a module are not local to that module! You can also use "our" to make them very visible. I don't know if this helps but I have written several modules because I believe in re-usable code.
In reply to Re: Proper way to create packages and re-usable code?
by apadamson
in thread Proper way to create packages and re-usable code?
by bt101
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |