Leading and trailing spaces *do* have particular problems in shell scripts, because the 'read' command (which is needed to read line-separated data from commands) strips leading and trailing spaces/tabs unless IFS is set and does not contain spaces/tabs.
perl also has problems with leading spaces in filenames, unless you use the right kind of open command (perldoc -f open).