develooper Front page | perl.perl6.users | Postings from May 2018

Need help converting from Perl 5

Thread Next
From:
ToddAndMargo
Date:
May 14, 2018 04:41
Subject:
Need help converting from Perl 5
Message ID:
e7c22ab7-4d54-2508-f020-67da2032b45b@zoho.com
Hi All,

I can't not remember what I did in Perl 5 here and
am not having a good time converting it to Perl 6.

$  perl -e 'my $A="44.rc0"; if ($A ~~ /(^[0-9,.,a,b,rc]+$)/ ) {print 
"$1\n";} else {print "\$A = <$A>\n"}'

44.rc0

The actual code is:
if ( $Line2 ~~ /(^[0-9,.]+$)/ ) { push ( @WebVersions, $Line2 ); }

The actual data looks like:

$Line2 = 6.0.1
$Line2 = 6.0.2
$Line2 = 6.0
$Line2 = 6.0b1
$Line2 = 6.0b2
$Line2 = 6.0b3
$Line2 = 6.0b4
$Line2 = 6.0b5
$Line2 = 60.0
$Line2 = 60.0b10
$Line2 = 60.0b11
$Line2 = 60.0b12

I am trying to exclude things that look like:

$Line2 = bonecho
$Line2 = custom-updates
$Line2 = deerpark
$Line2 = devpreview
$Line2 = granparadiso
$Line2 = latest-beta
$Line2 = latest-esr


Many thanks,
-T

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About