Hi all,Dear perl Monks i am a beginner when it comes to perl programming
but i sure like it as perl is powerful coding, you can make real nice things with it . that's why i am learning it and trying to make some scripts.

I have a question related to counting lines in a data file
(i don't use any module or cpan or what so ever. Just pur perl code for as far i know ;-)

i got a data.out file containing lines like these sample;

391 | Classic Box Kite | low | 19.95
340 | 4-cell Tetra | in | 45.00
401 | Classic Dragon | in | 39.00
4110 | spitfire|low | 25.00

now my question is how can i count the lines in the data file.
above sample contains 4 lines...

then i want to do if lines in data file is more then $allowedlines = "25"; then run this subroutines {

subrotuine i canmake but i have no idea how tocount the lines
icant find it in the perl book i got as well. (cgi101 book)



In reply to How do i count lines from data file? 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.