submitted by /u/briandfoy [link] [comments] |
- YouTube
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.www.youtube.com
I found a script from 2008 year, that renames files to random filenames:
```
!/usr/bin/perl
randomize the filenames for the photo frame
https://www.bulkrenameutility.co.uk/forum/viewtopic.php?t=114
$dir = $ARGV[0] || die "directory?\n"; chdir($dir) || die "chdir";
opendir(D, ".") || die "opendir"; @files = grep {/jpg/} readdir(D); closedir(D);
array shuffle from perl FAQ
srand; @newfiles = (); for (@files) { my $r = rand @newfiles + 1; push(@newfiles,$newfiles[$r]); $newfiles[$r] = $_; }
if ($#files != $#newfiles) { die "$#files != $#newfiles\n"; }
while ($old = pop @files) { $new = pop @newfiles; $new =~ s/p/r/; ! -f $new || die "won't overwrite $new - check the regexp\n"; print "$old -> $new\n"; rename $old, $new || warn "rename $old -> $new: $!\n"; } ```
If I run it as perl foo.pl ./
, there is won't overwrite bar.jpg - check the regexp
error. And if I run it as perl fo.pl ./bar.jpg
, there is chdir at foo.pl line 7
error. How to make it work?
I have Perl 5.34.1 installed.
submitted by /u/Impressive-West-5839
[link] [comments]
Abe Timmerman ABELTJE has passed away yesterday after a long fight with cancer.
A long time participant in what are now called Perl Toolchain Summits, he was co-responsible for setting up the Perl smoking infrastructure.
And was always a welcome guest at almost all YAPC::EU conferences, as well as many Dutch and Belgian Perl Workshops, and NLPM (Dutch PerlMongers) meetings.
He will be missed. R.I.P.
submitted by /u/liztormato
[link] [comments]
submitted by /u/OODLER577 [link] [comments] |
- YouTube
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.www.youtube.com
If there was a mechanism to,
- Opt-into Markdown documentation on a per-file basis.
- Document your code with Markdown instead instead of POD
Assuming these concerns were met,
- A call to
perldoc MyModule
rendered the Markdown to text with something likemdcat
which supports images, links - No browser was required at all (
mdcat
works without a browser). - Support for terminal-rendering of Markdown was a part of core.
- All of this was done merely by creating a distinction between a code-comment, and a doc-comment as demonstrated in this repo, where
- A doc comment was marked with a line starting
##
- Any other use of
#
continues to carry code-commenting semantics
- A doc comment was marked with a line starting
Would you prefer it and use it?
submitted by /u/EvanCarroll
[link] [comments]
GitHub - swsnr/mdcat: cat for markdown
cat for markdown. Contribute to swsnr/mdcat development by creating an account on GitHub.GitHub
submitted by /u/leejo [link] [comments] |
London Perl & Raku Workshop, 2024
London Perl & Raku Workshop. Perl & Raku Conference and training in London.act.yapc.eu
I have a Mac M1 chip laptop.
While I have managed to install a couple of modules, most fail to install.
I tried perlbrew, but that was a struggle to even get it to install perl itself, but when it was installed it wasn't working the way I needed it to.
Just wondering if I am missing something with CPAN or if this is an issue because it's an M1 chip?
submitted by /u/MrCosgrove2
[link] [comments]
How to use perl v5.40's boolean builtins in Mojo::Pg queries
The final installment in the series:
"The-Quest-For-Performance" from my blog Killing It with #perl
Discussing #python #numpy #numba, #rstats #openMP enhancements of Perl code and #simd
Bottom line: I will not be migrating to Python anytime soon.
Food for thought: The Perl interpreter (and many of the modules) are deep down massive C programs. Perhaps one can squeeze real performance kicks by looking into alternative compilers, compiler flags and pragmas ?
submitted by /u/ReplacementSlight413
[link] [comments]
The Quest for Performance Part IV : May the SIMD Force be with you
At this point one may wonder how numba, the Python compiler around numpy Python code, delivers a performance premium over numpy.Killing-It-with-PERL
I would be interested to know why you chose Perl and how long you have been using it and what for.
I have just returned to Perl after many years away, think decades rather than a couple of years. Consider me a noob as I've long forgotten anything I knew about the language.
I run a small home webserver, Apache on Windows 10 with Strawberry Perl, and recently started some projects starting with moving away with things like Google Analytics and going back to some old log analyzers such as AWStats, which is still being maintained, and W3Perl, which is not. Even more recently I have started using Ringlink.
Perl is still being developed, Strawberry, Active State, CPAN etc. but lost out to PHP and Python. Just like COBOL, I can easily imagine thousands of systems depend on Perl.
submitted by /u/brisray
[link] [comments]
Download & Install Perl - ActiveState
Download Perl 5.32 and 5.28 from ActiveState & get precompiled Perl distribution. ActiveState Perl is free to download.ActiveState
Have been using the official MongoDB driver to date (https://metacpan.org/dist/MongoDB) but its obviously EOL and now I can't get it to work with perl v.540 on OSX.
For those interested it fails on BSON::XS and I cannot force install either.
cp XS/XS.xs blib/lib/BSON/XS/XS.xs Running Mkbootstrap for XS () chmod 644 "XS.bs" "/usr/local/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- XS.bs blib/arch/auto/BSON/XS/XS.bs 644 "/usr/local/bin/perl" "/usr/local/lib/perl5/5.40.0/ExtUtils/xsubpp" -typemap '/usr/local/lib/perl5/5.40.0/ExtUtils/typemap' xs/XS.xs > xs/XS.xsc mv xs/XS.xsc xs/XS.c cc -c -I. -Ibson -fno-common -DPERL_DARWIN -mmacosx-version-min=14.5 -DNO_THREAD_SAFE_QUERYLOCALE -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_GNU_SOURCE -DMONGO_USE_64_BIT_INT -DBSON_COMPILATION -Wno-error=implicit-function-declaration -O3 -DVERSION=\"v0.8.4\" -DXS_VERSION=\"v0.8.4\" -o xs/XS.o "-I/usr/local/lib/perl5/5.40.0/darwin-2level/CORE" xs/XS.c xs/XS.xs:216:3: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] PUSHMARK (SP); ^~~~~~~~~~~~~ /usr/local/lib/perl5/5.40.0/darwin-2level/CORE/pp.h:120:5: note: expanded from macro 'PUSHMARK' STMT_START { \ ^~~~~~~~~~ ./ppport.h:4305:31: note: expanded from macro 'STMT_START' # define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */ ^ xs/XS.xs:216:3: note: '{' token is here PUSHMARK (SP); ^~~~~~~~~~~~~ /usr/local/lib/perl5/5.40.0/darwin-2level/CORE/pp.h:120:16: note: expanded from macro 'PUSHMARK' STMT_START { \ ^ xs/XS.xs:216:3: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] PUSHMARK (SP); ^~~~~~~~~~~~~ /usr/local/lib/perl5/5.40.0/darwin-2level/CORE/pp.h:129:5: note: expanded from macro 'PUSHMARK' } STMT_END ^
With that said, whats the most appropriate alternative out there?
submitted by /u/kosaromepr
[link] [comments]
A couple of data/compute intensive examples using Perl Data Language (#PDL), #OpenMP, #Perl, Inline and #Python (base, #numpy, #numba). Kind of interesting to see Python eat Perl's dust and PDL being equal to numpy.
OpenMP and Perl's multithreaded #PDL array language were the clear winners here.
submitted by /u/ReplacementSlight413
[link] [comments]
The Quest for Performance Part I : Inline C, OpenMP and PDL
Sometimes, one’s code must simply perform and principles, such as aeasthetics, “cleverness” or commitment to a single language solution simply go out of the window.Killing-It-with-PERL
Hello all. I installed Perlbrew to try it out using Perl modules without admin rights. My machine is Linux EOS. When I run a simple perl script it gives error Cant locate Modern/Perl.pm in \@INC. How do I make Emacs know that I am using perlbrew and not system Perl? Or how do add the perlbrew PATH to global \@INC? I also have setup Devel::PerlySense inside Emacs following the module documentation. I installed some modules using cpanm client. I'm new to Perl and Emacs and sometimes I'm lost n doesnt know what I'm doing lol 😀 Appreciate your pointing me to the right direction. Below are some log details:
Can't locate Modern/Perl.pm in u/INC (you may need to install the Modern::Perl module) (@INC entries checked: /usr/lib/perl5/5.38/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/5.38/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/5.38/core_perl /usr/share/perl5/core_perl) at ./read_input_stdin line 4.
BEGIN failed--compilation aborted at ./read_input_stdin line 4.
❯ perlbrew info
Current perl:
Name: perl-blead
Path: /home/user/perl5/perlbrew/perls/perl-blead/bin/perl
Config: -de -Dprefix=/home/user/perl5/perlbrew/perls/perl-blead -Dusedevel -Aeval:scriptdir=/home/user/perl5/perlbrew/perls/perl-blead/bin
Compiled at: Jul 6 2024 10:50:31
perlbrew:
version: 0.98
ENV:
PERLBREW_ROOT: /home/user/perl5/perlbrew
PERLBREW_HOME: /home/user/.perlbrew
PERLBREW_PATH: /home/user/perl5/perlbrew/bin:/home/user/perl5/perlbrew/perls/perl-blead/bin
PERLBREW_MANPATH: /home/user/perl5/perlbrew/perls/perl-blead/man
❯ perl --version
This is perl 5, version 41, subversion 2 (v5.41.2 (c5df4fd1012cc64d1b3e19c87bf8c51d4f3f90d6)) built for x86_64-linux
❯ perlbrew list-modules | grep modern
Modern::Perl
submitted by /u/Ill-Dependent2628
[link] [comments]
[link] [comments]
Combining calendars - Perl Hacks
One of the most popular posts I've written in recent months was the one where I talked about all the pointless personal projects I have. The consensus in the many comments I received was that anything you find useful isn't pointless.Dave Cross (Perl Hacks)
Anyone have any insight? https://www.perlmonks.org/r/perl/.rss
submitted by /u/saltyreddrum
[link] [comments]
submitted by /u/OvidPerl [link] [comments] |
An OpenAI Chatbot in Perl
The OpenAPI::Client::OpenAI module is very low-level. We show how to write a wrapper around it for a clean interface with production code.curtispoe.org
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]
Repository of examples using Perl and Assembly together