Yup.

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of [EMAIL PROTECTED]
> Sent: Tuesday, July 26, 2005 6:10 AM
> To: Siebe Tolsma
> Cc: [email protected]
> Subject: references of sub and params in a threads::shared variable
> 
> 
> how do i use this hash as a shared variable to be used in 
> threads? eg. with threads::shared
> 
> -Jeremy A
> 
> > Why not make it a hash?
> > 
> > my $sub = { ref => \&test, params => [$sockethandle] }; 
> > $sub->{ref}->(@{$sub->{params}});
> > 
> > sub test {
> > my $socket = shift;
> > # ...
> > }
> > 
> > 
> > > hello again,
> > >
> > > > > hello all,
> > > > >
> > > > > here is a ref/deref problem
> > > > >
> > > > > I need to take a socket handle, convert it to a 
> socket ref, then 
> > > > > a
> > scaler
> > > > > string
> > > > >
> > > > > A bit later in the same script, I need to take that scaler 
> > > > > string and
> > turn
> > > > it
> > > > > back to a socket ref, and deref it back to the socket handle.
> > > >
> > > > Maybe instead of asking for the way to implement your solution, 
> > > > you
> > should
> > > > describe the complete problem and see if we can come up with an
> > alternate
> > > > solution that is a little less convoluted.  :)
> > >
> > > let me clarify my problem.
> > >
> > > I have a reference of a subroutine.
> > >
> > > eg.
> > >
> > > $sub = "test";
> > >
> > > ..deref and execute
> > >
> > > &$sub;
> > >
> > > ...
> > >
> > > sub test {
> > > my ($sockethandle,$blah...) = @_;
> > > ..do something
> > > }
> > > ........
> > >
> > > in order to pass the paramenters, i decided to do this :
> > >
> > > sub main {
> > >
> > > my $sub = "test|$sockethandle";
> > > ($sub,@_) = split(/\|/,$sub);
> > >
> > > $⊂
> > > }
> > >
> > >
> > > if this is to work correctly, I need to take a socket handle, 
> > > convert it
> > to a
> > > socket ref, then a scaler, so i can pass it as a 
> parameter. in order 
> > > to
> > use the
> > > socket later, i have to take the scaler, convert it to the socket 
> > > ref,
> > then
> > > dereference it.
> > >
> > > Is there an easier way to pass parameters with a subroutine 
> > > reference?
> > >
> > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > Perl-Win32-Users mailing list 
> > > [email protected]
> > > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> > >
> > 
> > 
> > _______________________________________________
> > Perl-Win32-Users mailing list 
> > [email protected]
> > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> > 
> 
> 
> 
> 
> _______________________________________________
> Perl-Win32-Users mailing list 
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to