Sans any context whatsoever, solving the immediate problem of reading and slicing up the file data seemed most helpful.

With the small amount of additional context you have added a fuller implementation would be:

use warnings; use strict; my @lines; while (<DATA>) { chomp; push @lines, [unpack ("(a2)*", $_)]; } __DATA__ 0912203749 0725284648 0608294149 0622424347 1219303436 1729313449 1015162331

which pushes arrays of numbers into an array of lines creating a two dimensional array that you can use in subsequent processing:

for my $column (0 .. 4) { my @byColumn = map {$_->[$column]} @lines; print "@byColumn\n"; }

prints:

09 07 06 06 12 17 10 12 25 08 22 19 29 15 20 28 29 42 30 31 16 37 46 41 43 34 34 23 49 48 49 47 36 49 31

Perl is environmentally friendly - it saves trees

In reply to Re^5: For- loop increment not passing to inner block by GrandFather
in thread For- loop increment not passing to inner block by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.