Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Whats the way to manually access the firt element of this arrays without looping?
Test Code:
Thanks for looking!#!/usr/bin/env perl use strict; use warnings; my $DATA = { "facts": [ { "name": "A", "type": "Normal" }, { "name": "B", "type": "Broken" } ], }; print $DATA->{ facts }->{ name }->[0]; # A print $DATA->{ facts }->{ type }->[0]; # Normal exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get element of array not looping.
by choroba (Cardinal) on Jul 13, 2021 at 17:59 UTC | |
by Anonymous Monk on Jul 13, 2021 at 18:58 UTC | |
|
Re: Get element of array not looping.
by AnomalousMonk (Archbishop) on Jul 13, 2021 at 22:40 UTC |