Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

pl Perl One-Liner Magic Wand: looking for feedback

by Daniel Pfeiffer (Acolyte)
on Jun 03, 2022 at 20:58 UTC ( [id://11144372] : CUFP . print w/replies, xml ) Need Help??

One of my favourite Cool Uses for Perl have always been one-liners. But already decades ago I found them still too cumbersome. So, I rolled a wrapper, a better perl -E. When Corona went viral, I decided to publish it, after a major clean up. But I never advertised, beyond meta::cpan and Sourceforge.

The base idea is a small script I can take to any server where I need to get stuff done. It's self-contained, as many data center hosts are firewalled off from the internet. It supports old Perls: With SuSE SLES 11 and 5.10 out of the way, it's now on 5.16, which comes with Red Hat RHEL 7.

In hindsight, the added options are powerful, but the way I intertwined them into -n handling is ugly & limiting. Thus, I'm rewriting the wrapping code for pl 1.0. From that comes a small but rich template mechanism (interpolation or sprintf meh.) That's just one of many goodies it contains, like the mighty multi-file key-based diff. There are a bunch of examples, many original:

https://perl1liner.sourceforge.io

May the veggie-burger menu guide you!

  • Comment on pl Perl One-Liner Magic Wand: looking for feedback

Replies are listed 'Best First'.
Re: pl Perl One-Liner Magic Wand: looking for feedback
by eyepopslikeamosquito (Archbishop) on Jun 04, 2022 at 02:56 UTC
      Cool! You seem to have a few pages that are not in my list. Maybe some more gems in there, or even inspiration for making pl better. Thanks for adding pl!
Re: pl Perl One-Liner Magic Wand: looking for feedback
by Arunbear (Prior) on Jun 04, 2022 at 12:14 UTC
    It looks really interesting, but installing it from CPAN doesn't seem to work. I mean the install doesn't fail
    % cpanm App::pl --> Working on App::pl Fetching http://www.cpan.org/authors/id/P/PF/PFEIFFER/App-pl-v0.63.2.t +gz ... OK Configuring App-pl-v0.63.2 ... OK Building and testing App-pl-v0.63.2 ... OK Successfully installed App-pl-v0.63.2 1 distribution installed
    This just doesn't seem to install anything. As a comparison, installing App::cpanminus installs a program called cpanm

    Also, when I repeat the above command, the output looks the same i.e. it re-installs instead of saying that App::pl is up to date (and still nothing is installed).

      The Makefile.PL should contain something like:

      "EXE_FILES" => [ "bin/pl" ],

      Where the pl file would actually be in bin directory within the distribution. There's no sense in App: distribution if the module just warns:This is a just dummy package for CPAN.  Please run the script 'pl' directly!.

        Thanks for the tip! It's fixed.
Re: pl Perl One-Liner Magic Wand: looking for feedback
by AlexP (Pilgrim) on Jun 09, 2022 at 10:28 UTC

    Great job by the way 👍

Re: pl Perl One-Liner Magic Wand: looking for feedback
by Daniel Pfeiffer (Acolyte) on Jul 20, 2022 at 20:52 UTC

    App-pl-0.90.3 is out. No new features, but hopefully fixes everything you all found!