Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

The Monastery Gates

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

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

Wall of Larry Quest
Starts at: Feb 26, 2024 at 05:00
Ends at: Dec 31, 2024 at 04:59
Current Status: Active
2 replies by jdporter

    By now you've all seen The St. Larry Wall Shrine. Well, it could use a fresh coat of gold leaf and shellac. Therefore, we are soliciting Larry-related items to be placed on the shrine. Links to offsite content are good; or if you have small bits of content, such as quotes, you'd like to contribute, that's fine too. Please reply to this Quest with your humble offerings. Thank you! And may St. Larry bless your codings and your debuggings.

poll ideas quest 2024
Starts at: Jan 01, 2024 at 00:00
Ends at: Dec 31, 2024 at 23:59
Current Status: Active
2 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.

Monk Quips Quest
Starts at: May 01, 2023 at 08:00
Ends at: Apr 30, 2024 at 07:59
Current Status: Active
9 replies by erzuuli
    Esteemed Monk kcott has recently proposed an excellent idea.

    heretoforthwithstanding, we invite all monks to submit ideas for new monk quips!

    Your quip suggestion should include the following details:

    • Intended quip location: either XP Nodelet, Chatterbox, or Monkbar (that's the page header).
    • Text of quip.
    • Optional: background & foreground colours. If you include these, be sure they are nicely contrasting.


Perl News
The Perl and Raku Conference: Call for Speakers Renewed
on Apr 10, 2024 at 23:06
1 reply by talexb

    The Perl and Raku Conference is fast approaching! We will be in Las Vegas on June 24-28, (main conference June 25-27). We want more speakers, so we are reopening the full call for talks/papers/posters.

    The new deadline is April 20, midnight Las Vegas time. (April 21 00:00 UTC) (April 21 07:00 UTC)

    Now that the eclipse is not a distraction, please consider submitting a talk (50 minute, or 20 minute) or a scientific paper or poster before that deadline! Link to conference website Speakers will be informed of talk acceptance by April 30. Whether speaker or attendee, we look forward to seeing you in Las Vegas!

    Nota Bene: 20m talks, 50m talks, papers, and posters earn free admission for the presenter. Giving a Lightning Talk does not reduce the admission fee, but earns our appreciation and delight!

    Update on 2024-0418: Jeepers. Kids, don't play with time zones. There are so many ways to get them wrong. Thanks to LanX.

    Alex / talexb / Toronto

    Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Stow looking for a co-maintainer
on Apr 09, 2024 at 14:50
0 replies by choroba
    GNU Stow, a tool written in Perl, is looking for a new co-maintainer.

    See the bugreport for details.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
how to use find() options
4 direct replies — Read more / Contribute
by ypreisler
on Apr 17, 2024 at 12:16
    Hi Monks,

    i am not able to follow symbolic links when using the find() command. it says on the manual that the 'follow' or 'follow_fast' option should be used but i don't understand how to use it together with the '\&wanted' routine -

    use File::Find; find(\&wanted, @directories); find(\%options, @directories);
    thanks a lot, Yaron.
Imager font problem
3 direct replies — Read more / Contribute
by Anonymous Monk
on Apr 16, 2024 at 17:04
    Dear Monks,

    I'm using Imager to render truetype fonts but there is no output, and no error, it's just blank. I checked $Imager::formats{tt} to see if Imager has truetype support and it's blank. I have some /usr/share/fonts/truetype so I dunno why Imager says that. How can Imager be compiled with tt support?

    I have another computer with a similar setup but on that one Imager does render truetype even though $Imager::formats{tt} is blank! They are different operating systems and versions of Imager so I don't know. I could install the only fonts that Imager supports on this box: Freetype2, but I want to use truetype and would appreciate any ideas you have on how to get Imager to use my fonts.

    Thank you.

problem with returning all records
2 direct replies — Read more / Contribute
by frank1
on Apr 16, 2024 at 06:30

    My script below works, but i have one problem, it just display out 1 record

    What i need is to return all records from database

    my $sth = $dbh->prepare("SELECT,, m.item, m.eqty, m.price, m.line, m.prodct FRO +M buys as m JOIN Busers as snd ON = m.buyer WHERE CASE WHEN (SELECT SUM(s +tatus = ?) FROM buys) > 0 THEN m.status = ? ELSE m.status = ? OR m. +status = ? OR m.status = ? END ORDER BY created ASC"); $sth->execute('sold', 'forsell', 'bugt', 'paid', 'inshop'); my $Data = $sth->fetchall_arrayref(); foreach my $Data (@$Data) { my ($name, $country, $item, $eqty, $price, $line, $prodct) = @$Dat +a; $html = "<tr> <td> <p>$name</p> <p> $eqty, $price, $line, </p> $prodct $country </td> </tr> "; }
External (extra) files when using Inline::CPP
2 direct replies — Read more / Contribute
by cavac
on Apr 16, 2024 at 05:52

    First of all, i have to admit that i feel that i should know this already, but i just don't.

    Is it possible to add external cpp/h files when using Inline::CPP? I only need XS bindings for the stuff i'm inlining, the rest only needs to be accesible through the inlined CPP code.

    Here is the simplest example i could tink of.
    use Inline CPP; for(1..3) { print "Perfect random number: ", cast_die(), "\n"; } __END__ __CPP__ #include "xkcd.h" int cast_die() { int rolled = xkcd_dice_roll(); return rolled; }
    #ifndef XKCD_DICE #define XKCD_DICE // See for why this is absolutely perfect #define FAIRLY_GENERATED_RANDOM_NUMBER 4 int xkcd_dice_roll(); #endif
    #include "xkcd.h" int xkcd_dice_roll() { return FAIRLY_GENERATED_RANDOM_NUMBER; }

    Is something like this even possible with Inline::CPP?

    PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
Running modulino inside BEGIN
3 direct replies — Read more / Contribute
by LanX
on Apr 14, 2024 at 13:22

    while developing a module I like to run (F5) the testsuite automatically. I'm using a moulino approach which works considerably well

    #BEGIN { # TODO unless ( caller() ) { # Modulino for development exec q(cd ../..; prove ./t/); #run proove from dist root } #}

    It occurred to me that I have to enclose this inside a BEGIN block to avoid the overhead and side-effects of loding all modules with use (this happens in the BEGIN phase) before the unless is executed at run time.

    This doesn't work, since caller() IS defined inside BEGIN

    BEGIN { warn "Caller Begin: ",defined caller(0) } warn "Caller Normal: ",defined caller();

    Caller Begin: 1 at /home/lanx/... Caller Normal: at /home/lanx/...

    EDIT Solution

    while writing this I realized that BEGIN is called 2 levels down, hence caller(2) seems to work

    BEGIN { # TODO unless ( caller(2) ) { # Modulino for development exec q(cd ../..; prove ./t/); #run proove from dist root } }

    Is this reliable?

    (I think it is, but I already wrote this post, before finding the solution and the monastery is not overwhelmed with writeups :)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

CPAN test suites with SQL
1 direct reply — Read more / Contribute
by LanX
on Apr 14, 2024 at 06:22

    I'm developing a DBIx distribution and need to check plenty of SQL in the tests.

    My approach is to use SQLite as primary engine, since it comes with the DBD::SQLite module installed and that's not much of a prerequisite (it's even comes bundled with Strawberry Perl!)

    My issue is where to put the temporary SQLite file...

    • in the distribution's /t directory?
    • in the FS's /tmp ? What about other OSes?
    • or should I restrict the SQL-testing to the authors system

    Those SQLite files don't become big, but I'm not sure about writing stuff into the dist directory. On a side note:

    I want to be able to switch to other DB-Servers while testing. (But now really author's side unless explicitly wanted by the user)

    What's the best approach to make this configurable?

    • A prove option
    • an ENV setting
    • a prompt while testing? (DBI can test for available DBD:: drivers)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-20 13:03 GMT
Find Nodes?
    Voting Booth?

    No recent polls found