http://www.perlmonks.org?node_id=1062874


in reply to splitting the scalar variables in an array

$hosts_per_hostclass = `/opt/systems/bin/expand-hostclass --hosts -r $ +class` ; push (@TotalHosts,$hosts_per_hostclass);

Back-quotes in list context return a list so you could do this:

chomp( @hosts_per_hostclass = `/opt/systems/bin/expand-hostclass --hos +ts -r $class` ); push @TotalHosts, @hosts_per_hostclass;