Help - Search - Member List - Calendar
Full Version: array list
WorkTheWeb Forums > Webmaster Resources > Perl Beginner Help
Support our Sponsors!
Bclark1
Hi all

Would anyone know how or if possible to do a print on an array, but I
want to print the first x elements of an array, and then do another
print for the next y values of the same array

I would like to achieve this in one line.

something like this

print @array[0..6], "Some text", @rray[7..10];

Thanks in advance
Brent Clark

Robin
On Monday 11 July 2005 23:08, bclark1 wrote:
QUOTE
print @array[0..6], "Some text", @rray[7..10];
Off the top of my head:

print "@array[0..6] Some text @rray[7..10]";
(untested, but should do the job)

When inside double-quotes, Perl will expand the array for you.

--
Robin <[Email Removed]> JabberID: <[Email Removed]>

Hostes alienigeni me abduxerunt. Qui annus est?

PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.