[newbie] printing a hash
From: David (auto87829_at_hushmail.com)
Date: 02/28/04
- Next message: Joe Smith: "Re: FIND: Parameterformat falsch (parameter format not correct)"
- Previous message: FMAS: "FIND: Parameterformat falsch (parameter format not correct)"
- Next in thread: Tassilo v. Parseval: "Re: [newbie] printing a hash"
- Reply: Tassilo v. Parseval: "Re: [newbie] printing a hash"
- Reply: Beable van Polasm: "Re: [newbie] printing a hash"
- Reply: Iain: "Re: [newbie] printing a hash"
- Reply: Tad McClellan: "Re: [newbie] printing a hash"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 28 Feb 2004 20:42:15 +1100
I can't really visualise what's going on in this code. We're simply reading
splitting each line of a file and saving the result in a hash, right?
How can I print the contents of the hash?
open(FILE, 'orig.txt') or die "Can't open orig.txt: $!";
my @fields = qw/a b c d e f g h i j k/;
my $record = <FILE>;
while (<FILE>) {
chomp $record;
my %hash;
@hash{@fields} = split(/\t/, $record);
}
print "$. records processed.\n";
close FILE;
- Next message: Joe Smith: "Re: FIND: Parameterformat falsch (parameter format not correct)"
- Previous message: FMAS: "FIND: Parameterformat falsch (parameter format not correct)"
- Next in thread: Tassilo v. Parseval: "Re: [newbie] printing a hash"
- Reply: Tassilo v. Parseval: "Re: [newbie] printing a hash"
- Reply: Beable van Polasm: "Re: [newbie] printing a hash"
- Reply: Iain: "Re: [newbie] printing a hash"
- Reply: Tad McClellan: "Re: [newbie] printing a hash"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|