Thursday, January 02, 2003 4:37 AM
> To: Perl
> Subject: Restarting at top of file
>
> I want to read through a file and the read through it again. However the
> only way it seems to work for me is if I open the file, Read the file,
> Close the file, and the reopen it. Is there
On Jan 2, Paul Kraus said:
>I don't think your solution will work.
>Since the count being taken is going to be sparadic.
>
>somelements only = 1 at the BOF but by EOF it equals 4. Since you tested
>per line your results will be bad because at test time for that line
>somelement only = 1 when actua
} = $value }
>> else { delete $vend{$field} }
>> }
>> -Original Message-
>> From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]]
>> Sent: Thursday, January 02, 2003 10:30 AM
>> To: Paul Kraus
>> Cc: 'Perl'
>> Subject: RE
May I be finicky? Nothing wrong with your code Jeff, but I prefer:
while () {
chomp;
s/ +//g;
my ($value, $field) = split /,/;
if ( $dup{field}++ ) { delete $vend{$field} }
else { $vend{$field} = $value };
}
Thank you :oD
Rob
"Jeff 'Japhy' Pinyan"
> Cc: 'Perl'
> Subject: RE: Restarting at top of file
>
>
> On Jan 2, Paul Kraus said:
>
> >As you can see I am building a hash on the first pass. Then on the
> >second pass I am building a second hash but I am checking the first
> >hash to see if it had a c
On Jan 2, Paul Kraus said:
>As you can see I am building a hash on the first pass. Then on the
>second pass I am building a second hash but I am checking the first hash
>to see if it had a count greater then two. I don't see any other way to
>do this except two passes through the file. Correct me
$temp[1]} > 1);
}
> -Original Message-
> From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 02, 2003 10:02 AM
> To: Paul Kraus
> Cc: Perl
> Subject: Re: Restarting at top of file
>
>
> On Jan 2, Paul Kraus said:
>
> >I want
On Jan 2, Paul Kraus said:
>I want to read through a file and the read through it again. However the
>only way it seems to work for me is if I open the file, Read the file,
WHY do you want to read the file twice? Is there some way you can do two
things at once?
>foreach (){
> chomp;
> @temp=s
Yes:
seek HANDLE, 0, 0;
Resets the file pointer to the beginning.
Aloha => Beau.
-Original Message-
From: Paul Kraus [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 4:37 AM
To: Perl
Subject: Restarting at top of file
I want to read through a file and the read through
I want to read through a file and the read through it again. However the
only way it seems to work for me is if I open the file, Read the file,
Close the file, and the reopen it. Is there a way to do this with out
having to run the open command twice?
Does not work
--
open PEL, "vend.c
10 matches
Mail list logo