rmcdougal01 has asked for the wisdom of the Perl Monks concerning the following question:
Hello, This is my very first post, I am using the "Learning Perl" book (7th eddition). I can't find a solution for my problem in this book, and googling has yield no results. I want to execute a particular function each time an iteration completes using the while loop:
sub cp_domains { open(my $fh, $domainFile) or die "Coult not open file '$domainFile +'"; while (my $row = <$fh>) { chomp $row; my @domain = split /:/, $row; resolve_domain($domain[0]); } #close($fh); }
The first time the “while” loop iterates it would correctly execute the function, but subsequent times is not returning anything. Can anyone provide me with some guidance?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to execute a function each time a "while" loop iteration occurs?
by LanX (Saint) on Dec 22, 2019 at 00:03 UTC | |
by rmcdougal01 (Initiate) on Dec 22, 2019 at 01:21 UTC |