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

The Monastery Gates

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


erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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
3 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
5.40 released
on Jun 10, 2024 at 04:35
5 replies by hippo
List::Gen revivified
on May 17, 2024 at 16:02
1 reply by jo37

    After more than ten years of hibernation I was able to waken List::Gen and fix some tests that failed since v5.19 including "fails on bleadperl" and a reported bug "primes incorrect for 664580, and slow".

    The new version is currently available on my github repo only, as the author is not responding. Does anybody have information about "Eric Strom" aka "ASG"? Otherwise I might try to get an indexing permission on CPAN as a co-maintainer, though I'm clueless regarding this process.


Can I get the actual error for DBI->execute() ?
4 direct replies — Read more / Contribute
by SergioQ
on Jun 20, 2024 at 21:43

    I have the function below that I use in perl. I build the command elsewhere as it could be a SELECT, INSERT, et al.

    In one instance I am using the function to insert new records into my MySQL table. And generally it works. But occasionally it will fail on an insert, and I was hoping I could find out what the actual reason an insert failed. To be clear I am inserting over a thousand records into this table, and most work.

    I even had my perl script print out the actual command that returns a nil on the result, and then I copy and paste that exact command into MySQL's terminal where it works. So even more reason to get the exact reason it failed.

    I should add that the table has no index, and no unique fields.

    #from elsewhere in my code ... $db=DBI->connect('DBI:mysql:invoices',[username],[password], { RaiseEr +ror => 0, AutoCommit => 1 }); #$rawDB is set to the table name my $insertCommand = "INSERT INTO $rawDB (sheet_no, sheet_name, item, c +oll, roww, category) VALUES ('$currentSheet', '$sheetname', '$cellData', '$curcol', '$curro +w', '');"; my $result = insertItem($insertCommand); #.... sub insertItem { (my $insertCom) = @_; $dbHandle=$db->prepare($insertCom); my $result = $dbHandle->execute(); return $result; }
Data::Dumper print arrays of scalars on one line
3 direct replies — Read more / Contribute
by Danny
on Jun 19, 2024 at 23:06
    Is there a Data::Dumper option to print arrays of scalars on a single line, but everything else with indentation? For example, like:
    $VAR1 = { 'hk1' => 5, 'hk2' => [ [1, 2, 3], [4, 5, 8] ], etc ...
Requiring a version
6 direct replies — Read more / Contribute
by choroba
on Jun 18, 2024 at 04:45
    I noticed weird CPAN testers' failures in the last release of Syntax::Construct (5.38.2 without threads on Solaris, 5.38.2 threaded on Solaris, 5.38.0 threaded on Solaris).

    To know more, I released a dev version with a debugging output. It hasn't been tested on the same machines yet, but I've got similar results from 5.38.2 on FreeBSD and 5.38.0 on Linux. It seems that in all these cases, the following line doesn't fail:

    require (0 + 5.040); # Should fail in 5.38.X!

    I contacted the testers, but there has been digital silence so far.

    If you have a 5.38.X installed, would you be so kind and test it for me, too?

    I still fear it's my fault, so here's the line that shows the debugging information. Do you have any ideas?

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Text::ExtractWords exhibits incomprehensible behavior?
4 direct replies — Read more / Contribute
by ibm1620
on Jun 15, 2024 at 11:42
    Hello, Monks,

    I'm looking for a module to extract words from a stream of text. I installed Text::ExtractWords and tried it:

    #!/usr/bin/env perl use v5.38; use Text::ExtractWords qw(words_list); say $^V; my $text = "12/21/84 Bob's 21st b'day was a wine-and-dine."; say $text; my @list; words_list(\@list, $text, {minwordlen => 2, maxwordlen => 26 }); say "Found words: " . join ' ', map {"[$_]"} @list; say $text;
    v5.38.2 12/21/84 Bob's 21st b'day was a wine-and-dine. Found words: [12] [21] [84] [bob's] [21st] [b'day] [was] [a] [wine-and +-dine] 122184bob's21stb'daywasawine-and-dine
    Note the output value of $text after call. How is it possible for any subroutine to modify a parameter, since I don't pass in a reference?

    Moreover, I looked at and it's all basically boilerplate except maybe for one line, which I don't understand:

    bootstrap Text::ExtractWords $VERSION;
    I feel like I'm missing something obvious here...

    Update: I'm not able to step into words_list() using the debugger! It just proceeds to my next source line.

    Update2: I even tried making a copy of $text (my $copy = $text) and passing $copy to words_list(), and afterwards *both* $copy and $text were munged. As Danny mentions below, this is XS code.

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 surveying the Monastery: (3)
As of 2024-06-21 18:42 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.