I don't know how "cool" this is (it's cool to me) but this is a small script
I wrote 13 years ago. It simply converts and prints out the Perl version contained in the built-in
variable $] to the string as we usually see it when we are discussing Perl
releases. Just run it, you'll see what I mean ;-).
#!/usr/bin/env perl
# First created: 2012-05-08
# Last modified: 2012-08-26T01:37:48 UTC-04:00
use strict;
my $pow = 2;
my $test_v = $ARGV[0] || $];
my @qiu = split(q/[._]/ => $test_v);
@qiu[1 .. @qiu] = map {sprintf(q[%u],$_/10**$pow++)}
map {unpack "A4 A4",$_ * 10**3 } @qiu[1 .. $#qiu];
my $tuple_perlversion = join q[.], grep{length($_)} @qiu;
print "$tuple_perlversion\n";
Soren
Jul 12, 2025 at 17:07 UTC
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.