Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Adjacent numbers - the plain way

by Discipulus (Canon)
on Nov 20, 2015 at 10:41 UTC ( [id://1148216]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # always use stric and warnings (till the moment you know when is safe
    + disabling them)
    use strict;
    ...
    X_202
    X_203
    X_204
    
  2. or download this
        my $cur_num = $1 if $arr[$_] =~/\d*[A-Z]_(\d+)$/;
        my $next_num = $1 if $arr[$_ + 1] =~/\d*[A-Z]_(\d+)$/;
    
  3. or download this
        my ($cur_num,$next_num) = map {$1 if $_  =~/\d*[A-Z]_(\d+)$/} $arr
    +[$_],$arr[$_+1];
    
  4. or download this
       if (  $arr[$_] =~/\d*[A-Z]_(\d+)$/  ){
           $cur_num = $1;
       }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1148216]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-25 12:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found