@A is an array. If it has five or more items in it, and you want to get just those first five out of it, you can take a slice: my @five_only = @A[0..4];
split is for when you want to take a single scalar (an entity starting with $, such as $A, $B, or $A[0] # an element of the array @A, or a literal), and split that single scalar value into a list of elements that can be stored in an array, or processed listwise.
join is for taking a list (a naked list, or something stored in an @Array, for example), and converting that list into a single scalar delimited by whatever you pass as your first argument to join.
You're really pretty close. Just spend an hour with perlintro, perldata, split, and join. No more than an hour (even if it takes longer to digest every last detail, an hour is all you need to get a comfortable overview).
Dave
In reply to Re^6: Perl list items
by davido
in thread Perl list items
by robertw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |