i am following on this example Simple example of using data from a YAML configuration file in a Perl script
vihtorr@w00w /var/www $ cat test.yaml
IPs: [500, 600, 200, 100]
vihtorr@w00w /var/www $ cat yam2.pl
use strict;
use warnings;
use YAML::XS qw(LoadFile);
my $settings = LoadFile('test.yaml');
print "The IPs are ", $settings->{IPs};
and i would like to know who to iterate inside the Array?
when i execute the code i get
perl yam2.pl
The IPs are ARRAY(0x166e5e0)
thanks for helping a noob
holds a reference to an array. Arrays are dereferenced using
so you can access the array using
You get:
You might also be interseted in
References: