in reply to Re: Seeking good ways to structure cross-platform code
in thread Seeking good ways to structure cross-platform code

I like Corion's approach, in fact I use a similar approach as well. I think this approach is cleaner than mixing codes for different platforms into a single module.

My similar approach:

package My::Functions; ... my $OS_TYPE = ...; eval "require My::Functions::$OS_TYPE" or die "Can not load module"; ..


Having said that, simon's approach from File::Spec is nice too. As Perl programmers always quote: there is more than one way to do it. :-)