#!/usr/bin/perl use warnings; use strict; use AppConfig qw( :argcount ); my $config = AppConfig->new( {CREATE => 1, GLOBAL => { ARGCOUNT => ARGCOUNT_LIST }, }); my $config_file = "email.conf"; $config->define("pro_box", { ARGCOUNT => ARGCOUNT_ONE } ); $config->file($config_file); # # Fetch pro box value # my $pro_box = $config->pro_box; # # Fetch arrays. Get rid of the "1" in @array[0]. # my @pro_emails = @{$config->pro_box_emails}; shift @pro_emails; my @default_emails = @{$config->default_emails}; shift @default_emails; print "Pro Box = $pro_box \n"; print "\n" ; my @mail_to = ($pro_box) ? @pro_emails : @default_emails ; for (@mail_to ) { print "My addresses are: $_ \n"; }