Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

It's very easy to develop on Windows for Linux, as long as you keep that in mind. Under Windows, mostly there are features lacking, like proper fork(), selectable filehandles and some other stuff, so if you follow what is outlined in perldoc perlport, you should be mostly going. The main problems are when you're interacting with the operating system, and that is mainly by opening files.

  • You should use all filenames in "unix notation", as Win32 understands the forward slash as path separator as well.
  • For temporary files, use File::Temp instead of hardcoding the filename
  • At the start of the program, change the directory to a known location. I often use the following snippet:
    use strict; use File::Basename; use lib 'lib'; # or maybe '/home/k_rajesh/perl5lib' chdir dirname $0;
  • Keep all additional modules for your program in a directory under your "main program directory". If your main program has to live in a web-accessible directory, I recommend to launch it through a shell script from there, as that will keep your Perl code clean and your modules out of the web accessible space:
    #!/bin/sh exec '/home/k_rajesh/perl_prog/'

For installing modules on the Linux host, that is very easy as long as the modules are written in Perl, see A guide to installing modules for Win32, especially the "Manual install" section. In most cases, you can simply unpack the module distribution and copy all files into your application lib directory in the right directories.

In reply to Re: Cross platform coding advice by Corion
in thread Cross platform coding advice by k_rajesh

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?

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-06-20 23:17 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.