Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Arrays & Output printing?

by tybalt89 (Monsignor)
on Mar 27, 2017 at 15:24 UTC ( [id://1186084]=note: print w/replies, xml ) Need Help??


in reply to Re: Arrays & Output printing?
in thread Arrays & Output printing?

I wondered about the output order also, but figured it was just a typo. However if the specified order is actually wanted:

#!/usr/bin/perl -l # http://perlmonks.org/?node_id=1186032 use strict; use warnings; $/ = "END\n"; my @ORDER = qw/ TIME ALT TEMP COLOR STRENGTH /; for my $section (<DATA>) { print join ' ', map $section =~ /\b($_: \S+)/, @ORDER; } __DATA__ START TIME: 3 ALT: 3.1 TEMP: 4.3 END START TIME: 2.6 ALT: 8 TEMP: 1 END START TIME: 6.1 ALT: 7.2 COLOR: 43 STRENGTH: 7 TEMP: 9.3 END

Log In?
Username:
Password:

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

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

    No recent polls found