Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Writing for backwards compatibility

by etcshadow (Priest)
on Nov 09, 2005 at 03:20 UTC ( #506973=note: print w/replies, xml ) Need Help??

in reply to Writing for backwards compatibility

Speaking as someone who is (at least currently) tethered to 5.005_03, I've got to speak up for how utterly annoying it is to find modules out there that needlessly use fairly pointless new features (specifically our, but also, to a certain extent use/no warnings).

Don't get me wrong, lexical filehandles and 3-arg open are hugely nice, and I can't really argue with that. But how many modules out there just use our for no reason whatsoever, other than to force perl 5.5ers to have to edit the module before using it?

------------ :Wq Not an editor command: Wq

Replies are listed 'Best First'.
Re^2: Writing for backwards compatibility
by xdg (Monsignor) on Nov 09, 2005 at 11:51 UTC

    I think 'our' is often used to avoid having to type 'use vars', but I recently saw a module on CPAN with a surprisingly obvious way of avoiding it. (strict police may want to avoid reading further.)

    package My::Module; $VERSION = 1.23; @ISA = 'Exporter'; @EXPORT = qw( wibble wobble ); use strict; use warnings; use Exporter; # rest of module ...


    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.

      Also, the third edition of Programming Perl describes the vars pragma as "somewhat deprecated". Current Perl docs don't label it that way...

      Marvin Humphrey
      Rectangular Research ―
Re^2: Writing for backwards compatibility
by mirod (Canon) on Nov 09, 2005 at 09:33 UTC

    When that happens, do you report test failures (using cpantest, provided by Test::Reporter)? If you do, I am pretty sure most authors will gladdly fix the code. Especially if you also include the patch. I am sure most authors do not willingly break compatibility, it just happens, sometimes for good reasons (unicode), sometimes just by habit or oversight.

Re^2: Writing for backwards compatibility
by adrianh (Chancellor) on Nov 09, 2005 at 12:25 UTC
    But how many modules out there just use our for no reason whatsoever, other than to force perl 5.5ers to have to edit the module before using it?

    I don't use our for no reason. I use it because I find it clearer and I have to type less.

    Unfortunately my priorities (typing less) do not match your priorities (working code on 5.005_3) :-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://506973]
[james28909]: im not quite how to explain it any better nick. you evolved from ignorance to intelligence. not the other way. the universe evolves from gas coulds and debris into planets stars and galaxies ect. it doesnt happen any other way. hence it has ....
[james28909]: some kind of logic behind it
[james28909]: and that is also anothe rpoint i made, i think it has to do with perception of the world around you. most people think of evolution on a human scale. why could life evolve on this planet? because this planet evolved in this solar system. and so on.
[holli]: here's something for you to watch, James. I think you will like it
[erix]: for the record: I have not downvoted anyone on that subthread that was my fault
[james28909]: there are all kinds of things that had to happen to let life come to be. but at the same time, life may not be the end goal IF there is any kind of end goal lol
[james28909]: well who is the person who gets to decide which behaviour is worthy of a downvote? a person with their own beliefs? xD
[erix]: teleology -- I've never understood why that was thunk up
[erix]: ( and when teleology was brought up, during my biology-study., I couldn't get an answer either )
[1nickt]: FTR I agree with you about "design." Just not sure about the trajectory of evolution. THere are a lot of dead-ends in the evolutionary paths. I suspect homo sapiens is just one of them.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (15)
As of 2017-12-15 14:35 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (433 votes). Check out past polls.