Hey Perl Monks... well, I am asking a three-part question, firstly, the code that I have written in here, I want it criticized (not in an acidic way, I am new to Perl - 2 weeks old - and I handled the files for the first time today, in the past 10 minutes, hehe), I am eager to get your feedback secondly, how can I get to save the same sort of data entered through this program in another type of files like spreadsheet .xls instead of the simple .txt file? I tried saving it in .xls, but could not figure out how to make the fields "specialization, name and age" column headers instead of cell members (I don't want them to repeat everytime I run the code, or jump rows over between an entry and another, like from age to name it jumps a line) thirdly, I want to enforce a certain order in the hash values, Perl returns hash keys not the same ordered they have been entered I am aware, but I want the program to give me prompts in this order name -> specialization ->age, instead of specialization -> name -> age..
#!/usr/local/bin/perl use strict; use warnings; my %info = ( 'name' => ' ', 'age' => ' ', 'Specialization' => ' ', ); open FILE, '>>C:\Documents and Settings\m\Desktop\info.txt' or die $!; foreach my $key (keys %info){ print "enter your $key\n"; print FILE "$key: " ,$info{'$key'}=<>, "\n"; }

In reply to a dynamic program??? by biohisham

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.