Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: how to get numbers only from n numbers or more digit numbers?

by 2teez (Priest)
on Jun 13, 2013 at 07:31 UTC ( #1038700=note: print w/ replies, xml ) Need Help??


in reply to Re^2: how to get numbers only from n numbers or more digit numbers?
in thread how to get numbers only from n numbers or more digit numbers?

use warnings; use strict; my $f='chapter 01,02,03,04'; if(my @m=$f=~/,([0-9]{2})/g){ print "@m\n"; #prints 02 03 04 }
Note: I would rather use a scalar variable, instead of an array variable with only one element like you had.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me


Comment on Re^3: how to get numbers only from n numbers or more digit numbers?
Download Code
Replies are listed 'Best First'.
Re^4: how to get numbers only from n numbers or more digit numbers?
by virudinesh (Acolyte) on Jun 13, 2013 at 10:39 UTC
    if your using use @m array.. if possible to store in any variable.

      if your using use @m array.. if possible to store in any variable.

      No, all variables must be named @m

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2015-08-29 21:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (344 votes), past polls