RE: Help with array

2011-09-08 Thread Brian Raven
 -Original Message-
 From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-
 win32-users-boun...@listserv.activestate.com] On Behalf Of Barry Brevik
 Sent: 07 September 2011 18:48
 To: Tobias Hoellrich; perl-win32-users@listserv.ActiveState.com
 Subject: RE: Help with array

 The Camel book seems to say that splice will only remove or change
 elements and move them *down* if necessary.

 You must think I'm a raging newb, but I gotta admit, I've never used
 splice. Thanks, I'll check it out!

Everybody's a 'newb' at stuff that haven't tried before. It might help to think 
of inserting elements into an array as replacing a section of length 0, when 
you read 'perldoc -f splice'.

It might also be worth taking a look at slices, described in 'perldoc perldata'.

HTH


--
Brian Raven




Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient or have received this e-mail in error, please advise 
the sender immediately by reply e-mail and delete this message and any 
attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Help with array

2011-09-08 Thread Andy_Bach
 It might also be worth taking a look at slices, described in 'perldoc 
perldata'.

It also *may* be worth rethinking your data model. Often (not always but 
...) needing to insert something into a particular location in an array 
implies a hash might be a better structure.

Just a thought.

a

--
Andy Bach
Systems Mangler
Internet: andy_b...@wiwb.uscourts.gov
Voice: (608) 261-5738, Cell: (608) 658-1890

?One of the most striking differences between a cat and a lie is that a 
cat has only nine lives.? 
Mark Twain, Vice President, American Anti-Imperialist League, and 
erstwhile writer___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Help with array

2011-09-08 Thread Barry Brevik
Splice with a length of 0... I wish I had thought of that. Thank you!

 Everybody's a 'newb' at stuff that haven't tried before. It 
 might help to think of inserting elements into an array as 
 replacing a section of length 0, when you read 'perldoc -f splice'.
 
 It might also be worth taking a look at slices, described in 
 'perldoc perldata'.
 
 HTH
 
 
 --
 Brian Raven
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs