I am fairly new to Perl. I did a lot with it in the mid 90s and came back about 8 months ago. There is a lot I dont know and probably a lot of things I have forgotten.
I picked up Perl to write a couple of applications that I was hoping could run on MacOS, Linux,OpenBSD, and Windows. Perl runs on all of them and many come with Perl built in. Simple scripts I have written run pretty well. (Lets forget about Windows for now).
When I start using libraries(packages?) there is a world of hurt.
Now some libraries pretty much usually work, but many do not. Which works and which do not seems to be dependent upon the operating system and distro.
Then I have to start with what version of Perl is running everywhere. That is annoying.
I end up spending a lot of time on a new machine when I want to run my application, doing nothing else than trying to get the libraries installed.
So I decided to adopt PerlBrew (havent tried it on OpenBSD yet) That should give me a stable version across the differnt platforms.
Then I decided I wanted to write a shell script that would handle installing all of the libarires I might use once and for all so I would know they were all accounted for.
perlbrew exec -q --with perl-5.40.0 cpanm install DBI
Then libraries I have pulled from CPAN do not work.
Google here and Google there.
Ok install GCC and make (I should have known this) More problems:
I found a few of these: "Why are you using CPAN for this? Use the compiled packages that come with <OS><type>"
Hmm I would have thought that CPAN shold be the best source? How do I know what exists as pre built packages on what platform?
Using apt search "perl" or "-perl" or "perl" does not help that much.
I have XML::LibXML working on Mac but getting it working on Ubuntu 22 I have been able to do. I have even tried to start OpenBSD yet)
Is writing cross platform applications in Perl meant to be this difficult?
Should I avoid libraries at all costs and write an aweful lot of code myself?
Is there an easy way to guess what libraries will almost certainly work and what libraries will most likely never work? Some kind of warning system?
Should I look into using pp? I havent yet figured out how to make it compile for Ubuntu,MacOs,OpenBSD yet.
In GoLang its a couple of flags to set for each architecture and off it goes.
ShouldI look into Par files? (or was it Far) that are supposesd to contain the nessescary libraries within itself?
What am I doing wrong?
Libraries in my current set Given all the experimenting some of them are now wrong.
Array::Set, Array::Unique, Bundle::LWP, Data::Dump, Data::Dumper, DateTime, DBD::SQLite, DBI, Digest::file, Digest::MD5, Digest::MD5::File, File::Basename, File::Compare, File::Copy, File::Find, File::Find::Rule, File::Glob, File::Path, File::Slurp, File::Spec, Image::ExifTool, Image::Info, IO::All, List::Compare, List::Gen, List::MoreUtils, List::SomeUtils, List::Util, List::UtilsBy, Log::Minimal, LWP, LWP::Simple, Path::Tiny, Term::ANSIColor, Text::Fuzzy, Type::Tiny,Moose,MooseX::Types,WWW::Mechanize
submitted by /u/NoeticIntelligence
[link] [comments]