[EMAIL PROTECTED] wrote:
> hi there
>
> basically...I have instantiated long term running thread/s.
>
> in the main thread, i want to pass a subroutine (code ref) and its parameters
> into a threads::shared variable, then execute it in a separate thread running
> in a while loop.
>
> I want t
Cc: John Serink
> Subject: RE: references - inject sub/params into longterm
> running thread
>
>
> hi there
>
> basically...I have instantiated long term running thread/s.
>
> in the main thread, i want to pass a subroutine (code ref)
> and its parameters
> into a th
g the code into a
running thread is what i would like.
I hope you all now can understand. Thanks in advance for your help.
Regards,
- Jeremy A.
Quoting John Serink <[EMAIL PROTECTED]>:
> Why don't you pass the parameters as references.
> They work like pointers in C k
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: perl-win32-users@listserv.ActiveState.com
> Subject: references of sub and par
Why don't you pass the parameters as references.
They work like pointers in C kindof.
Why do you want to reference your subroutine?
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of [EMAIL PROTECTED]
> Sent: Tuesday, J
[EMAIL PROTECTED] wrote:
> hello again,
>
> let me clarify my problem.
>
> I have a reference of a subroutine.
>
> eg.
>
> $sub = "test";
Better expressed like this:
my $subref = \&test;
> ..deref and execute
>
> &$sub;
>
> ...
>
> sub test {
> my ($sockethandle,$blah...) = @_;
> ..do so
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,
Cc:
Sent: Monday, July 25, 2005 8:19 PM
Subject: Re: references
> 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
>
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
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
>
> >
> > > Hello,
> > >
> > > I've been experimenting for a couple of hours now with fixing the
> > > memory leaks in my program. I have been using the subroutine
> > >
> > > sub DESTROY {
> > >
> > > print (&q
On 13/10/2002 01:30:18 perl-win32-users-admin wrote:
>Hi list,
>
>given an array reference in a hash, how can I append an item to the end of
>that array? Or find the length so that I can assign it using $ref-[$n]
>type notation?
>
>I have tried various comboes...
>
>$hash{$key} holds a reference
Torbjørn Lindahl wrote:
> Hi list,
>
> given an array reference in a hash, how can I append an item to the end of
> that array? Or find the length so that I can assign it using $ref-[$n]
> type notation?
>
> I have tried various comboes...
>
> $hash{$key} holds a reference to an array in the sa
This will do it
push @{$hash{$key}}, $item;
Tim
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Hi list,
given an array reference in a hash, how can I append an item to the end of
that array? Or find the length so that I can assign it using $ref-[$n]
type notation?
I have tried various comboes...
$hash{$key} holds a reference to an array in the sample code presented.
*) push(@$hash{$key}
On Fri, 26 Jul 2002 [EMAIL PROTECTED] wrote:
> Dear All,
> This is the Data structure that i am using it. I am facing some
>serious problem with the reference to an array of array-references.
> Please help me to solve this problem.
>
>
>
"
}
print ${$one}; # blows up
HTH,
Nikhil.
-Original Message-
From: Andy td [mailto:[EMAIL PROTECTED]]
Sent: 05 June 2001 22:03
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Revised: Symbolic References & "use strict;"
Hi!
I'm writing a program that use
Lee Goddard wrote:
> From: Philip Newton [mailto:[EMAIL PROTECTED]]
>
> > Symbolic references are ick. Avoid. They often indicate a
> > problem in your design.
>
> Not my design - Sean Burke's MIDI::* packages, specifically
> &MIDI::Simple::synch.
I
Lee Goddard wrote:
> From: Philip Newton [mailto:[EMAIL PROTECTED]]
> > Rubinow, Larry wrote:
> > > Finally, a legitimate case for symbolic references?
> >
> > I doubt it. Having names like this for subroutines sounds
> > strange enough; they're not very
From: Philip Newton [mailto:[EMAIL PROTECTED]]
> Lee Goddard wrote:
> > I have defined sub a1, sub a2, and sub a3.
> > I need to push to an array references to these.
> > Is there a way I can do this programmatically?
> >
> > Sortalike...
> >
>
From: Philip Newton [mailto:[EMAIL PROTECTED]]
> Rubinow, Larry wrote:
> > Finally, a legitimate case for symbolic references?
>
> I doubt it. Having names like this for subroutines sounds strange enough;
> they're not very descriptive.
Did you really want the full name o
Lee Goddard wrote:
> I have defined sub a1, sub a2, and sub a3.
> I need to push to an array references to these.
> Is there a way I can do this programmatically?
>
> Sortalike...
>
> for (1..3){
> push @myarray, \&a$_;
> }
>
> ...but correc
Rubinow, Larry wrote:
> Finally, a legitimate case for symbolic references?
I doubt it. Having names like this for subroutines sounds strange enough;
they're not very descriptive.
And if they are realy intimately connected in a series, consider storing
references to the sub in an ar
On Tue, 22 May 2001, Lee Goddard wrote:
> I have defined sub a1, sub a2, and sub a3.
> I need to push to an array references to these.
> Is there a way I can do this programmatically?
>
> Sortalike...
>
> for (1..3){
> push @myarray, \&a$_;
> }
>
&g
On Tue, 22 May 2001, Lee Goddard wrote:
> I have defined sub a1, sub a2, and sub a3.
> I need to push to an array references to these.
> Is there a way I can do this programmatically?
>
> Sortalike...
>
> for (1..3){
> push @myarray, \&a$_;
> }
>
> ...b
Lee Goddard wrote:
> Rubinow, Larry wrote:
>
> > Finally, a legitimate case for symbolic references? There
> might be a
> > cleaner syntax, but this should work:
> >
> > sub a1 { print "a1\n" }
> > sub a2 { print "a2\n" }
&g
Rubinow, Larry wrote:
> Finally, a legitimate case for symbolic references? There might be a
> cleaner syntax, but this should work:
>
> sub a1 { print "a1\n" }
> sub a2 { print "a2\n" }
> sub a3 { print "a3\n" }
>
> for( 1..3 ) { $nam
Lee Goddard wrote:
> I have defined sub a1, sub a2, and sub a3.
> I need to push to an array references to these.
> Is there a way I can do this programmatically?
>
> Sortalike...
>
> for (1..3){
> push @myarray, \&a$_;
> }
>
> ...but correct?
Fi
array)
{
foreach my $v2 (don't know what to put here using references)
{
print("$v1->[$v2]\n");
}
}
I am not sure about the format of the print statement.
Dirk Bremer - Systems Programmer II - AMS Department - NISC
636-922-9158 ext. 652 fax 636-447-4471
<mailto:
On Thu, 28 Dec 2000, Ted Mao wrote:
> I have a problem which seems simple, but I haven't found a solution to it
> yet.
>
> Let's say I have two packages, A and B. In a subroutine of package A, I'm
> trying to return a reference to a subroutine in package B. So in package A
> I have:
>
> my $r
30 matches
Mail list logo