Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: 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 reply to Re: General tips for Unix to Windows script migration? by kodo
in thread General tips for Unix to Windows script migration? by Bukowski

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-19 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found