>>>>> "RD" == Rob Dixon <[email protected]> writes:
RD> Thanks Uri. It's midnight and I should be in bed :-/
we should all be in bed!
RD> Version 2:
RD> sub file_contains {
RD> my ($file, $string) = @_;
RD> open my $fh, '<', $file or die $!;
RD> my %names = map { chomp; ($_ => 1) } <$fh>;
RD> return $names{$string};
RD> }
did you see my fast slurp version in this thread?
uri
--
Uri Guttman ------ [email protected] -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/