in reply to Its a pretty simple question.. though embarassed to ask but i am totally new in perl

now i am stuck .. dont know how to go next.. ()

Explain what you want to do next, what output you want to accomplish

and 1 more problem how to ignore the 1st row because while subtracting d names of rows and columns are troubling me..

Its simple, next, $.

You can also readline before you enter loop to burn the first line

  • Comment on Re: Its a pretty simple question.. though embarassed to ask but i am totally new in perl

Replies are listed 'Best First'.
Re^2: Its a pretty simple question.. though embarassed to ask but i am totally new in perl
by gb92 (Initiate) on Aug 13, 2013 at 16:32 UTC

    Basically i am working on dz: TWO files with some format will be arguments to script Threshold value option such as “-th 5k/M”. This option would mean that 5kb or 5mb of the memory is allowed to be used as threshold. Output from perl script: Diff the files, save it to 3rd file and just print PASS/FAIL depending on the threshold specified. Table used in this format:

    MemU MemA MemF StreamName

    489 489 0 -

    11 11 0 -

    5 5 0 -

    505 505 0 Totals

Re^2: Its a pretty simple question.. though embarassed to ask but i am totally new in perl
by gb92 (Initiate) on Aug 13, 2013 at 16:39 UTC

    where to use next; because its going in infinite loop .. how should i use next statement fr bth d files !

      The suggestion was to use next to skip the header line if either you recognize it as a header (for example with a regex), or you know that it is the first line of the file because the $. special variable (line number in the last read file) is equal to 1, something like this:

      next if $. == 1;

      In my example program, I used a third solution: to read (and discard) one line of input of each file before entering into the while loop. This is slightly faster when reading huge files, since it removes a test from the inner loop, but the difference is probably pretty small.