my $foo = $bar =~ tr/,/,/ + 1; #### my $foo = my @a = split /,/, $bar; # Or this $foo++ for split /,/, $bar; # But why doesn't this work? my $foo = () = split /,/, $bar;