in reply to reading input
#! not !#!#/usr/local/bin/perl
This will store the first line of input in $input_name and all the rest in @IMP_INFO. Same for all other input lines.my @EMP_INFO; print "What is your name \n"; my $input_name = <STDIN>; push @EMP_INFO, <STDIN>;
The following will print out the complete array 3 times, if you corrected the code.my $input_name = <STDIN>; push @EMP_INFO, $input_name; print "What is the location name\n"; my $input_location = <STDIN>; push @EMP_INFO, <STDIN>; #correct this on your own print "What is the age \n"; my $input_age = <STDIN>; push @EMP_INFO, <STDIN>;
for ( my $x=0; $x < @EMP_INFO; $x++ ) { # This will run 3 times.... print @EMP_INFO; # This will print out your whole array. Three times }
|
|---|