use strict; #### use warnings; #### Scalar value @hostname_short[0] better written as $hostname_short[0] #### @hostname_short = split(/\./,$fqdn,2); my $hostname = "@hostname_short[0]"; #### my $hostname = (split /\./, $fqdn, 2)[0];