How about: my $check_first = $array[0]; my $check_last = $array[-1];
-----Original Message----- From: Dan Anderson [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 3:25 PM To: 'Beginners Perl' Subject: peeking at the top or bottom of an array Is there a way to "peek" at the top or bottom of an array? Sort of like pop or shift but without needing to insert the value back into the array? I suppose I could do something like: my $check_me = pop @array; push @array, $check_me; But that seems kind of inelegant and verbose. Thanks, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]