From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ukhas
jean
Sent: 22 June 2006 17:05
To: active perl
Subject: problem with new() method of ithreads.
> Hello All,
>
> Well the query i am about to ask may seem amatuerish, but i am asking
it newayz...
> hope u gurus might not mind me asking such a thing ....
>
> I had the following code :-
> use threads;
> $thr = threads->new(\&sub1);
> sub sub1
> {
> print "Inside the thread\n ";
> }
>
> O/p comes:-
> A thread exited while 2 other threads were still running.
>
> I am using Perl 5.8.0 on Win XP.
> Plz note:- The content in the subroutine is not printed. I read it
somewhere that we need to pass the reference > of the subroutine to the
new() method. But on doing so, the print statement in the subroutine is
not getting
> executed.
>
> So i removed the reference and made the statement as:-
> $thr = threads->new(&sub1);
>
> O/p comes:-
> Inside the thread
> A thread exited while 2 other threads were still running.
>
> Here the print statement inside the subroutine sub1 gets executed.
Which of these is the correct syntax??
> But here I am not passing the reference of the subroutine ... Can any
of u masters help me understand this??
> Sorry, if the query is a stupid one, but i really can't make sense of
it.
> Even if someone canguide/advise me to look at any documentation i shld
refer to ... would be great help ...
>
If you add "use diagnostics;", as well as "use strict;" and "use
warnings;" which you should have on all scripts, it will give you more
information about the warning. I also advise reading 'perldoc threads'
'perldoc threads::shared' and 'perldoc perlthrtut' thoroughly.
HTH
--
Brian Raven
=================================
Atos Euronext Market Solutions Disclaimer
=================================
The information contained in this e-mail is confidential and solely for the
intended addressee(s). Unauthorised reproduction, disclosure, modification,
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message do not
necessarily reflect those of Atos Euronext Market Solutions.
L'information contenue dans cet e-mail est confidentielle et uniquement
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee.
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail
vous parvient par erreur, nous vous prions de bien vouloir prevenir
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre
systeme. Le contenu de ce message electronique ne represente pas necessairement
la position ou le point de vue d'Atos Euronext Market Solutions.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs