Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

(jeffa) Re: splice, explanation please?

by jeffa (Bishop)
on Nov 16, 2002 at 17:01 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-29 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found