Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array problem

Status
Not open for further replies.

Alphabin

Programmer
Dec 8, 2002
119
CA
I have the following:

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.

 
Code:
my @found_items=&findit;

sub findit {
...
push @found, $field[0];
...
return @found;
}

HTH
--Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top