Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Concatenating Array elements

by frozenwithjoy (Priest)
on Aug 19, 2014 at 20:47 UTC ( [id://1098046]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @array = 1..10;
    print "Index 7 (before):  $array[7]\n";
    ...
    $array[7] = $array[7] . $array[8];
    print "Index 7 (after):  $array[7]\n";
    print "Index 8 (after):  $array[8]\n";
    
  2. or download this
    Index 7 (before): 8
    Index 8 (before): 9
    Index 7 (after): 89
    Index 8 (after): 9
    
  3. or download this
    $array[7] = $array[7] . splice @array, 8, 1;
    
  4. or download this
    Your method:   1 2 3 4 5 6 7 89 9 10
    Splice method: 1 2 3 4 5 6 7 89   10
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1098046]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-24 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found