Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

The Monastery Gates

( #131=superdoc: print w/replies, xml ) Need Help??

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

Quests
poll ideas quest 2022
Starts at: Jan 01, 2022 at 00:00
Ends at: Dec 31, 2022 at 23:59
Current Status: Active
5 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
StackOverflow blog: This is not your grandfather's Perl
on Sep 12, 2022 at 15:57
2 replies by mr_mischief
Stackoverflow blog: Why Perl is still relevant in 2022
on Jul 07, 2022 at 11:28
3 replies by NetWallah
    Girish Venkatachalam has blogged "Why Perl is still relevant in 2022" on July 6, 2022.

    No new info there - it is interesting only because it purports to be positive for perl, is published on SO, and showed up on my Google news feed.

    The author seems to have somewhat dated knowledge of perl and no knowledge of raku.

                    "These opinions are my own, though for a small fee they be yours too."

Supplications
Installing HTML::Tidy
1 direct reply — Read more / Contribute
by bliako
on Sep 27, 2022 at 12:39

    HTML::Tidy depends on a C library tidyp which is a fork, by the author, of libtidy. Compiling the source from the repository is not straight forward as a configure script is missing and additionally, the provided INSTALL instructions contain this warning:

    If you do NOT have a ./configure program, then you are working from the source repository, not the tarball. Please get a release tarball from http://github.com/petdance/tidyp/downloads.

    But the link is dead.

    What worked for me (in Linux) was to bootstrap configure by using the autotools mantra:

    libtoolize --ltdl --copy --force && aclocal && automake --add-missing --copy && autoconf

    Then also shush the beast with adding these missing files: touch AUTHORS NEWS

    And finally ./configure && make all && make install will hopefully install this dependency.

    Warning: serious cargo-culting above.

    Note both packages mentioned above are read-only and I could not find a way to post this comment there where it belongs.

    bw, bliako

file open with variables
3 direct replies — Read more / Contribute
by Anonymous Monk
on Sep 27, 2022 at 12:16
    Hello, I am a newbie in Perl and seeking a help with file open using variables. In below code, I like to use variables X_info, Y_info, Z_info in the file open line so I can only change the variable contents to open a file. Can someone help this? I can't figure this out. Thanks, Steve
    use strict; my X_info = 3; my Y_info = -4; my Z_info = 5; ###### want to replace 3 with X_info, -4 with Y_info, 5 with Z_info ## +################################ open(DLOG, '<' 'D:\PROJ\N123_X3\dataInfo_X-4_Y5_decode.csv') or die "w +e have a problem: $!"; print "It Works.\n" close (DLOG);
Perl Tk crashes when mem usage exceeds 4G on Win10
3 direct replies — Read more / Contribute
by boleary
on Sep 23, 2022 at 06:48

    I have a Perl Tk GUI application that crashes after it exceeds 4GB of RAM usage and I have no issues exceeding 4GB when running tests in a console application (without Perl Tk)

    Operating system: Microsoft Windows Version 10.0.19044.2006 Perl version: v5.30.3 Tk version: 804.036 (latest available on CPAN)

    Perl spits out this error almost every time it crashes, but sometimes it crashes without an error:

    Free to wrong pool 678ea0 not e228dd0 at .\common\GUI_TESTS\test_memor +y_hog_gui.pl line 41.

    When searching for this error, everything I could find was multi-threading related, and our application does not use multi-threading. I thought it may be because we have something configured as 32-bit instead of 64-bit, so I followed the instructions in this question and found that everything is configured as 64-bit.

    perl -V:ivsize # ivsize='8'; perl -V:ptrsize # ptrsize='8'; perl -V:archname # archname='MSWin32-x64-multi-thread';

    Below is an example GUI application that crashes after the memory exceeds 4GB. I have boiled this down from our application and the crashing behavior is the same. The data structure that we use is obviously much larger, so I am cloning a simplified version of ours many times to pass the 4GB threshold.

    Note that this sample application does not crash when running on a Centos7 VM (only on the Win10 host)

    use strict; use warnings; use Tk; use Tk::LabFrame; use Clone; my $MAIN_WINDOW = MainWindow->new; $MAIN_WINDOW->minsize(400, 400); my @dataStructureClones = (); my $textBox; my $button_frame = $MAIN_WINDOW->LabFrame(-label => "Test", -relief => + 'groove', -borderwidth => 2)->pack(); $button_frame->Button( -text => 'Run Crashing Operation', -command => sub { my $dataStructureThatCrashes = { NETLIST_INFO => { EXTRA_PROPERTIES => { C_SIGNAL => {}, NET => {}, }, NET_LIST => [ # omitting this call will allow the program to exc +eed 4GB until after it finishes the loop { NL_INDEX => 0, } ] }, }; my $lastUpdate = time(); push @dataStructureClones, $dataStructureThatCrashes; for (1 .. 5000000) { if (time() - $lastUpdate > 1) { # omitting this call will allow the program to exceed +4GB $textBox->insert("end", "Cloning hash ($_)...\n"); $MAIN_WINDOW->update(); $lastUpdate = time(); } push @dataStructureClones, Clone::clone($dataStructureThat +Crashes); } } )->grid(-row => 0, -column => 0); $textBox = $MAIN_WINDOW->Scrolled( 'Text', -relief => 'groove', -background => 'light grey', -foreground => 'black', -wrap => 'char', -scrollbars => 'osoe', -width => 110, -height => 24, )->pack(-side => 'top', -fill => 'both', -expand => 1); MainLoop;
How to tell EU::MM to install a pure-perl module into an architecture-specific location
3 direct replies — Read more / Contribute
by syphilis
on Sep 23, 2022 at 01:08
    Hi,

    I have an "architectured" perl installation where, in addition to perl/site/lib, I also have:
    perl/site/lib/MSWin32-x64-multi-thread perl/site/lib/MSWin32-x64-multi-thread-ld perl/site/lib/MSWin32-x64-multi-thread-quadmath perl/site/lib/MSWin32-x86-multi-thread perl/site/lib/MSWin32-x86-multi-thread-64int perl/site/lib/MSWin32-x86-multi-thread-64int-ld perl/site/lib/MSWin32-x86-multi-thread-64int-quadmath perl/site/lib/MSWin32-x86-multi-thread-ld perl/site/lib/MSWin32-x86-multi-thread-quadmath
    Pure-perl modules will, by default, be installed into perl/site/lib.
    Other modules (ie perl extensions) will be installed into the appropriate location listed above, according to the perl architecture for which they have been built.

    I have a perl extension called (say) Module::B, and it has been built and installed into each of those architecture-specific locations.
    There also exists a pure-perl Module::A, which requires Module::B but has not yet been installed anywhere into that perl.

    Using (say) the MSWin32-x64-multi-thread build of perl, I then install Module::A in the usual way (cpan -i Module::A).
    Module::A gets installed into perl/site/lib because it is a pure-perl module.
    At that point, Module::A becomes immediately available to all 9 architectures, even though it has not been tested against 8 of them.

    This is an unsatisfactory state of affairs, IMO.
    I envisage that Module::A should really be installed into the relevant architecture-specific location.
    How do I tell ExtUtils::MakeMaker to do that ?
    Or is there some better way of handling this ?
    How do module authors generally deal with this issue ?

    Cheers,
    Rob
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? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2022-09-29 02:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (125 votes). Check out past polls.

    Notices?