Oky My teacher has asked us to take a text file that he has created and count the number of paragraphs, sentances, and vowels, Then take the words that start with consonants and UC them. Then take words that start with vowels and lc them.

I have written what I thought would be correct however I keep getting these errors:

Name "main::para" used only once: possible typo at Dadis_Tanya_lab3.pl line 8.

Name "main::sen" used only once: possible typo at Dadis_Tanya_lab3.pl line 13.

Name "main::vow" used only once: possible typo at Dadis_Tanya_lab3.pl line 19.

and I don't know what it means by used only once.

Here is my code below. Please help a new perl student.

#!/usr/bin/perl -w %count = ("vow",0,"con",0,"word",0,"para",0,"sen",0); while ( <> ) { $b = <>; if ( length($b = $_) != 0 ) { $para++; } $a = $_; while ( $a =~ /[.?!]/) { $sen++; $a = $'; } $a = $_; while ( $a =~ /[aeiou]/i ) { $vow++; $a = $'; } } while ( <> ) { $a = $_; while ( $a =~ /\b([a-z],[^aieou])/i) { $str = $` . uc($1); $a = $'; } $a = $_; while ( $a =~ /\b([aeiou])/i) { $str = $` . lc($1); $a = $'; } } print $b; print $a; foreach $value (keys %count) { print "$value"; } $ *lab3.pl lab3.txt

In reply to New perl student... feeling stupid 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.