How do I append an element to a perl array? - Dave's Brain
文章推薦指數: 80 %
Date: 2014nov11 Language: perl Q. How do I append an element to a perl array? A. Use push() like this: push(@a, 'new element');. Dave’sBrain Home Search Browse Recent Keywords Othersites Feedback Signin Random Crawlers ProgrammingTips-HowdoIappendanelementtoaperlarray? Date:2014nov11 Language:perl Q.HowdoIappendanelementtoaperlarray? A.Usepush()likethis: push(@a,'newelement'); Notethatpush()worksin-place.SodoNOTdothis: @a=push(@a,'newelement'); #WRONG,WRONG,WRONG
延伸文章資訊
- 1Arrays - Learn Perl - Free Interactive Perl Tutorial
Perl array variables store an ordered list of scalar values. ... push(@array, element) : add elem...
- 2Manipulating Perl arrays: shift, unshift, push, pop - Perl Maven
The push function can add one or more values to the end of an array. (Well, it can also add 0 val...
- 3How do I append an element to a perl array? - Dave's Brain
Date: 2014nov11 Language: perl Q. How do I append an element to a perl array? A. Use push() like ...
- 4Appending One Array to Another - Perl Cookbook [Book]
Appending One Array to Another Problem You want to join two arrays by appending all the elements ...
- 5Perl | push() Function - GeeksforGeeks
push() function in Perl is used to push a list of values onto the end of the array. push() functi...