Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Extracting numerical information

by hdb (Prior)
on Jun 27, 2013 at 18:55 UTC ( #1041076=note: print w/replies, xml ) Need Help??


in reply to Extracting numerical information

Extracting all four numbers.

use strict; use warnings; my $string = "66.411716: ABCDE:M WALL 0x0164764a, RX 0x03bb9d42, TS 5" +; my @numbers = $string =~ /(0x[0-9a-f]+|\d+\.?\d*)/g; print "@numbers\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041076]
help
Chatterbox?
[Corion]: Discipulus: Yeah - but when writing Perl to save time (instead of having fun), it helps to look whether you're actually saving time ;) Why spend 5 minutes doing manually what you can spend three years automating? ;)
[Corion]: choroba: Oh, yeah :-D

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2017-07-27 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (408 votes). Check out past polls.