When you have constant prints like this
print "\nHere is a list to select from:\n"; print "A. Set input filename\n"; ...
It could be better writen with here documents:
print END; This is text that only needs one print END
There were so many places where you made an error, I thought I'd like to point this out: good job on using <STDIN> instead of <>.
chomp ( $selec = <STDIN> );
Where you use this:
$selec =~ s/[a-z]/[A-Z]/;
The substitution could be better written:
$selec =~ tr/a-z/A-Z/;
and that could be better written without a regex:
$selec = uc($selec);
Where you have the switch like statement:
if ( $selec eq 'A' ) { namefile(); Menu (); } ...
You might want to look into something like this:
%func = (A => \&namefile, B=> \&openfile, ...) ... $func{$selec}->(); Menu();
Here, you could do better to add a 'my'
my ( $last, $first, $age, $sex, $height, $weight, $comment ) = split ( +/,/);
Also, you might want to look into having a data structure somewhat like this:
$age[$i++] ={last=>$last,first=>$first,age=>$age,sex=>$sex,height=>$he +ight,weight=>$weight,comment=>$comment}
And you would use it like this:
print "First last=$age[0]{last}\n";
Also, if you change the datastructure, you might want to look into a Shwartzian Transfer.

Sorry for the briefness on some topics, but there were a lot : ) If you still have questions, just ask.

The 15 year old, freshman programmer,
Stephen Rawls


In reply to Re: Please help...not certain why my code does not work. by srawls
in thread Please help...not certain why my code does not work. by Satanya

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.