in reply to Perl Array output Help
Isn't it somewhat clearer than the mess that you posted??#!/usr/bin/perl use 5.010; use strict; use warnings; main(@ARGV); sub get_host # Collect the host name from a text file { open(HOST, '<', 'hosts.txt') or error("cannot open file ($!)"); my @host = <HOST>; return "@host\n"; } sub get_logon # Collect logon ID from keyboard { my $logon; print "Please Enter Logon ID:\n"; chomp ($logon =<>); return $logon; } sub get_psswd # Collect password from keyboard { my $psswd; print "Please Enter Password for hostID:\n"; chomp ($psswd =<>); return $psswd; } sub get_command # Collect the commands from a text file { open(CMD, '<', 'cmds.txt') or error("cannot open file ($!)"); my @cmd = <CMD>; return @cmd; } # etc.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Array output Help
by PerlCramps (Novice) on Jun 02, 2015 at 11:18 UTC |