Hi monks,
I am trying to read 3 files at a time,below is my code.
#!/usr/bin/perl open(F1,"tax.pl"); while($line=<F1>) { chomp $line; @arr=split(/"\n"/,$line); print "@arr\n"; } open(F2,"accno.pl"); { while($line1=<F2>) { chomp $line; @arr1=split(/"\n"/,$line1); print "@arr1\n"; } } open(F3,"ptax.pl"); while($line=<F3>) { chomp $line; @arr3=split(/"\n"/,$line); print "@arr3\n"; }

The above code is reading all the contents of 3 files, i required to read only the last lines from these file, how can we read only the last lines from these files.
keep pouring your ideas.

In reply to how can i read only the last line of a files 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.