Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

The Monastery Gates

( [id://131]=superdoc: print w/replies, xml ) Need Help??

New here?I want to ask a question of the Perl Monks. Where do I start?

Notices:

hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.

If you're new here, please read PerlMonks FAQ
and Create a new user!

Quests
poll ideas quest 2026
Starts at: Jan 01, 2026 at 00:00
Ends at: Dec 31, 2026 at 23:59
Current Status: Active
0 replies by pollsters
    First, read How do I create a Poll?. Then suggest your poll here. Complete ideas are more likely to be used.

    Note that links may be used in choices but not in the title.

Perl News
Perl wisdom in the age of LLMs
on May 14, 2026 at 09:37
1 reply by reisinge
London Perl and Raku Workshop 2026 goes from Maybe to Likely
on Apr 27, 2026 at 09:01
0 replies by choroba
    The announcement

    Our love of Perl and Raku, means another London Perl and Raku Workshop is presently in the works for November 2026, with an exact date and venue to be confirmed in due course.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Supplications
[Explained] When is an expression not an expression?
3 direct replies — Read more / Contribute
by davies
on Jun 03, 2026 at 13:26
    C:\Windows\system32>perl -E "my @rray = qw(a b c); my $rx = qr(d); say + grep $rx, @rray" abc C:\Windows\system32>perl -E "my @rray = qw(a b c); say grep /d/, @rray +"

    I was trying to see if an array contained an element. I started by using the upper format and my code did not work. This was unexpected, because the perldoc for grep says:

    grep EXPR,LIST

    This is similar in spirit to, but not the same as, grep(1) and its relatives. In particular, it is not limited to using regular expressions. Evaluates the BLOCK or EXPR for each element of LIST (locally setting $_ to each element) and returns the list value consisting of those elements for which the expression evaluated to true. In scalar context, returns the number of times the expression was true.

    To me, this meant that both forms should have worked. Why should I have read it as meaning that the first form should fail and the second work?

    Regards,

    John Davies

Cool Uses for Perl
Rounding up the external dependencies of an extension, Imager.pm
No replies — Read more | Post response
by Intrepid
on May 30, 2026 at 15:05

    I offer a CUFP that I've concocted for one small task for one CPAN module. It's "cool" because helping perl with perl is kinda cool. Isn't it? Oh well, you'll decide.

    The module I'm setting up for installation on a Gnu/Linux system (Debian lineage) is Imager. It's a good extension module and it uses external image libraries lke libpng and giflib. But unlike some newer modules, Imager doesn't use Alien::Some-Lib or anything to find and bind (see what I did there? I'm a poet! :-).

    Here's what the Makefile.PL for Imager outputs for the user to see so that he can provision his system with those development libraries that aren't already present and findable:

    
    Libraries *not* found:
      FT2
      GIF
      JPEG
      PNG
      TIFF
      Win32
    

    Here's my fanciful way to process that output of perl Makefile.PL in the Imager source kit top dir:

    perl Makefile.PL 2>/dev/null | perl -wne 'my $x; while(<>) {++$x && next if /Libraries \Q*not*\E found/; if ($x){m^Win32^ and next; s^FT2^freetype^; m/(\S+)/; print "lib", lc($1), "-dev " }}' | xargs sudo apt-get install

    The reader probably thinks it would have been far, far quicker to just use their distro's package manager (aptitude or whatever) than to write something like this. Of course, that's true, but personally I'd find it to be a lot less fun.

        – Soren
    May 30, 2026 at 19:00 UTC

    Consider this, consider this
    The hint of the century
    Consider this, the slip
    That brought me to my knees
    R.E.M —> Losing My Religion

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2026-06-06 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.