Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

(jeffa) Re: splice, explanation please?

by jeffa (Bishop)
on Nov 16, 2002 at 17:01 UTC ( #213422=note: print w/replies, xml ) Need Help??


in reply to [splice], explanation please?

splice is great. Here is how you can remove a whole column from a two-dimensional array:
use strict; use Data::Dumper; my @table = ( [qw(a b c)], [qw(d e f)], [qw(g h i)], ); my @col = map { splice @$_,1,1 } @table; print Dumper \@col;
The end result is the middle column of @table is removed and assigned to @col.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2022-12-05 22:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?