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

RE: Re: Perl Safety

by gaspodethewonderdog (Monk)
on Aug 25, 2000 at 19:22 UTC ( #29636=note: print w/replies, xml ) Need Help??

in reply to Re: Perl Safety
in thread Perl Safety

Well I am having fun... so no need to quit. Anyway, the situation is basically this:

several functions that I call return nothing, instead the implicitly set variables $x,$y,$z.

I am just worried that at some point $x,$y,$z may also at some point include $a which may be something I'm using and need to keep clean myself.

Does Perl provide any clean way to partition myself from other parts of the program?

Replies are listed 'Best First'.
RE (tilly) 3: Perl Safety
by tilly (Archbishop) on Aug 25, 2000 at 21:35 UTC
    Don't call them. Raise a stink. Really.

    In the meantime write wrappers for these functions, in the wrappers call, check the implicit variables, and return them. Then when the code can be fixed, less has to be changed. If you can, localize the variables in your wrapper.

    And "use strict" to be sure you have everything lexically scoped.

    But people like that are a hazard to your code base, nothing more and nothing less.

      Actually I have managed to seperate myself from most of the grubby stuff by putting my routines into their own module(s). I've been pushing my employer pretty hard to let me reimplement a lot of this stuff (even so far as to replace all these hacked database (read flat text files) to real databases), yet right now the reality is I have to deal with all the corporate overhead... beauracracy and all... I've had implied to me that fixing these things would be a bad idea (lots of reimplementation???) but more than likely it is somebody wanting to be lazy.

      For now I'm just trying to get one thing fixed at a time... however there is no reason to *not* be paranoid. I have had a few too many problems in the last year with people changing code bases under me without warning to not be worried and as such raise it as a concern.

      Having people rely on your code and when it breaks not knowing where the problem is just stinks. Especially when you had nothing to do with the breaking.

RE: RE: Re: Perl Safety
by merlyn (Sage) on Aug 25, 2000 at 19:24 UTC
    Ugh. So you're telling me you've got bad code? No amount of Perl Safety will help you.

    If $x and $y and $z are in their package, you're safe. If you're telling me you're not using packages, quit, no matter how much fun it is. {grin}

    -- Randal L. Schwartz, Perl hacker

      Hrmmm... well the engineer actually put everything in a package, but for some reason has no idea about returning hashes or *something*...

      Actually what scares me mostly about this guy is that he claims he writes faster code in Perl than in C. So either he is a Perl god (which I think I can rule out already) or he is an even worse programmer in C than in Perl.

      Anyway, thanks for the suggestions... I'll just make sure to change my variables over to 'my' and protect myself as best I can.

      Maybe I'll just continue to bug my boss to let me take over this guy's project anyway. Any time I ask him to do something it doesn't get done until it's convenient for *him*... and then it's all 'huzzah I've implemented this amazing feature that I *just* realized our group needed' :P

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://29636]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2023-01-30 10:26 GMT
Find Nodes?
    Voting Booth?

    No recent polls found