[30368] in Perl-Users-Digest
Perl-Users Digest, Issue: 1611 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 5 00:09:54 2008
Date: Wed, 4 Jun 2008 21:09:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 4 Jun 2008 Volume: 11 Number: 1611
Today's topics:
Re: eperl help: multi-pass processing <smallpond@juno.com>
Re: How to get the output from an ICQ clent <tvachkov@googlemail.com>
Re: How to get the output from an ICQ clent <tzz@lifelogs.com>
Re: How to get the output from an ICQ clent <tvachkov@googlemail.com>
Re: How to get the output from an ICQ clent <tzz@lifelogs.com>
I try to copy one file to other folder on Linux server, <pero@tupwerwt.ch>
Re: I try to copy one file to other folder on Linux ser <jurgenex@hotmail.com>
Re: I try to copy one file to other folder on Linux ser <noreply@gunnar.cc>
Re: MD5 and SHA1 fingerprint from SSL certificates <m@rtij.nl.invlalid>
Re: OT: SI units (was sorting a hash / 2008-06-01) <smallpond@juno.com>
Re: OT: SI units (was sorting a hash / 2008-06-01) <sean.prawn@gmail.com>
Re: OT: SI units <tzz@lifelogs.com>
Re: OT: SI units <jurgenex@hotmail.com>
Re: OT: SI units <smallpond@juno.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 04 Jun 2008 18:07:59 -0400
From: smallpond <smallpond@juno.com>
Subject: Re: eperl help: multi-pass processing
Message-Id: <bd403$48471252$30126@news.teranews.com>
bukzor wrote:
>
> The problem is that sometimes the
> printout of a variable gets moved to before the assignment of the
> variable (don't ask why).
> Let's assume this can't be helped.
perl (and presumably eperl) have the nasty bug of ascribing meaning
to statement order. Perhaps you should write your code in a
language that doesn't have this limitation.
** Posted from http://www.teranews.com **
------------------------------
Date: Wed, 4 Jun 2008 11:09:03 -0700 (PDT)
From: potrebitel <tvachkov@googlemail.com>
Subject: Re: How to get the output from an ICQ clent
Message-Id: <7501bbbb-099a-46d9-ad0b-4317c03a8fa8@k13g2000hse.googlegroups.com>
On 4 Jun., 16:48, Ted Zlatanov <t...@lifelogs.com> wrote:
> On Wed, 4 Jun 2008 06:35:07 -0700 (PDT) potrebitel <tvach...@googlemail.com> wrote:
>
> p> In my script I want to execute and print out the output from the ysm
> p> ICQ clent after logging in.
> p> I tried this
>
> p> my $pid = open my $readme, "-|", "ysm" or die "Can't fork: $!\n";
> p> while (<$readme>) {
> p> print "$_\n";
> p> }
> p> # at this point is ysm still active and expecting user interaction
> p> kill 9 => $pid;
> p> close $readme;
>
> p> but executing the script invokes a blank screen whitout any output.
> p> The $pid is still alive, because the loop doesn't terminate.
>
> You can use Expect.pm to pretend a terminal is connected to the
> program, if that's the problem.
>
> There's a few ICQ modules on CPAN (e.g. Net::ICQ) that may work better
> for you than interacting with `ysm'.
>
> Ted
Since 2003 is Net::ICQ deprecated, unfortunately :(
I'll try Expect.pm, thanks!
Any other ideas?
KR,
potrebitel
------------------------------
Date: Wed, 04 Jun 2008 14:11:52 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: How to get the output from an ICQ clent
Message-Id: <86od6h2ex3.fsf@lifelogs.com>
On Wed, 4 Jun 2008 11:09:03 -0700 (PDT) potrebitel <tvachkov@googlemail.com> wrote:
p> Since 2003 is Net::ICQ deprecated, unfortunately :(
I saw a bunch on CPAN, not just Net::ICQ.
p> I'll try Expect.pm, thanks!
p> Any other ideas?
Expect is the best solution if you can't talk the protocol directly.
I'd be surprised if that was the case, though.
Ted
------------------------------
Date: Wed, 4 Jun 2008 13:30:50 -0700 (PDT)
From: potrebitel <tvachkov@googlemail.com>
Subject: Re: How to get the output from an ICQ clent
Message-Id: <862cc14e-2116-4c22-8145-7057a9e4c06e@a1g2000hsb.googlegroups.com>
>I saw a bunch on CPAN, not just Net::ICQ.
I didn't find somethig like that sorry, could you give me the name of
the bundle please.
Actually when I'm redirecting the output via ysm > output.txt, I'm
getting an empty text file too... Is it perhaps not possible at all to
catch the output somehow?
Thanks
KR,
potrebitel
------------------------------
Date: Wed, 04 Jun 2008 15:42:14 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: How to get the output from an ICQ clent
Message-Id: <86wsl50w61.fsf@lifelogs.com>
On Wed, 4 Jun 2008 13:30:50 -0700 (PDT) potrebitel <tvachkov@googlemail.com> wrote:
>> I saw a bunch on CPAN, not just Net::ICQ.
p> I didn't find somethig like that sorry, could you give me the name of
p> the bundle please.
cpan[1]> i /ICQ/
CPAN: Storable loaded ok (v2.15)
Going to read /home/tzz/.cpan/Metadata
Database was generated on Tue, 03 Jun 2008 20:07:30 GMT
Distribution JEROMEMCK/Net-ICQ-On-1.10.7.tar.gz
Distribution JMUHLICH/Net-ICQ-0.16.tar.gz
Distribution SNEMAROV/Net-ICQV5-1.20.tar.gz
Distribution SNEMAROV/Net-ICQV5CD-1.02.tar.gz
Distribution TANGENT/Crypt-OICQ-1.1.tgz
Distribution TANGENT/Net-OICQ-1.6.tar.gz
Module Crypt::OICQ (TANGENT/Crypt-OICQ-1.1.tgz)
Module Net::ICQ (JMUHLICH/Net-ICQ-0.16.tar.gz)
Module Net::ICQ2000 (N/A)
Module Net::ICQ::On (JEROMEMCK/Net-ICQ-On-1.10.7.tar.gz)
Module Net::ICQV5 (SNEMAROV/Net-ICQV5-1.20.tar.gz)
Module Net::ICQV5CD (SNEMAROV/Net-ICQV5CD-1.02.tar.gz)
Module Net::OICQ (TANGENT/Net-OICQ-1.6.tar.gz)
Module Net::OICQ::ClientEvent (TANGENT/Net-OICQ-1.6.tar.gz)
Module Net::OICQ::Event (TANGENT/Net-OICQ-1.6.tar.gz)
Module Net::OICQ::ServerEvent (TANGENT/Net-OICQ-1.6.tar.gz)
Module Net::OICQ::TextConsole (TANGENT/Net-OICQ-1.6.tar.gz)
Module WebPresence::Profile::ICQ (DODGER/WebPresence/WebPresence-Profile.tar.gz)
18 items found
You can also use search.cpan.org
p> Actually when I'm redirecting the output via ysm > output.txt, I'm
p> getting an empty text file too... Is it perhaps not possible at all to
p> catch the output somehow?
If ysm is hung waiting for your input, it won't print anything out. I
don't know the particulars of how ysm works, sorry.
Ted
------------------------------
Date: Thu, 5 Jun 2008 02:20:07 +0200
From: "Pero" <pero@tupwerwt.ch>
Subject: I try to copy one file to other folder on Linux server, and nothing happened? Please help me.
Message-Id: <g27bfp$89q$1@localhost.localdomain>
#!/usr/bin/perl -w
#
use File::Copy;
print "Content-type: text/html\n\n";
print "Start.<br>";
$original="/home/thomas/ftp/test-001.pdf";
$indigo="/srv/www/html/cgi-bin/test-001copy.pdf";
system("cp $original $indigo") or die print "FAILED";
print "Finish.<br>";
I try to copy one file to other folder on Linux server, and nothing
happened?
Result is:
Start.
Finish.
But file is not copped? Why?
I use Perl version 5.6.1 installed on Fedora 7.3
Please help me.
Thomas
------------------------------
Date: Thu, 05 Jun 2008 01:34:13 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: I try to copy one file to other folder on Linux server, and nothing happened? Please help me.
Message-Id: <hufe44djuq8prmqcj5kddhap2ejhishqs6@4ax.com>
"Pero" <pero@tupwerwt.ch> wrote:
>#!/usr/bin/perl -w
Better
use warnings;
Missing
use strict;
>#
>use File::Copy;
Why do you import File::Copy if you are not using it anywhere?
>print "Content-type: text/html\n\n";
>print "Start.<br>";
>$original="/home/thomas/ftp/test-001.pdf";
>$indigo="/srv/www/html/cgi-bin/test-001copy.pdf";
>system("cp $original $indigo") or die print "FAILED";
You seem to be confused about the return values of system() and print()
as well as the argument of die(). Please see the man pages for each
function for information regarding those topics.
Furthermore it would be helpful to include the reason for the failure.
Although system() doesn't provide a textual failure message as the perl
I/O-functions do, it still returns the exit status of the called
program. You just have to decode it as described in the man page.
>print "Finish.<br>";
>
>I try to copy one file to other folder on Linux server, and nothing
>happened?
Usual suspect: does the user, under which the web server is executing
CGI scripts, have the appropriate permissions?
jue
------------------------------
Date: Thu, 05 Jun 2008 03:30:03 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: I try to copy one file to other folder on Linux server, and nothing happened? Please help me.
Message-Id: <6aou0cF38sppcU1@mid.individual.net>
Pero wrote:
> #!/usr/bin/perl -w
> #
> use File::Copy;
> print "Content-type: text/html\n\n";
> print "Start.<br>";
> $original="/home/thomas/ftp/test-001.pdf";
> $indigo="/srv/www/html/cgi-bin/test-001copy.pdf";
> system("cp $original $indigo") or die print "FAILED";
> print "Finish.<br>";
>
> I try to copy one file to other folder on Linux server, and nothing
> happened?
> Result is:
>
> Start.
> Finish.
>
> But file is not copped?
First you use File::Copy, then you ignore it and use the system()
function (while checking for success in the wrong way). Please make up
your mind.
I'd suggest that you stick with File::Copy, and study its documentation.
http://search.cpan.org/perldoc?File::Copy
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 4 Jun 2008 21:09:57 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: MD5 and SHA1 fingerprint from SSL certificates
Message-Id: <pan.2008.06.04.19.09.56@rtij.nl.invlalid>
On Wed, 04 Jun 2008 16:21:10 +0000, toralf wrote:
> Martijn Lievaart wrote:
>
>> Seems IO::Socket::SSL cannot do this, at least I could not find it in
>> the documentation. Nothing for it, but use Net::SSLeay directly and
>> hope it's dump_peer_certificate is better, otherwise get dirty with
>> Net::SSLeay and it's SSLeay low level bindings.
>>
>> M4
>
> Yep, it seems that I've to go into Net::SSLeay but it's a hard way.
> Probably I'll have try to search in other groups too...
Of copy the relevant guts of IO::Socket::SSL and modify to taste, maybe
even submit a patch.
M4
------------------------------
Date: Wed, 04 Jun 2008 15:18:22 -0400
From: smallpond <smallpond@juno.com>
Subject: Re: OT: SI units (was sorting a hash / 2008-06-01)
Message-Id: <2eff3$4846ea8e$5183@news.teranews.com>
Abigail wrote:
> _
> sheinrich@my-deja.com (sheinrich@my-deja.com) wrote on VCCCLXXXVI
> September MCMXCIII in <URL:news:909e7d1f-f37a-4e85-96de-c35f800e6a60@a70g2000hsh.googlegroups.com>:
> :: On May 30, 9:21 am, "dn.p...@gmail.com" <dn.p...@gmail.com> wrote:
> ::
> :: ...
> :: >
> :: > my %hash = () ;
> :: > $hash{Calif}{San Jose}{max_temp} = 84 ;
> :: > $hash{Calif}{San Fran}{max_temp} = 94 ;
> :: > $hash{Calif}{Cupertino}{max_temp} = 38 ;
> :: > $hash{Calif}{Fremont}{max_temp} = 66 ;
> :: > $hash{Texas}{Dallas}{max_temp} = 72 ;
> :: > $hash{Texas}{Austin}{max_temp} = 96 ;
> :: > $hash{Texas}{Fort Worth}{max_temp} = 62 ;
> :: > $hash{Mass}{Boston}{max_temp} = 96 ;
> :: > $hash{Mass}{Framingham}{max_temp} = 55 ;
> :: > $hash{Mass}{Worcester}{max_temp} = 55 ;
> :: >
> :: Excuse me, but is it really absolutely unthinkable to share your
> :: information with the meager 99% percent of the world that has adopted
> :: SI units decades(!) ago?
>
> The USA makes up for about 4.5% of the world population, so even if the
> rest of the world would use Celsius, it would only be 95%. But how many
> of those 95% actually care about the four hottest cities in the USA, as
> compared to the 4.5% that uses Fahrenheit?
>
> Besides, they are just numbers, and considering that the mapping between
> Celsius and Fahrenheid is monotonic and continuous, it doesn't make no
> difference at all for his question (how to get the four hottest cities)
> whether the temparatures are in Celsius or Fahrenheit.
>
>
>
> Abigail
The US has been officially a metric country since the Metric Conversion Act
of 1975. Before that it was legal but not preferred to use SI units, since
then it is legal but not preferred to use "English" units. Of course,
conversion is voluntary. Highway signs don't seem to have made much progress,
but its only been 33 years.
** Posted from http://www.teranews.com **
------------------------------
Date: Wed, 4 Jun 2008 21:10:37 +0100
From: prawn <sean.prawn@gmail.com>
Subject: Re: OT: SI units (was sorting a hash / 2008-06-01)
Message-Id: <te9jh5-8sk.ln1@prawn.mine.nu>
On Tue, 03 Jun 2008 20:51:21 -0700, szr wrote:
> Granted, though a lot of ridicule seem to also come from the UK, despite
> the fact that they use some of their own units for certai nthings (like
> their own Gallons and Ounces.) It's not just the USA that uses different
> units for some things, any many people who ridicule the USA for it
> forget that all too easily.
Err, the only non-SI units in use now are pints (for beer only) and miles
for road distances and horse racing. Milk, wine, spirits, fuel are all
sold in litres and goods are sold in kilo's. Hell, we even decimalized
our currency in 1971 :-)
--
"If you ask me Jeeves, art is responsible for most of the trouble in the
world."
"It's an interesting theory, Sir. Would you care to expatiate upon it?"
"As a matter of fact, no Jeeves. No The thought just occurs to me, you
know, as thoughts do."
------------------------------
Date: Wed, 04 Jun 2008 13:37:43 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: OT: SI units
Message-Id: <863ant3v2g.fsf@lifelogs.com>
On Wed, 04 Jun 2008 15:51:34 GMT "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
ASU> To meter is to measure. I am finding it increasingly obnoxious (as
ASU> my years in the U.S. add up) that the French decided to impose on
ASU> the rest of the world the one true system of measurement and co-op
ASU> a generic term meaning to measure/measurement for that purpose.
To be fair, the French didn't have too many terms available, since 99%
of their language is dedicated to food, sex, and unconditional surrender.
Ted
------------------------------
Date: Wed, 04 Jun 2008 20:38:21 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: OT: SI units
Message-Id: <ovud449t9qj3kddhqf1qu8ki562of7gvvl@4ax.com>
smallpond <smallpond@juno.com> wrote:
>The US has been officially a metric country since the Metric Conversion Act
>of 1975. Before that it was legal but not preferred to use SI units, since
>then it is legal but not preferred to use "English" units. Of course,
>conversion is voluntary. Highway signs don't seem to have made much progress,
>but its only been 33 years.
Oh, come on. Don't be so hard. They are making great progress.
Distances in km on tourist information boards will last several weeks
now. In the past they were scratched off within days.
And the last shelf in the hardware store out of those 15-20 now contains
metric screws and bolts. Although, I have to admit, that is only because
those foreign car companies are too stupid to convert their cars to King
Georg's thumb width at the port of entry.
jue
------------------------------
Date: Wed, 04 Jun 2008 17:28:19 -0400
From: smallpond <smallpond@juno.com>
Subject: Re: OT: SI units
Message-Id: <57699$48470905$23312@news.teranews.com>
wrote:
> smallpond <smallpond@juno.com> wrote:
>> The US has been officially a metric country since the Metric Conversion Act
>> of 1975. Before that it was legal but not preferred to use SI units, since
>> then it is legal but not preferred to use "English" units. Of course,
>> conversion is voluntary. Highway signs don't seem to have made much progress,
>> but its only been 33 years.
>
> Oh, come on. Don't be so hard. They are making great progress.
> Distances in km on tourist information boards will last several weeks
> now. In the past they were scratched off within days.
> And the last shelf in the hardware store out of those 15-20 now contains
> metric screws and bolts. Although, I have to admit, that is only because
> those foreign car companies are too stupid to convert their cars to King
> Georg's thumb width at the port of entry.
>
> jue
I like to use 5/32" hex wrench which is interchangeable with 4 mm.
That's the wrench used for rollerblade wheels and the door
key for IBM mainframes.
** Posted from http://www.teranews.com **
------------------------------
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 1611
***************************************