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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array Manipulation (Selecting Elements)

Status
Not open for further replies.

Alphabin

Programmer
Dec 8, 2002
119
CA
I want to select elements from x to y in the array. Right now, the code I have selects x and y

Code:
foreach my $Results (@records[red][$first,$last][/red]) {
print "$Results \n"
}

Thank you in advance
 
How about:
Code:
foreach my $Results (@records[$first..$last]) {
print "$Results \n"
}
Cheers, Neil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top