in reply to OS independent perl script

first read perlport then you can also Super Search and find the tobyink replay in Writing portable code or read the docs of File::Spec...
what have you tried until this moment?

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.