Hi all,
Thanks for all ur responses
First I would like to explain what is this script all about.
The arguments passed are file_name and Search phrases (for eg: reject:, total rejected recors:, total rejected rows:, and so on...)

The number of arguments passed may vary... But the first argument is always the file_name.

first it will check for phrase 1 and then from that line number phrase 2 and then phrase 3 and return phrase 3 value .

that is why the order in which we search is very important...

lets say we have 4 arguments including file name...

if (phrase 1 exists) ---------- if (phrase 1 doesnt exists)

from that line number ----------- search for phrase 2

search for phrase 2 ---------- if (phrase 2 also doesnt exists)
from that line number ---------- search for phrase 2 and return phrase 3

even if last phrase was present before, we shud ignore it and follow the order in which the phrases are passed as arguments.... and return the last phrase's value (ie., 45)


if the last phrase was not found in that file then it should print -1 and exit


if the last phrase is given twice, it shud return the last found value in that given order.

and one more last thing, this script works only for returning the value which is at the end of the line..
but doesnt return the value which is at the beginning of the line.
for eg:
total rejected rows: 90
it returns 90 or whatever value it is
but not
50 rows rejected
that it doesnt return 50
thanks,
Mercury.

In reply to Re^2: uninitialized value error by mercuryshipz
in thread uninitialized value error by mercuryshipz

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.