Sep 6, 2002 #1 ianfo Programmer Aug 20, 2002 29 GB Hi, When using print to display an array element, like this.. print "$myarray[0]\n"; Is it possible to specify a range of elements to print? So instead of just having element 0, I could say elements 0 to 5. Thanks for any help you can give me.
Hi, When using print to display an array element, like this.. print "$myarray[0]\n"; Is it possible to specify a range of elements to print? So instead of just having element 0, I could say elements 0 to 5. Thanks for any help you can give me.
Sep 6, 2002 #2 Grant Programmer Apr 10, 1999 105 CA Hi ianfo, perl -e "@a=(1,2,3,4,5);print qq(@a[2..3]\n)"; 3 4 Grant. Upvote 0 Downvote
Sep 6, 2002 Thread starter #3 ianfo Programmer Aug 20, 2002 29 GB Just what i'm looking for, thanks.... Upvote 0 Downvote
Sep 6, 2002 #4 badco Programmer Nov 29, 2000 73 US [tt] @array = ('Value1', 'Value2', 'Value3','Value4','Value5'); print "@array[2..4]\n";[/tt] ================= Bad Company Music ================= Upvote 0 Downvote
[tt] @array = ('Value1', 'Value2', 'Value3','Value4','Value5'); print "@array[2..4]\n";[/tt] ================= Bad Company Music =================