#!perl use File::Spec::Functions; print catfile( qw/dir subdir file/ ); __END__ On my FreeBSD box, the result is "dir/subdir/file" On my Win2K box , the result is "dir\subdir\file"