UPDATE: if i have not misunderstood your question (path intended as directory path not env path entry)
use File::Util qw( SL );
print SL;
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.