my $suffix = ( split /\./, $filename )[-1]; #### print ( split /\./, $filename )[-1]; # wrong print (( split /\./, $filename )[-1]); # unpleasant