in reply to a dynamic program???

Perl returns hash keys not the same ordered they have been entered I am aware
So you need to use a second structure which will enforce the order you require. Something like this might be what you're looking for:
foreach my $key (qw(name specialization age)) { print "enter your $key\n"; print FILE "$key: " ,$info{'$key'}=<>, "\n"; }
Actually Perl goes further than not guaranteeing that hash keys will be read out in the same order they've been written in. As the second paragraph in my man page for the 'keys' builtin reads:
The keys are returned in an apparently random order. The actual random order is subject to change in future versions of perl, but it is guaranteed to be the same order as either the "values" or "each" function produces (given that the hash has not been modified). Since Perl 5.8.1 the ordering is different even between different runs of Perl for security reasons (see "Algorithmic Complexity Attacks" in perlsec).
So if you're running your unmodified code in version 5.8.1 or later different runs will give randomly generated order for the questions. But at least with three input values, you'll get the order you want 1 in 6 times!

Replies are listed 'Best First'.
Re^2: a dynamic program???
by biohisham (Priest) on Aug 16, 2009 at 11:49 UTC
    Thanks for explaining the part about retrieving hash keys ordering and the security aspect, I wouldn't be surprised to see that behavior now :)...take care

    Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.