Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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.

Quests
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
0 replies 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)

    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!

    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]
Supplications
External (extra) files when using Inline::CPP
1 direct reply — 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.

    test.pl
    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; }
    xkcd.h
    #ifndef XKCD_DICE #define XKCD_DICE // See https://xkcd.com/221/ for why this is absolutely perfect #define FAIRLY_GENERATED_RANDOM_NUMBER 4 int xkcd_dice_roll(); #endif
    xkcd.cpp
    #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
    Hi

    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
    Hi

    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

namespaces in XML::RSS::Parser::Element
2 direct replies — Read more / Contribute
by wintermute_115
on Apr 11, 2024 at 08:38

    I'm trying to parse RSS feeds with XML::RSS::Parser, and it's mostly working fine, except that I need to be able to pull the content of elements in the itunes namespace and nothing I can think of seems to work.

    If I'm trying to read the element itunes:summary (it will be en object of type XML::RSS::Parser::Element), for example, I've tried:

    $summary = $element->query('itunes:summary'); $summary = $element->query('{http://www.itunes.com/dtds/podcast-1.0.dt +d}summary'); $summary = $element->query('summary') $summary = $element->query(process_name('itunes:summary'): $summary = $element->query(process_name('{http://www.itunes.com/dtds/p +odcast-1.0.dtd}summary'):
    and some other things I don't remember. But everything I try, it ether returns undef or I get told Bad call to match: '<XXX>' contains unknown token.

    Does anyone know how this works? Thanks.

Unexpected line breaks in substitution results
2 direct replies — Read more / Contribute
by paschacroutt
on Apr 10, 2024 at 10:22
    Hi monks,

    What follows is my very first adventure in perl world, so please be merciful.

    I wrote the following code to modify a bunch of pandoc-generated DokuWiki formatted files in order to convert some expressions to DokuWiki internal links. That went through many iterations and I am now somewhat satisfied with the result except for one mystery I am unable to pierce through.
    It does not crash my code, nor does it sends any warning, but I can't explain this result.

    Here's my problem:

    In this substitution part of the code: .(defined($4) ? $4 =~ tr[\/*][]dr : '.') line 44, I check if the value of $4 is defined and if it is, I apply a tr to it to remove italic (//) or bold (**) marks if they are present. If $4 is undefined (meaning there are no dot, comma or semicolon after the last word of the expression), the conditional operator sends a dot to end the substitution.

    So either this data entry:

    **Voir :** proton, solution hydrogénée//.//
    or that one:
    **Voir :** proton, solution hydrogénée.
    Give this result:
    **Voir :** [[glossaire:entrees:p:proton|proton]], [[glossaire:entrees: +s:solution_hydrogenee|solution hydrogénée]].
    Which is exactly what is needed.
    But if there is no final dot or comma after solution hydrogénée:
    **Voir :** proton, solution hydrogénée
    What I get is:
    **Voir :** [[glossaire:entrees:p:proton|proton]], [[glossaire:entrees: +s:solution_hydrogenee |solution hydrogénée ]].
    With line breaks after solution_hydrogene and hydrogénée
    Which is ok but I was expecting:
    **Voir :** [[glossaire:entrees:p:proton|proton]], [[glossaire:entrees: +s:solution_hydrogenee|solution hydrogénée]].
    No line breaks.
    And I don't understand why and how those line breaks get inserted.
    Actually, those breaks don't really matter, as DokuWiki format being some kind of lesser markdown, it just gives the same html output with or without them, but it worries me as a sign of my incomplete understanding of my own code.

    It may have something to do with the /x modifier I suspect.

    The actual code follows

    Thanks for reading through !

Meditations
CPAN autobundle fail
2 direct replies — Read more / Contribute
by Anonymous Monk
on Apr 10, 2024 at 13:50
    I was trying to autobundle an old perl setup but cpan was just sitting there failing to contact mirrors (cpanm user so that mirror list was probably ancient). This inspired me to visit https://www.cpan.org/SITES.html where it says www.cpan.org don't do mirrors anymore. Created the autobundle like so:
    cpan -M https://www.cpan.org -a
PerlMonks Discussions
chatterbot has no XML version
2 direct replies — Read more / Contribute
by choroba
on Apr 12, 2024 at 06:28
    PerlMonks pages can be retrieved in XML with just appending displaytype=xml to the URL query. It works even for users, e.g. me in XML.

    For our beloved brother chatterbot, though, this isn't the case. The XML version returns nothing, which breaks the XML parser in pc-cb-g. Why is that?

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
New Feature: Notifications Nodelet
3 direct replies — Read more / Contribute
by jdporter
on Apr 09, 2024 at 14:47

    There is a new nodelet, Notifications.

    What this essentially does is split out the system-generated notification messages into a separate nodelet from the Chatterbox nodelet. So if you enable this nodelet, then all of the messages which come to you from the system (i.e. from root or NodeReaper) are shown in this nodelet and not in the Chatterbox nodelet.

    This is structured very similarly to the Chatterbox nodelet, but with a few simplifications:

    • It only shows a maximum of 16 notifications; it ignores your "Max to display in Chatterbox" setting.
    • It shows a maximum of 16 entries, unless you have "Max to display in Chatterbox" set. (When viewing Notifications directly, the default max is 128.)
    • It doesn't show the sender of each message. (It will only ever be root or NodeReaper anyway.) In the place of that, it shows a bullet.
    • Since the sender isn't shown, to see the send time you can hover over the message preface.
    • There is no 'talk box' in this nodelet. Instead, there is a 'delete' button you can press to delete any checkbox-selected messages.
    • The preface from NodeReaper — "I've reaped a node you considered" — is changed to "A node you considered has been reaped".

    As with all nodelets*, this one can be viewed "standalone" on its own page, simply by going to the node of the same title: Notifications.

    * With just a couple exceptions.

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 rifling through the Monastery: (4)
As of 2024-04-16 16:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found