Re: hash table question

2007-08-10 Thread Lim Ee Wah
It counts the number of occurances of all lines in a file until a directive BREAK. a v b a a BREAK - Then, $seen{a} = 3; $seen{v} = 1; $seen{b} = 1; On 8/11/07, Todd Beverly <[EMAIL PROTECTED]> wrote: > > Mark Funk wrote: > > What exactly does the following Perl code do? > > > > %hash=

Re: hash table question

2007-08-10 Thread Todd Beverly
Mark Funk wrote: > What exactly does the following Perl code do? > > %hash=(); > > open(PREVFILE, $prevfile) or die("Unable to open previous file"); > > while() { > chomp; > last if /BREAK/; > $seen{$_}++; > } > close(PREVFILE); > > At the end of the loop, The %seen hash keys will hav

RE: hash table question

2007-08-08 Thread Suresh Govindachar`
Mark Funk asked: > What exactly does the following Perl code do? > > %hash=(); > > open(PREVFILE, $prevfile) or die("Unable to open previous file"); > > while() { > chomp; > last if /BREAK/; > $seen{$_}++; > } > close(PREVFILE); Exactly, the code does not

RE: hash table question

2007-08-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Funk Sent: Wednesday, August 08, 2007 14:59 To: perl-win32-users@listserv.ActiveState.com Subject: hash table question What exactly

hash table question

2007-08-08 Thread Mark Funk
What exactly does the following Perl code do? %hash=(); open(PREVFILE, $prevfile) or die("Unable to open previous file"); while() { chomp; last if /BREAK/; $seen{$_}++; } close(PREVFILE); TIA, David M. Funk President/CEO Tivoli Certified Enterprise Consultant Specializing in Netwo