Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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.

poll ideas quest 2021
Starts at: Jan 01, 2021 at 00:00
Ends at: Dec 31, 2021 at 23:59
Current Status: Active
10 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
Consider learning Perl in 2021
on Oct 22, 2021 at 11:51
1 reply by reisinge

    I found this article referenced in login 2020 winter issue. It's about the ten most popular programming languages to Learn in 2021. The article mentions also seven other languages to consider learning. Perl is among those seven.

    hic et nunc
New "miniconf" scheduled for 18th of November
on Aug 24, 2021 at 10:20
0 replies by hippo

    As announced in this post there is planned to be a one-day online "miniconf" for Perl and Raku in November. It will be held via Zoom and Thibault Duponchelle has posted the call for papers.

    The talks can be about toolchain, devops, cloud, sysadmin, core, design patterns, web or whatever linked to Perl or Raku.


When does it make sense to preload modules when starting Starman?
2 direct replies — Read more / Contribute
by karlgoethebier
on Oct 28, 2021 at 04:33

    To be honest: I have no idea. Reading the less or more friendly manuals didn’t help me very much to jump to a conclusion.

    Thank you very much in advance for any hint and advice.

    Best regards, Karl.

    «The Crux of the Biscuit is the Apostrophe»

OpenSSL 1.1 support with latest version of Net::SSLeay with Perl version 5.24.
1 direct reply — Read more / Contribute
by Anonymous Monk
on Oct 26, 2021 at 03:16

    Hi Monks,

    I have two questions here for Net::SSLeay module and openssl

    1. Does Openssl version 1.1 support with latest version of Net::SSLeay with Perl version 5.24.

    2. How to set up the environment variable OPENSSL_PREFIX which is needed in order to install Net::SSLeay.

    I have tried setting up the path of the folder where openssl.exe is located but script or system seems not recognizing it,
    can you please tell me what should go in the OPENSSL_PREFIX env which would cause Net::SSLeay latest version installed.

    Thank you.

Variable with curly braces?
3 direct replies — Read more / Contribute
by wyt248er
on Oct 24, 2021 at 02:10

    The perl guide document "perlpacktut" contain the following command statements, which look like assignments.

    $UTF8{Euro} = pack( 'U', 0x20AC ); # Equivalent to: $UTF8{Euro} = "\x{20ac}"; $Unicode{Euro} = unpack( 'U', $UTF8{Euro} );

    The tokens `$UTF8{Euro}` and `$Unicode{Euro}` seem to be treated as variables. However, the typical perl variables I am familiar with are of the form $v or ${v} but not $v{u}. In fact, the following code ends up with an error.

    #!/usr/bin/perl my $v{u} = "hello"; print($v{u}, "\n");

    syntax error at ./ line 3, near "$v{u"

    What are `$UTF8{Euro}` and `$Unicode{Euro}`? Which perl guide document explain this kind of token?

    Thank you in advance.

How to convert between Unicode codepoint and UTF8 character code on Perl?
3 direct replies — Read more / Contribute
by wyt248er
on Oct 24, 2021 at 01:32

    I would like to convert between Unicode code points and UTF-8 character codes.

    For example, the Unicode code point for the GREEK SMALL LETTER PI is U+03C0, and its UTF-8 character code is 0xCF80. So, if the string "U+03C0" (or "0x03C0") is entered, then I want the string "0xCF80" to be printed (without quotes). If the string "0xCF80" is entered, then I want the string "U+03C0" (or "0x03C0") to be printed (without quotes). Note that the desired output is NOT a character itself but a string showing the character code.

    By the way, if your terminal is configured to display Unicode wide characters, then the following commands will show you the GREEK SMALL LETTER PI.

    perl -l12e 'print(chr(0x03c0))' -C perl -l12e 'print(pack("U0W*", 0xCF, 0x80))' -C

    Thank you in advance.

STDIN usage in interactive debug
1 direct reply — Read more / Contribute
by abdan
on Oct 23, 2021 at 23:26
    Why in interactive debug cannot do input:
    DB<1> @ln=<STDIN>; <"FILE" DB<2> print "$ln[0] $ln[1]"
    How to have it working directly
Dump the key value pairs in a hash
4 direct replies — Read more / Contribute
by byrnejb
on Oct 22, 2021 at 16:12
    I am not a perl programmer. I do have to maintain a legacy perl application. Something has changed in the environment so that it no longer correctly reports the status of public key certificates. I need to discover what that change is and how to accommodate it. The critical piece of code appears to be:
    sub genHTMLTableRow { my $self = shift; my $args = shift; my $e = shift; my $ser = $e->{serial}; my $pem = $ser.'.html'; . . .
    What I wish to do for debugging purposes is to dump the actual contents of $self, $args, and $e. I tried the naive approach of using print "$self\n"; but that just gave me this:
    I tried to use the map function
    print map { "Key: $_ has Value:$self{$_}\n" } keys $self;
    I clearly do not understand the naming conventions of perl variables as this usage of map causes the error:
    Global symbol "%self" requires explicit package name (did you forget + to declare "my %self"?) at /root/bin/rcsp/blib/lib/ line 861
    What is the perl way of displaying the contents of $self, $args, and $e?
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2021-10-28 14:55 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (96 votes). Check out past polls.