Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Compatability parser?

by SpaceAce (Beadle)
on Nov 18, 2002 at 04:19 UTC ( [id://213649]=perlquestion: print w/replies, xml ) Need Help??

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

I do almost all of my PERL programming on Linux/Solaris platforms. Most of my PERL scripts operate on webservers. I try not to do things that I know will break my scripts on, say, WinNT servers but I don't do any testing on other platforms, either.

I am wondering if anyone knows of a script or module that can go through PERL code looking for known portability killers. I had a look at CPAN but I didn't see what I was looking for.

I realize I could crack the books looking for problematic things and check my programs manually, but I have hundreds of PERL scripts sitting around on my hard drive and it would be nice to automate the task a bit :)

SpaceAce
s>>sp>;s>..|>\u$&ace>g;print;

Replies are listed 'Best First'.
Re: Compatability parser?
by graff (Chancellor) on Nov 18, 2002 at 04:52 UTC
    I don't have an answer -- sorry -- but have you tried this:
    perldoc perlport
    It's pretty comprehensive (maybe even paranoid, which is not a bad thing in this context). Apart from that, you would at least need to actually put your scripts onto a Windows box that has the suitable version of Perl installed, fire up a command-line prompt window, have a windows port of bash on hand, just to make it easier, and do:
    for i in *.pl; do perl -cw $i > $i.chk 2>&1 done
    Get windows ports of other useful things, like grep and sort (or roll your own perl equivalents, since this is typically not much harder than locating the ported code on the web and installing it), in order to go over the *.chk files for common issues.

    update: Of course, if you use CPAN modules that aren't part of the core perl distribution, that can put a slight damper on portability. In this case, part of your question could be "is there an easy way to distribute portable code so that when recipients install it, it automatically checks for modules it needs and downloads them from CPAN when necessary?" That's a damn good question, and I'm sure someone can suggest a good answer... (I'll check back to look for that.)

      Thanks for the reply. Mostly, my programs contain all my own code and don't need any non-standard modules. A couple of my bigger projects do have external requirements, but I want to make sure my own code is portable before I worry about other people's modules :)

      I like the idea you posted above. I just don't have a suitable Windows test platform up and running at the moment, which is why I am trying to weed out as many obvious problems as I can on my Linux development setup. I used to develop under Cygwin so a lot of my code will at least work in that context but I am not sure what that really says.

      I guess the only 100% certain way is to set up an NT server and start running everything. Should be fun :)

      SpaceAce
      If I had a signature here, you would already have read it.

        Sorry for the double reply, I guess I wasn't logged in. I wondered why my signature wasn't in the text box.

        SpaceAce
        s>>sp>;s>..|>\u$&ace>g;print;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-25 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found