Skip to main content



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

The pl file looks like this:

main.pl

use LotsOfCode;

Lotsofcode->cat();

LotsOfCode->dog();

Lotsofcode->fish();

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

package LotsOfCode

sub fish {}

sub dog {}

sub cat {}

1;

I'd like to

mkdir ./LotsOfiCode

nano LotsOfCode/fish.pm move sub fish{} here

nano LotsOfCode/dog.pm move sub dog {} here

nano LotsOfCode/cat.pm move sub cat {} here

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

package LotsOfCode::fish;

or

package fish; ?

or

nothing is what I have so far just

sub fish {}

then in LotsOfCode.pm

do I go:

package LotsOfCode

use LotsOfiCode::fish

use LotsOfiCode::dog

use LotsOfiCode::cat

1;

or

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]



Why is "!!" considered bad form in Perl? [updated for 2024] submitted by /u/EvanCarroll
[link] [comments]


Filed under "Things that one can do, but why?" , here is the repo of using Perl to learn assembly, or rather use Perl to avoid

  1. having a C driver program
  2. make files
  3. multiple files (Inline::ASM allows one to keep Perl and Assembly in the same file

Bonus :

  1. it is insane how efficient some of the list utilities at List::Util are !
  2. Seems Github uses file extensions to count lines of code in a language (the repo is considered all Perl

Link https://github.com/chrisarg/perlAssembly

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



Anybody wants to add a Perl implementation to this?

(I'm currently on a train and have to change soon, but if nobody implements I might give it a try later)

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



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