Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

RE: Re: When is my variable not really mine?

by gaspodethewonderdog (Monk)
on Sep 07, 2000 at 17:49 UTC ( [id://31391]=note: print w/replies, xml ) Need Help??


in reply to Re: When is my variable not really mine?
in thread When is my variable not really mine?

Well I'm not playing with references and I'm not passing this variable to anybody else, it is mine and mine alone *muhahahaha*.

I'm starting to worry though that this code isn't being called as I'd expected and is possibly being eval'd into existance or manipulated in some way, because I've been looking more and more into it and it doesn't make sense.

I was hoping that this problem could easily be explained by 'I know too little', but maybe I should be leaning towards 'the guy who wrote this is a code slingin' cowboy'. It isn't the first weird thing I've seen him do *chuckles*

  • Comment on RE: Re: When is my variable not really mine?

Replies are listed 'Best First'.
RE: RE: Re: When is my variable not really mine?
by Fastolfe (Vicar) on Sep 07, 2000 at 17:57 UTC
    I think we need more information. Merlyn is correct in that a 'my' variable cannot be referenced outside of the block, though a reference passed outside certainly can affect the value.

    What I don't understand is how you can know that the value of your variable has changed unless you're doing some execution of code within your block. If you're entering a block with a 'my' variable, leaving that block to execute some other code, and returning to it, the variable is recreated and undefined on the 2nd run. Consider:

    sub a { my $var = 1; &b; # Can't touch $var eval $set_var_to_2; # Code in this variable can affect $var print "$var\n"; }
    If we could see some code we could explain what's going on, probably. Also make sure you're using 'strict'. This will catch lots of problems like this.
      Well as it so happens the engineer decide to do some magic to the code. So what I've written wasn't being run as a script but instead being mutilated by his processes and then eval'd. Yeah! :)

      Anyway, what was basically going on was that he was chucking a bunch of information in the code to 'massage' it how he needed it to work so that variables could then be exported to all sorts of other places.

      Yes this is weird, yes this is definitely not how I'd have even imagined to do it, and yes from now on when I need something fixed in the code I think I'll let him do it and let him have his silly job security.

      At least I can safely know that I'm not loosing my mind and forgetting how to program... phew!

        It sounds like this guy needs to have his head whacked with a large stick. If you're supposed to be writing code to run within that framework, and you weren't handed an interface specification, something is seriously wrong. If this guy gets hit by a truck tomorrow, where's that company (and their code) going to be?

        I'ts my contention if people are doing things *that* evil, with no documentation, then they belong in a research facility, not writing production code. Companies *cannot* afford to be reliant on something like that.

        It's not job security, it is a company being held hostage. Demand better.

        --Chris

        e-mail jcwren

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-26 05:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found