geoffleach has asked for the wisdom of the Perl Monks concerning the following question:
I wish to extract an element from a list, ie (a,b,c) => (a,c). However this list is a tad complex
$a[0][0] = ['00', '01']; $a[0][1] = ['10', '11']; DB<69> x @a[0] 0 ARRAY(0x55bb8ce673d8) 0 ARRAY(0x55bb8ce5b430) 0 00 1 01 1 ARRAY(0x55bb8d543fb8) 0 10 1 11
The closest I've been able to get is:
DB<69> x @a[0] 0 ARRAY(0x55bb8ce673d8) 0 undef 1 ARRAY(0x55bb8d543fb8) 0 10 1 11
Using delete but I've been unable to get rid of the undef. Oh, List::UtilsBy::extract_by {...} was not successful.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: extracting a list element
by LanX (Saint) on Jan 05, 2024 at 00:45 UTC | |
by geoffleach (Scribe) on Jan 05, 2024 at 18:53 UTC | |
by jo37 (Curate) on Jan 06, 2024 at 13:40 UTC | |
by LanX (Saint) on Jan 06, 2024 at 18:05 UTC | |
by LanX (Saint) on Jan 06, 2024 at 14:00 UTC | |
Re: extracting a list element
by Anonymous Monk on Jan 05, 2024 at 14:38 UTC | |
Re: extracting a list element
by hippo (Archbishop) on Jan 05, 2024 at 09:36 UTC | |
by LanX (Saint) on Jan 05, 2024 at 19:27 UTC | |
by hippo (Archbishop) on Jan 05, 2024 at 23:14 UTC |