Sharan Basappa wrote:

On Tue, Mar 25, 2008 at 9:31 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
>>
Sharan Basappa wrote:
 > Hi,
 >
 > Is there a way I can copy only part of an array into another array.
 > For example, I want to copy only first 8 elements of source array
 > into destination array.

 my @dest = @source[0..7];
>
> thanks. I can also assume that variables work instead of 0..7 ($1..$2)
> so that I can write this as an general algo

(Please bottom-post your responses to this list, so that extended
threads remain comprehensible. Thanks.)

Yes, although $1 and $2 are special variables that hold captured strings
from the last successful regular expression match, so you would want to
use different variables.

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to