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