Good Afternoon oh wise Monks I do have a question and the code is posted below

sub railcarcount { my %count; Title "Total Railcar Count"; open(INPUT, "<railcardata.txt"); open(OUTPUT, ">railcarcountdata.txt"); my $railcarcnt='Boxcar|Reefer|Flatcar|Tankcar|Gondola|Hopper'; while(<INPUT>){ my @words = split(/\:/); foreach my $word (@words){ if($word=~/($railcarcnt)/io){ $count{$1}++; } } } print colored ("------------------------------------------------------ +--------------------------",'green bold'); print colored (" TOTAL RAILCARS LISTED BELOW + ",'green bold'); print colored ("------------------------------------------------------ +--------------------------\n\n\n\n",'green bold'); foreach my $word (sort keys %count) { printf("%42s %-16s %-23s %6s", colored("There are",'cyan bold'), colored("$count{$word}",'yellow bold'), colored("$word",'cyan bold'), colored("Car(s)\n",'cyan bold') ); print OUTPUT "There are $count{$word} $word Car(s)\n"; } close INPUT; close OUTPUT; print colored ("\n\n\n\n\n WHEN YOU ARE DONE VIEWING + HIT RETURN TWICE:\n\n\n", 'green bold'); my $input = <STDIN>; $input = <STDIN> until defined $input; chomp($input=<STDIN>); cls(); structure::railcar(); }

__DAT__

B&LE:65065:Hopper:Home
B&LE:65700:Hopper:Home
VM:51142:Hopper:Home
OS:1400:Hopper:Home

__OUTPUT__

There are 16 Car(s)
There are 4 Hopper Car(s)

What I "think" it is doing is counting all the words and giving a total up top....that output is not relevant...only the car count. How do I remove that part? Thanks!


In reply to Remove a Line by PilotinControl

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.