There's more than one way to do things | |
PerlMonks |
Re: General tips for Unix to Windows script migration?by kodo (Hermit) |
on Jun 27, 2002 at 09:57 UTC ( [id://177667]=note: print w/replies, xml ) | Need Help?? |
I've been working on some scripts that had to work on both, linux and windows. I've used some DBI, LWP and other default-modules like SMTP::Sendmail etc. and didn't have any trouble with using them on a NT-Box & Linux/HP-Ux. You could get in trouble because of the different styles of pathes used in win/dos and *nix-systems. Like on a win-box an absolute path could be C:/home/giant while it's just /home/giant on *nix for example. I've seen quite lots of scripts that use different regexprs on pathes, especially CGI-Scripts, that's where you have to be careful I think. Also different on Win-Systems can be output made to console and the way the interpreter is used when doing perl -nle 'print if /test/' <file> it would be perl -nle "print if /test" <file> in windows. Another thing you have to look at is the newline-problem when copying data between these OSes, it happened that I forgot to set the right ftp-type etc and then had lots of ^Ms at the end of each line. You should also have a look at Perl Port from Perldoc, where you find lots of infos on making your perlcode portable. If you are looking for a good distribution I would suggest you Active Perl, there are lots of Prebuild Modules available for this one. giant
In Section
Seekers of Perl Wisdom
|
|