Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Will Perl Scripts written on 64 Bit Windows run fine on 32 bit as well? And other questions.

by perl514 (Pilgrim)
on Dec 03, 2011 at 18:29 UTC ( #941557=perlquestion: print w/ replies, xml ) Need Help??
perl514 has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I had tried learning Perl a while ago, but could not continue due to workload/Job pressure.

Trying to learn it again.

I have installed the 64 bit version of Perl 5.14 and plan to create some scripts to automate some tasks, extract information from XML files, do some text processing which will mostly be command line outputs....

I have a few questions and will be thankful if someone could help me.

1) Will Perl Scripts written on 64 Bit Windows run fine on 32 bit Windows as well or is it better to install 32 Bit Version of Perl?

2) If I have to read from/write to huge text files/XML Files/process a very large amount of command line output and format it, how well is Perl suited for that?

3) Perl generally runs on UNIX. Is it good for Windows too?

My apologies in advance if my questions appear un intelligent, but just trying to ensure that I have picked up the right tool for the right job.

Kindly help and guide.

Comment on Will Perl Scripts written on 64 Bit Windows run fine on 32 bit as well? And other questions.
Re: Will Perl Scripts written on 64 Bit Windows run fine on 32 bit as well? And other questions.
by CountZero (Bishop) on Dec 03, 2011 at 20:07 UTC
    Here are my ideas:
    1. I have never used a 64bit version of Perl, but as Perl is not OS dependent and *most* scripts work equally well on Windows (all kinds and versions), Mac, Linux, ..., I see no reason why a script that works on your "64bit" box will stop working on a "32bit" box. I see only two problems: (a) from information gathered left and right I understood not all modules compile "out of the box" on 64bit Perl and (b) if you use functions or such that make only sense on a "64bit" box, you will have problems on a "32bit" box.
    2. Perl is eminently suited for that.
    3. I do more than 90% of my Perl scripting on various versions of Windows, using either ActiveState Perl or Strawberry Perl.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: Will Perl Scripts written on 64 Bit Windows run fine on 32 bit as well? And other questions.
by JediMasterT (Sexton) on Dec 04, 2011 at 01:55 UTC

    Perl is system independent, so that answers 1, 2, and 4. As for question 3, this is a PERFECT application for Perl.

    I'm glad you've decided to come to Perl. We welcome you.

Re: Will Perl Scripts written on 64 Bit Windows run fine on 32 bit as well? And other questions.
by patcat88 (Deacon) on Dec 04, 2011 at 02:13 UTC
    64bit Windows Perl has 64 bit integer support (quad ints or quads in pack's docs). 32bit Perl has 53 bit integer support because floating points dont start rounding numbers until 2^53 is reached. Less XS modules work/compile on 64bit windows than on 32bit windows. Not sure if modern X64 CPUs run faster in 32bit or 64bit mode. Remember 64bit Perl will use a significantly more amount of memory because of 64bit integers and 64bit pointers being used everywhere. Its difficult for me to think of scenarios where Perl would need more than 2 GB of memory (max amount of address space a 32bit program can use on Windows, most apps will crash in 32bit 3GB mode due to signed/unsigned errors with pointers, I've heard on PerlMonks Perl will crash in 3GB mode). Is Win64 Perl a beta product? Absolutely not. Are there differences which would make 32 over 64 better? yes, but there are also differences which would 64 better than 32.
Re: Will Perl Scripts written on 64 Bit Windows run fine on 32 bit as well? And other questions.
by sundialsvc4 (Monsignor) on Dec 05, 2011 at 13:28 UTC

    What “32-bit vs. 64-bit” dependent features there may be, are likely to be either in the compiled Perl executable itself, or in the less-obvious compiled (“XS”) components which make up some of the various CPAN libraries that may be installed on your system at any particular time.

    So, just be sure to install Perl and whatever else you may need onto the target system; don’t just copy, say, the library-directories from one to another.   The installation process not only constructs the library in the appropriate (possibly target-dependent) way, but also self-tests each and every one to be sure that it actually blooms where it is planted.

Re: Will Perl Scripts written on 64 Bit Windows run fine on 32 bit as well? And other questions.
by perl514 (Pilgrim) on Dec 05, 2011 at 17:17 UTC
    Hi All, Thank you very much for your answers.
Re: Will Perl Scripts written on 64 Bit Windows run fine on 32 bit as well? And other questions.
by cavac (Chaplain) on Dec 09, 2011 at 18:35 UTC

    The scripts will work just fine except in some border cases (mostly when doing some XS stuff). But beware: If you use ActivePerls PDK, Strawberry Perl or something like that to deliver executable (.exe) files, then these executables will be 64bit only.

    But it's not that much of a problem since you can install multiple versions of perl on the same computer - just make sure you don't mix your paths.

    As for Windows vs. Linux/Unix (this is a personal view!): I'm using Perl since that is (for me) the easiest way to bridge the two worlds. I'm a Linux guy myself (and i hate what Microsoft has done to the IP stack and how they forced when-i-grow-up-i-want-to-be-a-browser version 6 on the users), but with the right tools (=perl) recent versions of Windows are actually quite ok. But you have to be carefull with questions like these, flamewars have been known to start over lesser topics.

    Don't use '#ff0000':
    use Acme::AutoColor; my $redcolor = RED();
    All colors subject to change without notice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://941557]
Front-paged by keszler
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2014-08-20 15:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (116 votes), past polls