On Thu, 19 Jul 2001, Ela Jarecka wrote:
Ok, lemme take a crack at it. ;)
> while(defined($line = <FILEH>)) {
Couldn't you just: while ($line = <FILEH>) {
or is there something I'm missing?
> if ( $toBf =~ /^\n$/) {
> die "Bye, bye!\n";
> }
This would typically be considered bad form, I think. Die is used to stop your program
when it hits a fatal error of some sort; i.e.
open(blah, "blah.txt") || die("Aargh! No blah!")
Instead, I would write that loop as:
if ($toBf =~ /^\n$/) {
print "\nBye, bye!\n";
last MAINLOOP;
}
But for that to work, you have to put a label on your main loop. I.e.:
MAINLOOP: while ($tom = "yay") {
Now, if your main loop is actually in a subroutine, use "return," just like in C.
> sub find_entry {
> my $href = shift;
> my $key = shift;
You could use:
my ($href, $key) = @_;
The rest looks good to me. :)
--
Jason Ledbetter
Data Conversion Specialist
Perl Monk and Ascii Ninja
Cadmus Professional Communications
[EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]