I\'m a noob.I need some basic knowledge about how data should be saved and read under perl. Say to save a hash and an array. What format (extension) of file should be used?
This really depends upon how you'd like store your data in your file. I will try writing some basic perl code to enable you to read a file into an array and or write back a hash into a file.
#Load a file into a hash.
#My Text file has the following format.
#field1=value1
#field2=value2
# is an opens a sample txt file in read-only mode.
my %hash;
while ()
{
chomp;
my ($key, $val) = split /=/;
$hash{$key} .= exists $hash{$key} ? ",$val" : $val;
}