Hi

I have been trying to get to grips with this and am hoping to replace the random generation of the ranges (which I presume is this bit:

my @ranges = map{ my $a = rand( 900 ); [ $a, $a + rand( 1000 - $a ) ] } 1 .. 7;
with a way of reading in some values from a command's output, specifically, the first sector and last sector values from a disk partition table (which I can read in from a temporary file if needbe):

* First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory 0 2 00 8392560 33558000 41950559 1 3 01 0 8392560 8392559 2 5 00 0 78156480 78156479 3 0 00 41950560 6295440 48245999 4 4 00 48246000 8392560 56638559 5 0 00 56638560 8392560 65031119 6 7 00 65031120 8392560 73423679 7 0 00 73423680 106080 73529759
I am finding this to be pretty tough as I am a novice. Any help or suggestions appreciated.

In reply to Re^2: find which ranges share at least one common value by Anonymous Monk
in thread find which ranges share at least one common value 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.