[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] perl, array, flytning af elementer



On Sun, 16 May 2004 19:29:39 +0200, Kristian Kallenberg wrote:

> Det må være muligt bare at gøre det sådan:
> 
> $element[$elementer + 1] = $nytelement;
> "smid $element[1] væk"
> 
> Nogen der har en god ide?
> 
Hvorfor ikke blot:
my @element;

push(@element, $nytelement);

Hvis @element maksimalt må indeholde 60 elementer:
if (scalar(@element) < 60) {
	push (@element, $nytelement);
} else {
	pop (@element);
	push (@element, $nytelement);
}

Læs eventuelt denne artikel:
http://www.devshed.com/c/a/Perl/Array-Manipulation-in-Perl/6/

-- 
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
mir <at> datanom <dot> net
http://keys.se.linux.org:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://keys.se.linux.org:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
Test input for validity and plausibility.
            - The Elements of Programming Style (Kernighan & Plaugher)




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *