Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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
Domain Nodelet?
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 romping around the Monastery: (None)
    As of 2021-10-19 00:43 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My first memorable Perl project was:







      Results (76 votes). Check out past polls.

      Notices?