Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Accessing hash in blessed object

by blue_cowdawg (Monsignor)
on Oct 13, 2014 at 18:23 UTC ( #1103660=note: print w/replies, xml ) Need Help??


in reply to Accessing hash in blessed object

I'm a bit puzzled about what you are doing here, but let me throw this out there and maybe it'll help:

package MyThreadSpool; use Carp; use threads; sub new { shift; croak "Port number required" unless(@_); my $port :shared = shift; my %buffer :shared; my $self = { port => $port, buffer => \%buffer } bless $self,"MyThreadSpool"; return $self }
and in some code coming to a workstation/laptop near you:
#!/usr/bin/perl -w use strict; use MyThreadSpool; my $obj = MyThreadSpool->new(8080,my %buffer); # and so now print $obj->{port}.... etc etc etc
Is this something approximating what you are trying to do?


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; Blog: http://blog.berghold.net Warning: No political correctness allowed.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2020-06-05 04:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (35 votes). Check out past polls.

    Notices?