Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

RE: RE: RE: Re: Perl Safety

by gaspodethewonderdog (Monk)
on Aug 25, 2000 at 23:45 UTC ( [id://29717]=note: print w/replies, xml ) Need Help??


in reply to RE: RE: Re: Perl Safety
in thread Perl Safety

Well... I am getting at his module via:
use Package Package::get_data();
yet mysteriously in my code after I call Package::get_data() all of a sudden I have variables $x, $y, $z that are defined... now I would have expected theses variables to be Package::x Package::y Package::z, but there they are. I asked the engineer about this and he said that there wasn't any other way to pass multiple variables back through a return... when I suggested a hash he was particularly receptive to the idea...

Replies are listed 'Best First'.
RE: RE: RE: RE: Re: Perl Safety
by Adam (Vicar) on Aug 25, 2000 at 23:56 UTC
    untested psuedo-code
    use strict; # To make sure you use the right package names. package My_Wrapper; sub My_get_data { local $x, $y, $z; # I had 'my', but [tilly] is right. # Thats why I said, "I think." here. get_data( @_ ); return ( $x, $y, $z ); } package My_main my ( $x, $y, $z ) = My_Wrapper::My_get_data;
    That's a stab in the dark. I'm tired and I don't feel like taking the time to construct your situation for testing. But I think that is the direction to go. My_Wrapper will collect ugly globals, but they shouldn't propogate to My_main.
      thanks Adam, I'll play around with that and local and see if I can't beat something into submission... it certainly isn't a very attractive way to do it, but if it works I guess I can't complain too much...
      That has to be a local, the my is not visible to get_data. (Which is kinda the idea...) Possible gotcha. He may assume that some globals are set later.

      BTW if you will have to work with this kind of idiocy and cannot get relief, I suggest finding a more congenial workplace. They may take finding, but they do exist...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-26 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found