Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

perl development on Win32...but for UNIX!

by yeahyeahyeah (Initiate)
on Jan 23, 2006 at 13:04 UTC ( [id://524914]=perlquestion: print w/replies, xml ) Need Help??

yeahyeahyeah has asked for the wisdom of the Perl Monks concerning the following question:

Currently I dual-boot my laptop with XP and Ubuntu. Ubuntu is mostly for Perl development, and Windows everything else. This isn't a huge issue, but it's becoming more of one now that I' getting more into PHP, etc, and need to go back to Windows more often (I use Dreamweaver, etc). So I decided I'd install ActiveState Perl, PHP, Apache in Windows, and make that my "development" environment for the time being. But I found that some of my scripts don't work because I use the "cwd" module. Now I'm concerned that scripting Perl in Win32 will cause problems when I move my scripts over to my UNIX webserver. All of my scripts will be used on some flavor of UNIX. I will write them in Win32 just because it's easier to do the rest of my development. So my question is, I understand Perl is portable and cross-platform, but is writing stuff in Win32 to use in UNIX a pain to really do? Also, I use Komodo. Thanks in advance.
  • Comment on perl development on Win32...but for UNIX!

Replies are listed 'Best First'.
Re: perl development on Win32...but for UNIX!
by Corion (Patriarch) on Jan 23, 2006 at 13:09 UTC

    There is no cwd module. The module is named Cwd and is a core module, so it is available with both, Windows and Unix (and likely, every other OS you get a Perl for).

    Most likely what trips you up is that Perl on Windows happily loads the file cwd.pm even if the real name is Cwd.pm.

    In my experience, writing your scripts on Windows and then using them on Unix works in most parts, asa long as you use forward slashes (/) to separate your directory names and take a look at File::Spec before you do the directory manipulation yourself.

Re: perl development on Win32...but for UNIX!
by svenXY (Deacon) on Jan 23, 2006 at 13:09 UTC
    Hi,
    you might want to consider installing cygwin. It gives you a (as complete as you like) Unix like environment uder Windows and will allow you to develop unbder Windows and still verify functionality under Unixes.
    Regards,
    svenXY
Re: perl development on Win32...but for UNIX!
by explorer (Chaplain) on Jan 23, 2006 at 13:12 UTC
    Not if you use the File::Spec family modules.

    About the windows-linux work... I adopted other solution, more stable: Install Linux a run Vmware when I need running windows programs...
Re: perl development on Win32...but for UNIX!
by thedoe (Monk) on Jan 23, 2006 at 15:41 UTC

    One of the best tools I have found for developing Perl code within a Windows environment for use on a Linux server is the editor jEdit.

    This editor has the ability to select the type of line break to use, provides good syntax highlighting, and all the other basics. The thing that sets it apart though are the plugins available.

    The plugin I have personally found to be the most useful is the FTP plugin, allowing you to work directly against a Linux box from your Windows machine, even over an sftp connection. There are a number of others that make life as a programmer much easier as well, just look through and choose for yourself.

    Of course, as was pointed to in a post by marto, make sure to read through the Setting up Perl/CGI with Windows guide written by Ovid. This will help you get past a large number of the basic snags to running your code on a Windows box.

Re: perl development on Win32...but for UNIX!
by asz (Pilgrim) on Jan 23, 2006 at 14:31 UTC
    i guess it is easier to be able to develop and deploy on the same platform.

    some of your Windows-only applications that you need, might possibly run on Linux in some sort of emulator and you'll be able to stick with Linux :)

    i'm using Ubuntu myself, and i was able to install Internet Explorer 6 on it using Wine. it might work for Dreamweaver too...

    Wine is pretty stable now and the performance is also good.

    :)))))
Re: perl development on Win32...but for UNIX!
by rdfield (Priest) on Jan 24, 2006 at 09:54 UTC
    I've never had a serious problem developing on Windows and deploying to *nix. Just avoid using platform specific modules (especially the Activestate Win32::* ones) and making calls to external utilities and commands. If you must do "platform specific" stuff, eg forking, use "require" in an eval and test for the OS type. Installing cygwin makes life a lot easier if you have to make external calls (in my case for re-encoding music) but there are still differences between how a shell call is executed in *nix and cygwin, though obviously not as severe as shell and cmd.

    Getting the case right for your module names is something that *nix is very picky about, and one of the main causes of frustration when migrating from a Win32 dev platform.

    For a bit of fun why not make your database Access or SQL Server on Windows and PostgreSQL or MySQL on *nix? :)

    rdfield

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-25 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found