[28934] in Perl-Users-Digest
Perl-Users Digest, Issue: 178 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 27 16:10:15 2007
Date: Tue, 27 Feb 2007 13:09:18 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 27 Feb 2007 Volume: 11 Number: 178
Today's topics:
Choosing the path based on the system "uname" command <doni.sekar@gmail.com>
Re: Choosing the path based on the system "uname" comma <mritty@gmail.com>
Re: Choosing the path based on the system "uname" comma <glex_no-spam@qwest-spam-no.invalid>
Disable warnings from specific module snunes@gmail.com
Re: Disable warnings from specific module <mritty@gmail.com>
Re: Disable warnings from specific module <mark.clementsREMOVETHIS@wanadoo.fr>
Re: DocumentHTML ? <1usa@llenroc.ude.invalid>
Re: DocumentHTML ? <g_m@remove-comcast.net>
Re: DocumentHTML ? <g_m@remove-comcast.net>
Re: DocumentHTML ? <1usa@llenroc.ude.invalid>
Re: DocumentHTML ? <1usa@llenroc.ude.invalid>
Re: DocumentHTML ? <g_m@remove-comcast.net>
LWP:Authen:NTLM <rthompson414@gmail.com>
Re: LWP:Authen:NTLM <greg.ferguson@icrossing.com>
Re: Perl threads - capturing value returned from sub <zentara@highstream.net>
Re: Perl threads - capturing value returned from sub <ecarlson@vmware.com>
Re: Unable to install Math::BigInt::GMP on Solaris 10 sumitbee@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Feb 2007 11:49:52 -0800
From: "doni" <doni.sekar@gmail.com>
Subject: Choosing the path based on the system "uname" command
Message-Id: <1172605792.439489.82310@h3g2000cwc.googlegroups.com>
Hi,
I want to write a program that does check the appropriate system path
for perl in FreeBSD and Linux.
The path where I have it in FreeBSD is
#! /usr/local/bin/perl
and the path where it is in Linux is
#! /usr/bin/perl
I wanted the program to check for the uname of the system and choose
the appropriate path. Can anyone tell me how can I have my program
check this.
This is how I wrote the program but it doesnt work.
#! /usr/local/bin/perl
use strict;
use warnings;
if (system("uname") eq "Linux") {
#! /usr/bin/perl
}
< rest of the code >
Thanks,
doni
------------------------------
Date: 27 Feb 2007 12:01:46 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Choosing the path based on the system "uname" command
Message-Id: <1172606506.464382.10580@m58g2000cwm.googlegroups.com>
On Feb 27, 2:49 pm, "doni" <doni.se...@gmail.com> wrote:
> Hi,
>
> I want to write a program that does check the appropriate system path
> for perl in FreeBSD and Linux.
>
> The path where I have it in FreeBSD is
> #! /usr/local/bin/perl
>
> and the path where it is in Linux is
> #! /usr/bin/perl
>
> I wanted the program to check for the uname of the system and choose
> the appropriate path. Can anyone tell me how can I have my program
> check this.
>
> This is how I wrote the program but it doesnt work.
>
> #! /usr/local/bin/perl
>
> use strict;
> use warnings;
>
> if (system("uname") eq "Linux") {
What do you think that does?
Please read the documentation for the function you're using
perldoc -f system
perldoc -q system
> #! /usr/bin/perl
That's a comment, and nothing more. The #! syntax means nothing
unless it's the first two characters of the file.
You probably meant to do an exec()
perldoc -f exec
And to avoid an infinite loop, you'll need to make sure you're not
already executing the version you meant to. I think you'll need both
the $0 and $^X variables. You can read about them in:
perldoc perlvar
In fact, you could probably get rid of the call to uname entirely, by
using the $^0 variable, also documented in that perldoc.
Hope that helps,
Paul Lalli
------------------------------
Date: Tue, 27 Feb 2007 14:37:29 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Choosing the path based on the system "uname" command
Message-Id: <45e49693$0$700$815e3792@news.qwest.net>
doni wrote:
> Hi,
>
> I want to write a program that does check the appropriate system path
> for perl in FreeBSD and Linux.
>
> The path where I have it in FreeBSD is
> #! /usr/local/bin/perl
>
> and the path where it is in Linux is
> #! /usr/bin/perl
>
> I wanted the program to check for the uname of the system and choose
> the appropriate path. Can anyone tell me how can I have my program
> check this.
Easier to use a symlink or on your Freebsd box (it's probably on your
Linux box also), run 'use.perl port', then /usr/bin/perl will work
on both.
------------------------------
Date: 27 Feb 2007 08:38:30 -0800
From: snunes@gmail.com
Subject: Disable warnings from specific module
Message-Id: <1172594310.210137.327150@8g2000cwh.googlegroups.com>
Hi,
I'm using a module with a couple of experimental features (SOAP::Lite)
and, every time these features are used, a warning message is
outputted. I would like to know how can I simply disable these outputs
while keeping warnings for my code?
use strict;
use warnings;
use SOAP::Lite;
[=2E..]
Thanks in advance,
S=E9rgio Nunes
------------------------------
Date: 27 Feb 2007 11:52:25 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Disable warnings from specific module
Message-Id: <1172605944.950847.129230@z35g2000cwz.googlegroups.com>
On Feb 27, 11:38 am, snu...@gmail.com wrote:
> I'm using a module with a couple of experimental features
> (SOAP::Lite) and, every time these features are used, a warning
> message is outputted. I would like to know how can I simply
> disable these outputs while keeping warnings for my code?
You could try wrapping a call to any of those experimental features in
a block in which $SIG{__WARN__} has been changed to ignore warnings.
Or you could try locally setting $^W to 0 in a block around those
features (though I don't think that would handle the case where the
module's code is specifically generating a warning using the warn()
function).
{
local $SIG{__WARN__} = sub { 1 };
do_something_experimental();
}
Hope that helps,
Paul Lalli
------------------------------
Date: Tue, 27 Feb 2007 21:36:15 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Disable warnings from specific module
Message-Id: <45e49640$0$25950$ba4acef3@news.orange.fr>
snunes@gmail.com wrote:
> Hi,
>
> I'm using a module with a couple of experimental features (SOAP::Lite)
> and, every time these features are used, a warning message is
> outputted. I would like to know how can I simply disable these outputs
> while keeping warnings for my code?
>
> use strict;
> use warnings;
>
> use SOAP::Lite;
>
I would have expected this to have worked:
mark@owl:~$ cat AA.pm
package AA;
use strict;
use warnings;
sub testsub {
my $test;
print "$test\n";
}
1;
mark@owl:~$ cat testaa.pl
use strict;
use warnings;
use AA;
{
package AA;
use warnings::register;
}
no warnings q(AA);
AA::testsub();
mark@owl:~$ perl testaa.pl
Use of uninitialized value in concatenation (.) or string at AA.pm line 8.
but it doesn't surpress the warning message, although adding
use warnings::register;
to AA.pm has the desired effect.
Mark
------------------------------
Date: Tue, 27 Feb 2007 15:43:29 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: DocumentHTML ?
Message-Id: <Xns98E46D1FA9AFFasu1cornelledu@127.0.0.1>
"~greg" <g_m@remove-comcast.net> wrote in
news:o-KdnS_QLYiwMH7YnZ2dnUVZ_qOpnZ2d@comcast.com:
>
> "A. Sinan Unur" > wrote ...
>> "~greg" > wrote ...
>>> ...
>>> Any hints, please?
>>
>> Well, the first one would to use
>>
>> http://search.cpan.org/~abeltje/Win32-IE-Mechanize-0.009_17/
>>
>> I have successfully used that module to do some really complicated
>> automated downloading of about 10 GB of HTML from various web sites
>> (sorry can't be more specific).
>>
>> Note the comment at
>>
>> http://search.cpan.org/~abeltje/Win32-IE-Mechanize-0.009_
17/lib/Win32/
>> IE/Mechanize.pm#%24ie-%3Econtent
>>
>>> use strict;
>>
>> use warnings; # do not leave it out.
>
Repeat:
Do not leave
use strict;
use warnings;
out in your source code (whatever peculiar development environment you
might have).
> But what I am really trying to do is to add value to my regular
> browser (i.e, IE), --without having to write COM plug-ins
> (or whatever they're called these days.)
>
> I don't know what you mean by "the comment" at the link
> to cpan's Win32::IE::Mechanize,
Well, if you had followed the link, you would have seen:
$ie->content
Fetch the outerHTML from the $ie->Document->documentElement.
I have found no way to get to the exact contents of the document. This
is basically the interpretation of IE of what the HTML looks like and
beware all tags are upcased :(
> but the DESCRIPTION of its current state is not at all encouraging
> (---"Don't expect it to be like the mech in that the class is not
> derived from the user-agent class (like LWP). WARNING: This is a work
> in progress ... ")
>
> and the CAVEATS (---"...This means that you may need
> to set your security settings to a low and possibly unsafe level.
> ...")
>
> sounds down right dire to me.
Note the *may*. I have never needed to tinker with any security settings
and I have used the module for quite complicated tasks where the sites
were so dependent on IE that no other solution would have worked.
You are free not to take advice and try to re-invent the wheel. I am not
likely to waste my time helping you do that.
> (Part of what I mean by adding value to IE is ADDING security, not
> subtracting it!)
One can choose to use CPAN modules and contribute improvements as one
comes up with them. IMHO, that is both more productive and more useful
to everyone.
> But of course I use warnings!
I can only see what you chose to show.
<SNIP>
All this stuff about your configuration and not one comment about
whether the solution I posted worked for you or not (a solution which I
copied straight from Win32::IE::Mechanize). I will now bid you farewell.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Tue, 27 Feb 2007 13:48:07 -0500
From: "~greg" <g_m@remove-comcast.net>
Subject: Re: DocumentHTML ?
Message-Id: <g--dnSqFTul-4XnYnZ2dnUVZ_oannZ2d@comcast.com>
Sinan, and Joe,
I am very sorry about this. And I beg your forgiveness.
And I most profusely apologize to you both.
A couple of days ago I had posted here asking about
"Automating Internet Explorer".
My question was about OLE,
And I got one response that simply ignored my question
and told me to use Mechanize instead.
Gentlemen, I am old.
It seemed to me the same thing was happening again here.
When I saw that Mr Unur was telling me to use
Win32-IE-Mechanize instead, - I started dimming out.
When next I saw him telling me to "use warnings",
I started blanking out.
And when, finally, I saw that he'd added "use warnings" to my original code
-- but ---it seemed to me, when I skimmed over it, with these old eyes,
--- nothing else ..!..
Gentlemen, I'm old.
I glanced over the rest of the script and didn't notice
that any other changes had been made than the addition
of "use warnings".
I thought Mr Unur had "middle-posted" and left,
after telling me to use warnings.
~~
Also,
I am not a professional.
I write maybe 3 or 4 small scripts a day, purely for my own needs.
It would never have occurred to me that explicit "use strict"
and "use warnings" is a courtesy to others.
I will do it from now on.
~~~
Again, I am very sorry about all of this.
I do understand, now, finally, how you reacted to me.
Very much the same way that I had mistakenly initially reacted to you.
But you didn't know that. You didn't know how or why I had reacted
the way I did. And I didn't know that you didn't know.
So your reaction to me came as a complete surprise to me.
I think perhaps such total mis-communication
has occured before on usenet. If so it would explain a lot.
Anyway, thank you both again.
$IEWindow->Document->documentElement->{outerHTML};
is ideed exactly what I was asking for. It works.
(How ever did you find it?)
And I will remember to include the explicit "use strct" and "use warnings"
from now on.
Thank you!
Greg.
"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message news:Xns98E46D1FA9AFFasu1cornelledu@127.0.0.1...
> "~greg" <g_m@remove-comcast.net> wrote in
> news:o-KdnS_QLYiwMH7YnZ2dnUVZ_qOpnZ2d@comcast.com:
>
>>
>> "A. Sinan Unur" > wrote ...
>>> "~greg" > wrote ...
>>>> ...
>>>> Any hints, please?
>>>
>>> Well, the first one would to use
>>>
>>> http://search.cpan.org/~abeltje/Win32-IE-Mechanize-0.009_17/
>>>
>>> I have successfully used that module to do some really complicated
>>> automated downloading of about 10 GB of HTML from various web sites
>>> (sorry can't be more specific).
>>>
>>> Note the comment at
>>>
>>> http://search.cpan.org/~abeltje/Win32-IE-Mechanize-0.009_
> 17/lib/Win32/
>>> IE/Mechanize.pm#%24ie-%3Econtent
>>>
>>>> use strict;
>>>
>>> use warnings; # do not leave it out.
>>
>
> Repeat:
>
> Do not leave
>
> use strict;
> use warnings;
>
> out in your source code (whatever peculiar development environment you
> might have).
>
>> But what I am really trying to do is to add value to my regular
>> browser (i.e, IE), --without having to write COM plug-ins
>> (or whatever they're called these days.)
>>
>> I don't know what you mean by "the comment" at the link
>> to cpan's Win32::IE::Mechanize,
>
> Well, if you had followed the link, you would have seen:
>
> $ie->content
>
> Fetch the outerHTML from the $ie->Document->documentElement.
>
> I have found no way to get to the exact contents of the document. This
> is basically the interpretation of IE of what the HTML looks like and
> beware all tags are upcased :(
>
>> but the DESCRIPTION of its current state is not at all encouraging
>> (---"Don't expect it to be like the mech in that the class is not
>> derived from the user-agent class (like LWP). WARNING: This is a work
>> in progress ... ")
>>
>> and the CAVEATS (---"...This means that you may need
>> to set your security settings to a low and possibly unsafe level.
>> ...")
>>
>> sounds down right dire to me.
>
> Note the *may*. I have never needed to tinker with any security settings
> and I have used the module for quite complicated tasks where the sites
> were so dependent on IE that no other solution would have worked.
>
> You are free not to take advice and try to re-invent the wheel. I am not
> likely to waste my time helping you do that.
>
>> (Part of what I mean by adding value to IE is ADDING security, not
>> subtracting it!)
>
> One can choose to use CPAN modules and contribute improvements as one
> comes up with them. IMHO, that is both more productive and more useful
> to everyone.
>
>> But of course I use warnings!
>
> I can only see what you chose to show.
>
> <SNIP>
>
> All this stuff about your configuration and not one comment about
> whether the solution I posted worked for you or not (a solution which I
> copied straight from Win32::IE::Mechanize). I will now bid you farewell.
>
> Sinan
> --
> A. Sinan Unur <1usa@llenroc.ude.invalid>
> (remove .invalid and reverse each component for email address)
>
> comp.lang.perl.misc guidelines on the WWW:
> http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
>
------------------------------
Date: Tue, 27 Feb 2007 14:23:28 -0500
From: "~greg" <g_m@remove-comcast.net>
Subject: Re: DocumentHTML ?
Message-Id: <UpWdneWWVeW6GHnYnZ2dnUVZ_q2pnZ2d@comcast.com>
Ah!
Sinan,
It turns out that I was not entirely to blame
for our mis-communciation!
But neither were you!
It's all due to an HTML mistake
on the Win32::IE::Mechanize document page!
Starting with NAME as line 1, the 21st and 22nd lines are:
CONTENT-HANDLING METHODS
$ie->content
which I know now is what you meant.
They are both coded as links to internal anchors,
and the first one
http://search.cpan.org/~abeltje/Win32-IE-Mechanize-0.009_17/lib/Win32/IE/Mechanize.pm#CONTENT-HANDLING_METHODS
works. That is to say, it links to an existing internal anchor.
But the second one -- the one you gave me --
http://search.cpan.org/~abeltje/Win32-IE-Mechanize-0.009_17/lib/Win32/IE/Mechanize.pm#%24ie-%3Econtent
is broken!
You can search the source code for "24ie-%3Econtent"
and you don't find it anywhere else!
The effect was that when I clicked on the link you gave me,
it just opened the whole document at the top!
So I had no idea what "comment" you were specifically
trying to direct me to. And I couldn't possibly guess
what you meant.
Neither your fault nor mine!
~greg.
------------------------------
Date: Tue, 27 Feb 2007 19:50:24 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: DocumentHTML ?
Message-Id: <Xns98E496F5884E8asu1cornelledu@127.0.0.1>
"~greg" <g_m@remove-comcast.net> wrote in
news:UpWdneWWVeW6GHnYnZ2dnUVZ_q2pnZ2d@comcast.com:
> But the second one -- the one you gave me --
> http://search.cpan.org/~abeltje/Win32-IE-Mechanize-0.009_17/lib/Win32/IE/Mechanize.pm#%24ie-%3Econtent
>
> is broken!
> You can search the source code for "24ie-%3Econtent"
> and you don't find it anywhere else!
Well, more than likely, it is your browser or newsreader that is broken.
%24 is the URL encoded version of $ and and %3E is the URL encoded version
of #. So, the link above is the same as:
http://search.cpan.org/~abeltje/Win32-IE-Mechanize-0.009_17/lib/Win32/IE/Mechanize.pm#$ie->content
but with the unsafe characters replaced with safe URL encodings.
> Neither your fault nor mine!
True.
Sinan
------------------------------
Date: Tue, 27 Feb 2007 20:07:08 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: DocumentHTML ?
Message-Id: <Xns98E499CBBC273asu1cornelledu@127.0.0.1>
"~greg" <g_m@remove-comcast.net> wrote in
news:g--dnSqFTul-4XnYnZ2dnUVZ_oannZ2d@comcast.com:
> When I saw that Mr Unur was telling me to use
> Win32-IE-Mechanize instead, - I started dimming out.
>
> When next I saw him telling me to "use warnings",
> I started blanking out.
>
> And when, finally, I saw that he'd added "use warnings" to my
> original code -- but ---it seemed to me, when I skimmed over it, with
> these old eyes, --- nothing else ..!..
>
> Gentlemen, I'm old.
>
> I glanced over the rest of the script and didn't notice
> that any other changes had been made than the addition
> of "use warnings".
>
> I thought Mr Unur had "middle-posted" and left,
> after telling me to use warnings.
As I wrote that message, I replaced your script with the copy-pasted
version of my script but gave no indication of the fact that I had changed
a single line in it.
That's my fault.
> $IEWindow->Document->documentElement->{outerHTML};
> is ideed exactly what I was asking for. It works.
> (How ever did you find it?)
I wondered how Win32::IE::Mechanize did it and looked at its source code.
Microsoft has documentation on Internet.Application at msdn.microsoft.com.
The whole thing is really messy and I am not sure if you will able to do
better than Win32::IE::Mechanize (and if you are, I am sure we would all
appreciate your contributions).
On the other hand, that module helped me achieve a lot recently despite all
the warnings on CPAN. I am more worried about modules that don't tell me
their shortcomings up front.
Sinan
------------------------------
Date: Tue, 27 Feb 2007 15:32:25 -0500
From: "~greg" <g_m@remove-comcast.net>
Subject: Re: DocumentHTML ?
Message-Id: <r56dnYgh1qrACHnYnZ2dnUVZ_u6rnZ2d@comcast.com>
> Well, more than likely, it is your browser or newsreader that is broken.
Microsoft Outlook Express - broken ?? --Impossible!
;)
But seriously, ...
your:
> http://search.cpan.org/~abeltje/Win32-IE-Mechanize-0.009_17/lib/Win32/IE/Mechanize.pm#$ie->content
does work.
And I think I understand what's going on now.
~~
When we used the context menu to "Copy Shortcut",
we both got the URL Encoding: #%24ie-%3Econtent
of both the '$' and the '>'.
However, in the HTML source,
the link and the anchor that it's supposed to point to
are, instead:
<li class='indexItem indexItem2'><a href='#%24ie-%3Econtent'>$ie->content</a>
and
<h2><a class='u' href='#___top' title='click to go to top of document'
name="$ie->content"
>$ie->content</a></h2>
respectively.
That is to say, in the href of the link
both the '$' and '>' are URL-encoded .
However, both in the display of the link,
and in the name of the target anchor,
the '$' is not encoded at all,
and the '>' is encoded rather as an HTLM entity!
'$' is safe (I beleive) and so needn't be encoded at all.
'>', on the other hand, has to be encoded,
in the HTML of course, and I think also as url,
And either the URL-encoding or the HTML-entity encoding would be fine.
It's the using of the one way in the href of the link,
and the other way in the name of the target of the link,
that breaks the connection!
>> Neither your fault nor mine!
>
> True.
>
Ditto.
~greg
------------------------------
Date: 27 Feb 2007 07:29:42 -0800
From: "Ron T." <rthompson414@gmail.com>
Subject: LWP:Authen:NTLM
Message-Id: <1172590182.825059.14190@h3g2000cwc.googlegroups.com>
I've been looking up on how to use this module, following all the
documentation and cookbooks related to it, and I'm not really sure why
I can't get through. The credentials() function is vaguely described
and I can't really find much info on this.
Is there an alternative to accessing protected files that make use of
Microsoft's NTLM using Perl? I've been looking around awhile to no
avail. If you know something I don't, I'd appreciate the tips!
Ron Thompson
------------------------------
Date: 27 Feb 2007 12:27:15 -0800
From: "gf" <greg.ferguson@icrossing.com>
Subject: Re: LWP:Authen:NTLM
Message-Id: <1172608035.484625.292120@j27g2000cwj.googlegroups.com>
On Feb 27, 8:29 am, "Ron T." <rthompson...@gmail.com> wrote:
> I've been looking up on how to use this module, following all the
> documentation and cookbooks related to it, and I'm not really sure why
> I can't get through. The credentials() function is vaguely described
> and I can't really find much info on this.
>
> Is there an alternative to accessing protected files that make use of
> Microsoft's NTLM using Perl? I've been looking around awhile to no
> avail. If you know something I don't, I'd appreciate the tips!
I tried to get it to work too, and gave up.
I ended up using curl to handle the authentication and to move the
data into Perl. Then I could massage it and send it back using curl.
http://en.wikipedia.org/wiki/CURL
------------------------------
Date: Tue, 27 Feb 2007 10:21:06 -0500
From: zentara <zentara@highstream.net>
Subject: Re: Perl threads - capturing value returned from sub
Message-Id: <8ri8u29jr7ombhtptiu1k5l616tjl3k0fl@4ax.com>
On 26 Feb 2007 17:24:40 -0800, "Eric" <ecarlson@vmware.com> wrote:
>
>Cancel this one; I found the answer, which was to just assign a
>variable to the join:
>
>my $result = $t->join;
>
>Seems like I always have a breakthrough immediately after I post to
>this site! :)
>
>Eric
Just to amplify slightly, you can return arrays too.
#!/usr/bin/perl
use warnings;
use strict;
use threads;
use threads::shared;
# join() does three things: it waits for a thread to exit,
# cleans up after it, and returns any data the thread may
# have produced.
my $thr = threads->new(\&sub1);
my $return = $thr->join;
print "Thread returned @$return\n";
#hold for key input
<>;
##########################################################
sub sub1 {
my @values = ('1',2, 'ten');
print "@values\n";
while(1){sleep 1}
return \@values;
}
__END__
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: 27 Feb 2007 08:12:38 -0800
From: "Eric" <ecarlson@vmware.com>
Subject: Re: Perl threads - capturing value returned from sub
Message-Id: <1172592758.194589.129010@h3g2000cwc.googlegroups.com>
On Feb 27, 7:21 am, zentara <zent...@highstream.net> wrote:
> On 26 Feb 2007 17:24:40 -0800, "Eric" <ecarl...@vmware.com> wrote:
>
>
>
> >Cancel this one; I found the answer, which was to just assign a
> >variable to the join:
>
> >my $result = $t->join;
>
> >Seems like I always have a breakthrough immediately after I post to
> >this site! :)
>
> >Eric
>
> Just to amplify slightly, you can return arrays too.
> #!/usr/bin/perl
> use warnings;
> use strict;
> use threads;
> use threads::shared;
>
> # join() does three things: it waits for a thread to exit,
> # cleans up after it, and returns any data the thread may
> # have produced.
>
> my $thr = threads->new(\&sub1);
>
> my $return = $thr->join;
>
> print "Thread returned @$return\n";
>
> #hold for key input
> <>;
> ##########################################################
> sub sub1 {
> my @values = ('1',2, 'ten');
> print "@values\n";
>
> while(1){sleep 1}
>
> return \@values;
>
> }
>
> __END__
>
> --
> I'm not really a human, but I play one on earth.http://zentara.net/japh.html
Thanks - this is useful information.
Eric
------------------------------
Date: 27 Feb 2007 10:01:44 -0800
From: sumitbee@gmail.com
Subject: Re: Unable to install Math::BigInt::GMP on Solaris 10
Message-Id: <1172599304.019353.289750@q2g2000cwa.googlegroups.com>
On Feb 24, 10:04 am, sumit...@gmail.com wrote:
> On Feb 22, 10:19 pm, "Sisyphus" <sisyph...@nomail.afraid.com> wrote:
>
>
>
>
>
> > <sumit...@gmail.com> wrote in message
>
> >news:1172178117.033755.326430@s48g2000cws.googlegroups.com...
> > .
> > .
>
> > > JP, thanks for the update. I installed gmp-4.1.2, changed the
> > > LD_LIBRARY_PATH_64 and made sure the libgmp files were in /usr/local/
> > > lib/sparcv9, but same problem.....
>
> > Try hacking at the XS file. Where it says:
>
> > #include "gmp.h"
>
> > Change that to:
>
> > #include "/usr/local/include/sparcv9/gmp.h" // if that's where gmp.h is
> > located
>
> > That should at least allow gmp.h to get found. Then it's just a matter of
> > making libgmp.a (or the gmp .so) findable.
>
> > Probably the simplest way to build it is to do it manually. Download the
> > M:::BI::GMP-1.19 source from CPAN, extract to some location, cd to that
> > location and run:
>
> > perl Makefile.PL INC="-I/usr/local/include/sparcv9"
> > LIBS="-L/usr/local/lib/sparcv9 -lgmp"
> > make test
> > make install
>
> > If you don't have a 'libgmp.a' then you should be able to link directly to
> > the libgmp-3.so (or whatever it's called) but you would need to change the
> > above command to properly reflect the name of the gmp .so file. Something
> > like:
>
> > perl Makefile.PL INC="-I/usr/local/include/sparcv9"
> > LIBS="-L/usr/local/lib/sparcv9 -lgmp-3"
>
> > All of this is, of course, untested.
>
> > Is there something there that works for you ? (You should at least be able
> > to eradicate the error about gmp.h being not found - assuming it really is
> > in /usr/local/include/sparcv9.)
>
> > Cheers,
> > Rob
>
> Rob, thanks. I'll try it out on Monday and let you know.
>
> Cheers,
> Sumit- Hide quoted text -
>
> - Show quoted text -
Rob,
Changing the include to the full path to gmp.h in the xs file and
creating the makefile with the INC and LIB options as you suggested
worked. I am still getting errors on "make test" but thats a different
issue. Thanks a lot for your help!
Thanks to all others that replied as well.
Sumit
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 178
**************************************