Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Explaining small Code

by Marshall (Canon)
on Sep 21, 2013 at 03:52 UTC ( [id://1055100]=note: print w/replies, xml ) Need Help??


in reply to Explaining small Code

#!usr/bin/perl -w use strict; my @matrix; while (<DATA>) { chomp; my @numbers = split; #default variable to split upon is $_ #default split is on spaces next unless @numbers; #skip blank lines (no characters) push (@matrix, \@numbers); #An array of array } foreach my $array_ref (@matrix) { print "@$array_ref\n"; } =Output 5 5.1 62.1 6 6.1 6.7 =cut __DATA__ 5 5.1 62.1 6 6.1 6.7

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-03-19 06:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found