Re: references - inject sub/params into longterm running thread

2005-07-25 Thread $Bill Luebkert
[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

RE: references - inject sub/params into longterm running thread

2005-07-25 Thread John Serink
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

RE: references - inject sub/params into longterm running thread

2005-07-25 Thread mailware
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

RE: references of sub and params in a threads::shared variable

2005-07-25 Thread John Serink
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

RE: references

2005-07-25 Thread John Serink
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

Re: references

2005-07-25 Thread $Bill Luebkert
[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

references of sub and params in a threads::shared variable

2005-07-25 Thread mailware
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,

Re: references

2005-07-25 Thread Siebe Tolsma
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 >

references situation

2005-07-25 Thread mailware
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

Re: references

2005-07-25 Thread mailware
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

Memory leaks (TK binding and references)

2003-06-18 Thread Andrew Mueller
> > > > > > 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

Re: working with array references.

2002-10-14 Thread csaba . raduly
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

Re: working with array references.

2002-10-13 Thread $Bill Luebkert
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

Re: working with array references.

2002-10-13 Thread Tim . Moose
This will do it push @{$hash{$key}}, $item; Tim ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

working with array references.

2002-10-13 Thread Torbjørn Lindahl
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}

Re: reference to an array of array-references : Doubt

2002-07-28 Thread Carl Jolley
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. > > >

RE: Revised: Symbolic References & "use strict;"

2001-06-07 Thread Nikhil . Kaul
" } 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

Re: Code references

2001-05-23 Thread Philip Newton
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

Re: Code references

2001-05-23 Thread Philip Newton
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

RE: Code references

2001-05-23 Thread Lee Goddard
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... > > >

RE: Code references

2001-05-23 Thread Lee Goddard
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

Re: Code references

2001-05-23 Thread Philip Newton
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

Re: Code references

2001-05-23 Thread Philip Newton
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

RE: Code references

2001-05-22 Thread Lee Goddard
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

Re: Code references

2001-05-22 Thread Carl Jolley
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

RE: Code references

2001-05-22 Thread Rubinow, Larry
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

RE: Code references

2001-05-22 Thread Lee Goddard
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

RE: Code references

2001-05-22 Thread Rubinow, Larry
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

Re: List References

2001-03-29 Thread Dirk Bremer
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:

Re: Passing references to subroutines in other packages

2001-01-02 Thread Carl Jolley
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