I have the following:
Now I want to store the $field[0] data into an array so that I can use it in a statement in another sub-routine.
Code:
open(FILE,"$File.txt") || die("Could not open file!");
my @Data=<FILE>;
close(FILE);
foreach my $record (@Data) {
chop $record;
my @field=split(/\|/,$record);
if ($input{'srh'} == $field[5]) {
push (@found,[@field]);
print $field[0];
}
}
Now I want to store the $field[0] data into an array so that I can use it in a statement in another sub-routine.