Skip to main content



Per Context Catalyst Component - John Napiorkowski - TPRC 2024 - Lightning Talk submitted by /u/briandfoy
[link] [comments]


This is not Perl specific, but in our new era of this Perl economy everyone should be thinking about side-hustles and income streams. Perl is perfect for creating SaaS and other services because for efficient practitioners it presents the most efficient way to prototype a lot of things via the web.

For example, shared hosting is dirt cheap and supports cgi-bin; VMs on the cloud are also dirt cheap and you probably don't need more than a $5 instance to POC something that will be good enough to test interest. Knowing more about pricing models is part of that. This is an interesting article about SaaS pricing models, and know more about that is certainly part of creating paid services. Enjoy.

https://garrettdimon.com/journal/posts/data-modeling-saas-entitlements-and-pricing

* sorry the code examples in here are Python, but I think for this purpose we can look past that

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




Hi all! This is my first Perl script.

#!/usr/bin/perl use strict; use warnings; use Curses::UI; use Data::Dumper; use JSON; # Create the root Curses::UI object my $cui = Curses::UI->new(-color_support => 1); # Set up a signal handler to exit on Ctrl+C $cui->set_binding(sub { exit(0); }, "\cC"); # Create the main window my $win = $cui->add('window_id', 'Window'); # URL to fetch email address my $response = "https://www.1secmail.com/api/v1/?action=genRandomMailbox&count=1"; # Variable my $email_address = ''; my $username = ''; my $domain = ''; my $formatted_email = ''; my $formatted_json = ''; my $formatted_inbox = ''; my $Id = ''; my $box = ''; # my $filename = '/home/ola/Work/Languages/Perl/curses-ui/1/TempMail-Curses-UI/file.txt'; # Calculate the center Y position based on the window height my $window_height = $win->height(); my $center_y = int(($window_height - 1) / 2); # Create $win->add( 'buttonbox_id', 'Buttonbox', -y => $center_y, -buttons => [ { -label => '< Get Random Email >', -onpress => sub { $email_address = `curl -sL $response`; chomp($email_address); $email_address =~ s/^\["(.*)"\]$/$1/; print $email_address; # Split the email into username and domain my ($username, $domain) = split('@', $email_address); chomp($domain); print "Username is: $username\n"; print "Domain is: $domain\n"; # Copy system("echo $email_address | xsel --clipboard --input"); # Write to file open(FH, '>', $filename) or die $!; print FH $email_address; close(FH); # print "Writing to file successfully!\n"; # Send test mail # system("perl SendMailTest.pl"); # Display the output in a dialog $cui->dialog( -message => "Random Email:\n$email_address\n Copied To Clipboard", -title => "Email Address", -buttons => [ { -label => '< OK >', -value => 1, -shortcut => 'o', } ], ); } }, { -label => '< Update Inbox >', -onpress => sub { # my $command_output = `curl -sL "https://www.1secmail.com/api/v1/?action=getMessages&login=2gqhd4oz4wb&domain=laafd.com"`; my $command_output = `curl -sL "https://www.1secmail.com/api/v1/?action=getMessages&login=$username&domain=$domain"`; chomp($command_output); $formatted_json = decode_json($command_output); $Id = $formatted_json->[0]->{id}; # Display the output in a dialog box $cui->dialog( -message => $formatted_json->[0]->{subject}, -title => "$Id = $formatted_json->[0]->{id}", -buttons => [ { -label => '< Fetch Mail Body >', -value => 1, -shortcut => 'o', } ], ); $Id = $formatted_json->[0]->{id}, # my $inbox = `curl -sL "https://www.1secmail.com/api/v1/?action=readMessage&login=2gqhd4oz4wb&domain=laafd.com&id=$Id"`; my $inbox = `curl -sL "https://www.1secmail.com/api/v1/?action=readMessage&login=$username&domain=$domain&id=$Id"`; chomp($inbox); my $formatted_inbox = decode_json($inbox); my $box = $formatted_inbox->{textBody}; # print Dumper($formatted_inbox); print $box; $cui->dialog( -message => $box, -title => "$Id = $formatted_json->[0]->{subject}", -buttons => [ { -label => '< OK >', -value => 1, -shortcut => 'o', } ], ) } }, ], -buttonalignment => 'middle', ); $cui->mainloop; 

This is a script to fetch a temp mail address from the API, then display the contents of its inbox.

Problem


Everything was working fine, but suddenly I'm getting an error about screen size. I am literally clueless at this point.

Error:


Your screen is currently too small for this application.

Resize the screen and restart the application.

Press <CTRL+C> to exit...

Info


Terminal has 45 lines and 189 coloumns, and is full screen.

This is perl 5, version 38, subversion 2 (v5.38.2) built for x86_64-linux-thread-multi

Curses::UI Version: INST_VERSION 0.9609

OS is Arch Linux

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



The Once and Future Perl - Damian Conway - TPRC 2024 submitted by /u/briandfoy
[link] [comments]


If you have some time, read this post over at reddit

https://www.reddit.com/r/bioinformatics/s/lcxEeInCOS

Apparently Anaconda is ActiveStating people and this may very well prove to be a significant issue in the dominance of Python in certain data science fields. Bioinformatics is a very good example of a field that got addicted to Python and the reliance of Anaconda is coming back to bite (the post and the responses raise the prospect of nightmarish scenarios for other environment managers like conda-forge/buoconda). The immediate solution for dependency management is to dockerize everything, but many tools require individual docker containers. If you have to combine more than one of them, chances are that your path will not be a rosy one.

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



Although this StackOverflow question about "islands and gaps" is titularly about Perl, the SQL answers are very nice. Apparently this is a FAQ for SQL.

However, this has bugged me for years on the CPAN side, but never enough to make me really do anthing about.

I thought there was a Perl module that did this, and it was in the context of a usenet reader that would take a list of article IDs, such as 1, 2, 3, 4, 5, 7, 10, 11, 15 and return something like 1-5,7,10-11,15 as a more space-efficient store of all the articles you had read.

Every time I've looked I've stopped after 15 minutes because I get distracted and I've never really needed this except to answer someone else's question. I'm not asking how to solve this because there are plenty of algorithm tutorials out there. Surely this is on CPAN somewhere.

There are plenty of options to go the other way and to ask if a number is in one of the ranges.

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



Actually Portable Perl - Gavin Hayes - TPRC 2024 submitted by /u/briandfoy
[link] [comments]


GitHub - PerlToolsTeam/github_workflows: Some useful (and reusable) GitHub Workflows submitted by /u/briandfoy
[link] [comments]




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]




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 ?

https://chrisarg.github.io/Killing-It-with-PERL/2024/07/09/The-Quest-For-Performance-Part-IV-May-the-SIMD-Force-Be-With-You.html

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