Skip to main content

Hello all I have a .pl CGI program that calls a module with lots of code I'll call it now I need to update a few subs in it and possibly add a dependency.

The pl file looks like this:

use LotsOfCode;




Now I'd like this to say the same but I need to improve fish and cat. Say looks like this:

package LotsOfCode

sub fish {}

sub dog {}

sub cat {}


I'd like to

mkdir ./LotsOfiCode

nano LotsOfCode/ move sub fish{} here

nano LotsOfCode/ move sub dog {} here

nano LotsOfCode/ move sub cat {} here

what do I put in the top of these new files in \LotsOfiCode ?

package LotsOfCode::fish;


package fish; ?


nothing is what I have so far just

sub fish {}

then in

do I go:

package LotsOfCode

use LotsOfiCode::fish

use LotsOfiCode::dog

use LotsOfiCode::cat



do LotsOfCode::fish;

do LotsOfCode::cat;

do LotsOfCode::dog;

Thank you all in advance I get the more than one way to do it idea of Perl but feel like I keep fumbling with mixing old and new code.

submitted by /u/bug_splat
[link] [comments]