Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: RFC: A Primer on Writing Portable Perl Programs

by xdg (Monsignor)
on Nov 01, 2006 at 12:35 UTC ( #581665=note: print w/replies, xml ) Need Help??

in reply to RFC: A Primer on Writing Portable Perl Programs

First, thanks for taking on this subject. Working on Vanilla Perl has been an interesting lesson on just how many common Perl modules weren't written for portability. However, the meditation focuses a lot on Windows, so I'd either consider broadening the OSes covered or else changing the title.

That said, I found version 0 of the tutorial to be substantially less informative than perlport. If you're looking for a gentler introduction, I'd suggest taking perlport as the base and then translating it into something that is easier for a less experienced programmer to understand. There's a lot more to portability that what you've covered above.

I suggest you look at -- there's a good deal of information there that will be of use. Search for "Problem Modules" and you can see a large variety of real-world portability problems in CPAN modules, some of which have been fixed and many of which have not.

Some other random thoughts that occurred to me in reading the tutorial:

All that said, I look forward to the next version.


Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

  • Comment on Re: RFC: A Primer on Writing Portable Perl Programs

Replies are listed 'Best First'.
Re^2: RFC: A Primer on Writing Portable Perl Programs
by Intrepid (Deacon) on Nov 02, 2006 at 15:25 UTC

    xdg wrote on 1 Nov 2006:

    Modules I've found helpful: IPC::Run3, File::HomeDir, ExtUtils::Command, Probe::Perl ...

    I have to somewhat emphatically add File::Save::Home to this list, as contrasted with File::HomeDir, which arguably does not really do the right thing on MS Windows.

    At the very least people need to read the POD for each module, study the APIs and rationales and make an educated choice.

        Soren A / somian / perlspinr / Intrepid

    Words can be slippery, so consider who speaks as well as what is said; know as much as you can about the total context of the speaker's participation in a forum over time, before deciding that you fully comprehend the intention behind those words. If in doubt, ask for clarification before you 'flame'.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://581665]
[robby_dobby]: Corion: Heh. This whole thing smells of Strategy Pattern or MVC pattern.
[Corion]: And performance linear to the number of registered one-shots doesn't feel that bad. Maybe I should collect statistics on how many callbacks are outstanding ;)
[Corion]: choroba: Yes, but the longer I thought about efficient hashes mapping the event type back to their callbacks, and how to keep them in sync, the more I thought that all that optimization might just not be worth it, even if it's horribly inelegant
[Lady_Aleena]: My biggest problem with hashes at the moment is one with 2,501 keys.
[choroba]: how many event types are there?
[Corion]: Also I found that I can't conveniently weaken an array slot, which also is inconvenient, as I want my one-shots to disappear if the caller discards them
[Corion]: choroba: Currently two or three that my program handles (WWW::Mechanize:: Chrome), but there might be more that become interesting
[Corion]: But I don't expect more than 100 to be active at the same time, so I'm not really sure if there is a not-too-fancy data structure that is maintained with few lines of code where the performance is better than the linear scan ;)
[Corion]: But I should do a mock-up program so that others can see what I'm talking about ;)
[robby_dobby]: Corion: I hope you know all too well that passing around "fancy" datastructures is a recipe for disaster :-)

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2017-05-29 07:56 GMT
Find Nodes?
    Voting Booth?