in reply to Getting a base name

You're using single quotes inside single quotes; moreover, the dot is a special character in a regexp, you have to escape it:
perl -e ' $fname = "test.txt"; # Double quotes! $base = (split(/\./,$fname))[0]; # Escape dot! print "$base\n";'

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.