PerlCramps has asked for the wisdom of the Perl Monks concerning the following question:
When I call the subsub get_host { open( HOST, "<hosts.txt"); while(<HOST>) { my($line) = $_; chomp($line); print "$line\n"; return($_); } }
I am getting the following outputmy $host = get_host(); print "hostname = $host";
I want to be able get the output for each line entry. any other help would be appreciated !!! Thankshostone hostname = hostone
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sub Return Help
by toolic (Bishop) on May 06, 2015 at 19:20 UTC | |
by PerlCramps (Novice) on May 07, 2015 at 11:12 UTC | |
by PerlCramps (Novice) on May 07, 2015 at 15:18 UTC | |
by toolic (Bishop) on May 07, 2015 at 15:26 UTC |