hi Monks!! Around here(actively) for the last week..has been a great learning all through...bfore i can be a help to those queries.... i guess i have along way to go... heres the way..need your help to walk it.. This is only the logic to the program..need your help to code it in perl
if $flag then $refsize=`getsize()` #getsize is a subprogram that gets the size of the file $newsize=$refsize; sub prog[ this is group $v=1; loop ($repeat times) <loop begin>$size=getsize(); if $size==$newsize; $sizeT+=$size; #cumulative addition $samefile++; else $newsize= $size;$flag=0 ; continue with the loop; <loop end> $samefile with $size -- display. delete all the files bearing this size(using reverse hash and del +ete with key as the size). $no of $samefile = $num; $repeat=128-$num; call sub prog if $rep!=0; else $rep=128 and $v++; # go to the next group of 128 files

  • well this is what i am trying. I have a group of files under a group. There are five such groups.
  • I want to traverse the group and get all the files under the group with the same size and list them as "this group contains n number of files with size x.
  • This happens until all the files are grouped and listed according to their sizes
  • This process for all the five groups
  • Do you think this logic would work
  • __DATA__

    for example

  • i have a group of files(unique)say a,b,c with sizes x,x,y
  • i want the output to show "There are 2 files with size x total size being 2x
  • All the groups should show this output
  • each group contains 128 files
  • thanks so much

    In reply to Getting started -- hashes! by shamala

    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.