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

I am trying out h2xs for some stuff. I'm developing in v 5.6, but our production server is (horrors) 5.5003 or something like that. I'm wondering if there is a switch that turns off the 'require 5*' at the top of the stub module?
_______________________________________________
"Intelligence is a tool used achieve goals, however goals are not always chosen wisely..."

Replies are listed 'Best First'.
Re: h2xs question
by dchetlin (Friar) on Dec 11, 2000 at 18:37 UTC
    Good question. Unfortunately, you may not like my answer so much.

    The functionality you want exists, in the form of the `-b' switch. Specifically, this is what I've been using lately:

    h2xs -AXn Foo-Bar -b 5.5.3

    The problem is that this switch was added in early June 2000 , too late for 5.6.0. It has been integrated into the 5.6.1 track.

    Your options are (in no particular order):

    • Get Perl 5.7.0 or an even newer version of the development track
    • Wait for 5.6.1, which should be RSN.
    • Integrate that patch into your version of h2xs
    • Manually delete the "require 5.005_xx", change "use warnings" to "-w", and all `our' vars to `use vars' in every module you create
    • Use the 5.00503 version of h2xs

    -dlc

Re: h2xs question
by chipmunk (Parson) on Dec 11, 2000 at 20:15 UTC
    Even if you fix the issue with h2xs, you'll still have to worry about actual differences between 5.6 and 5.005_03. For example, you may write a script that uses %b in a printf format; that will work on your development server in 5.6, but when you roll it over to your production server it will fail in 5.005_03. (Something very much like that happened to me because a production server had an older version of the DBI module than the development server.)

    Your development environment and your production environment should be as similar as possible, to minimize the likelihood of problems arising only after code is rolled over. Personally, I would recommend using 5.005_03 on your development server as well.