Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Cross platform coding advice

by techcode (Hermit)
on Oct 08, 2005 at 10:23 UTC ( [id://498404]=note: print w/replies, xml ) Need Help??


in reply to Cross platform coding advice

If you are writing "normal" web applications, that interact with MySQL (or some other RDBMS) you usually do not see the difference. I've been using Windows and 99.9% of my applications are deployed on Linux or FreeBSD.

Virtually only thing that was making problems to me is the newline character. You only need to make sure that first line (#!usr/bin/perl or similar) is on it's own. And since Windows and Linux have different line endings unless you save files in Unix mode it won't be the case.

As I'm using CGI::Application and many of it's plug ins - that aren't widely available on the plain hostings here's what I'm using :

In my root folder (htdocs or www usually) I have index.pl file which just calls CGI::Application::Dispatch run method. All other files are inside folder named by the application (say AppName). That folder is protected with .htaccess (just write "deny from all" inside of it). And inside of it I have :

Templates/
Templates/Module1/files.dwt
Templates/Module2/files.dwt
...
Foundation/ (modules inherithed by others)
Foundation/Database.pm
Foundation/Runmodes.pm (this one is use base '' in all Runmodes, and itself inhretihs from CGI::App)
...
Runmodes/
Runmodes/Module1.pm
Runmodes/Module2.pm
...
Config/ (some config files)
Cron/ (some scripts run by cron, delete old sessions ...etc)
CAPN/ (inside of it, there are all the modules that are from CPAN, but aren't available on the server. You need to add it to the @INC in the index.pl file)

Overall it works pretty good. Once I set it up on the server, I only upload files inside Runmodes and Templates folders (most of the time).

O yeah, templates are just plain HTML + HTML::Template tags, but are named *.dwt and not *.tmpl so Dreamweaver would open them nicely with WYSIWYG part working too.


Have you tried freelancing? Check out Scriptlance - I work there.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://498404]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2025-06-17 08:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.