[19507] in Perl-Users-Digest
Perl-Users Digest, Issue: 1702 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 6 09:05:42 2001
Date: Thu, 6 Sep 2001 06:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <999781512-v10-i1702@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 6 Sep 2001 Volume: 10 Number: 1702
Today's topics:
Re: can this perl script be more elegant/shorter ? <goldbb2@earthlink.net>
Re: can this perl script be more elegant/shorter ? <goldbb2@earthlink.net>
Re: cgi.pm cookie function - am I missing something? (Jennifer)
Re: cgi.pm cookie function - am I missing something? (Jennifer)
Daily iteration <sh@planetquake.com>
Re: Daily iteration <jbritain@home.com>
Re: Daily iteration news@roaima.demon.co.uk
Re: Daily iteration <sh@planetquake.com>
Re: Daily iteration <bart.lateur@skynet.be>
Re: dec2hex conversion ,uninitialized value (Peter J. Acklam)
Re: File::Find not recursing on Win32 Perl 5.001 (David Combs)
Re: File::Find not recursing on Win32 Perl 5.001 <bart.lateur@skynet.be>
Re: File::Find not recursing on Win32 Perl 5.001 (Phil Hibbs)
Re: File::Find not recursing on Win32 Perl 5.001 <bart.lateur@skynet.be>
Re: Getting CPU load from remote computers <cv74215@home.com>
Re: How can I find the PID's of my children? (Ilja Tabachniks)
Re: How to Benchmark CGI Performance ? (Rafael Garcia-Suarez)
Re: How to Benchmark CGI Performance ? <tag@gmx.de>
Re: how to get named constants in Perl (Peter J. Acklam)
Re: how to get named constants in Perl (Maurice Fox)
Net::Telnet module (ian)
NET:SSH Confirm (n.beetz)
Re: Open 2 exes from Perl (Helgi Briem)
Re: Open 2 exes from Perl <bart.lateur@skynet.be>
Re: Open 2 exes from Perl <nospam-abuse@ilyaz.org>
PERL modules and GPL license (Samppa)
Re: Perlscript memory leak <bkennedy99@Home.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 06 Sep 2001 06:16:05 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: can this perl script be more elegant/shorter ?
Message-Id: <3B974CE5.BC8FB8E4@earthlink.net>
John W. Krahn wrote:
[snip]
> if ( $chain_number == 7 ) {
> for ( my $i = 0; $i < @{ $chain[ $chain_number ] }; $i++ ) {
The line with the for loop should probably be:
for my $i ( 0 .. $#{ $chain[7] } ) {
Since that's smaller, and, if you know what $# means, clearer.
Changing $chain_number to 7 in that expression is of course done since
it will always be 7, due to the if on the line before it.
--
"I think not," said Descartes, and promptly disappeared.
------------------------------
Date: Thu, 06 Sep 2001 07:22:40 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: can this perl script be more elegant/shorter ?
Message-Id: <3B975C80.1FD4E9C@earthlink.net>
Tim wrote:
>
> Hi,
>
> Could some one help me to make this script more elegant and shorter ?
Sure.
Also, I'm not sure how well other people's suggestions deal with the
backslash-newline continuation marks.
#!/usr/local/bin/perl -w
my ($input, $output) = qw( chaintest.scan OUT );
open INPUT , "< $input" or die "Cannot read from $input: $!\n";
my $chains = do { local $/; <INPUT> };
close INPUT;
PREPROCESS: { # it's a block, not a sub... the label is for convenience
# since \s includes newlines, the following two expressions
# get rid of leading blanks, trailing blanks, *and* empty lines.
# some folks don't realize it gets rid of empty lines, but it
# does.
$chains =~ s/^\s+//mg;; $chains =~ s/\s+$//mg;
# This removes backslash-newline type continuations.
$chains =~ s/\\\n//g;
}
open OUTPUT, "> $output" or die "Cannot write to $output: $!\n";
select OUTPUT; # this mean, by default, print goes to OUTPUT.
my ($ct_scanout, @chains);
foreach ( split /;/, $chains ) {
($ct_scanout = $1), if /apply\s+"grp\d_(un)load/;
next unless m/chain "chain([1-7])" = "(.*?)"/s;
$chains[$1-1] = $2;
next if $1 < 7;
foreach( @chains ) {
tr/01X//cd; # delete everything but 0, 1, and X
$ct_scanout
? tr/01X/LH/d # translate 01, get rid of X.
: tr/X/0/; # translate X.
}
my $ct = $ct_scanout ? "(ct_so" : "(ct_si";
while( grep(length, @chains) == 7 ) {
print $ct, map( substr($_,0,1,""), @chains ), ")\n";
}
}
close OUTPUT;
__END__
I realize that my preprocess does different stuff than yours, but I
don't think that the stuff you do there is actually needed, and do think
that the stuff I do is.
--
"I think not," said Descartes, and promptly disappeared.
------------------------------
Date: 6 Sep 2001 05:29:44 -0700
From: jennlee.2@eudoramail.com (Jennifer)
Subject: Re: cgi.pm cookie function - am I missing something?
Message-Id: <e836199f.0109060429.1d7da1d5@posting.google.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message news:<3B965DB0.BDD4E2C7@stomp.stomp.tokyo>...
> Jennifer wrote:
>
> (snipped)
>
> > It appears that the cookie successfully sets. In fact, I can go and
> > see it in the cookies files used for IE and Netscape.
>
>
> What is the name of the file for storing Netscape cookies?
On Netscape it is cookies.txt which is in my c:\program
files\netscape\users\myusername\ folder.
On IE it is named for my username at the domain.txt in
c:\winnt\profiles\myusername\cookies\
I'm testing on IE primarily since its for our Intranet and that's our
company standard - although it also needs to work on Netscape. In my
past experience, cookies are something that generally doesn't suffer
from browser incompatabilities, so hopefully if I can get it working
on the one, it should work on the other...
Thanks,
Jennifer
>
>
> Godzilla!
------------------------------
Date: 6 Sep 2001 05:59:18 -0700
From: jennlee.2@eudoramail.com (Jennifer)
Subject: Re: cgi.pm cookie function - am I missing something?
Message-Id: <e836199f.0109060459.53be4235@posting.google.com>
efflandt@xnet.com (David Efflandt) wrote in message news:<slrn9pdq8d.enp.efflandt@typhoon.xnet.com>...
> On 5 Sep 2001 09:54:17 -0700, Jennifer <jennlee.2@eudoramail.com> wrote:
> >
> > So both cookies are there but not sure why cgi.pm cookies function
> > cannot find the 'CoStore' one. I don't think its expired because it
> > was set for +7D which I think is corect for 7 days in the future.
>
> It is actually called CGI.pm (unless your OS is case insensitive) and if
> you read 'perldoc CGI' you would see that 'd' is for days. Not sure if
> that is case sensitive, but m certainly is (m=minute, M=month).
>
Thanks for the tip on the use of 'd' over 'D.' I was using the book,
Official Guide to Programming with CGI.pm. The book example uses 'd'
but for some reason I saw it as 'D'. Big 'D' for 'Duh' on my part, I
guess. My early tests changing to 'd' look like that did the trick.
Thanks again!
Jennifer
> Not sure if this is your problem, but often upper or lower case does
> matter.
------------------------------
Date: Thu, 06 Sep 2001 08:47:24 GMT
From: "Sean Hamilton" <sh@planetquake.com>
Subject: Daily iteration
Message-Id: <wKGl7.2058$C57.479800@news1.telusplanet.net>
Greetings,
I want to perform some action once for every day from today to some
arbitrary point into the future.
my $days = 0;
while ($days < 365)
{
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
gmtime (time () + ($days * 86400));
++$days;
}
Works, except the time offset results in Today not always being iterated.
(Depending on when the script was called.)
while ($days < 365)
{
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
localtime (time () + ($days * 86400));
++$days;
}
Works, except Very Bad Things happen when called at certain times... the day
the clock is rolled back appears twice, etc.
Ideas?
sh
------------------------------
Date: Thu, 06 Sep 2001 10:16:33 GMT
From: Jim Britain <jbritain@home.com>
Subject: Re: Daily iteration
Message-Id: <aeieptkhp1nujn0ns54ek749kda3a4p5le@4ax.com>
[mailed and posted]
On Thu, 06 Sep 2001 08:47:24 GMT, "Sean Hamilton" <sh@planetquake.com>
wrote:
>Greetings,
>
>I want to perform some action once for every day from today to some
>arbitrary point into the future.
>
>my $days = 0;
>
>while ($days < 365)
>{
> my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
>gmtime (time () + ($days * 86400));
> ++$days;
>}
>
>Works, except the time offset results in Today not always being iterated.
>(Depending on when the script was called.)
>
>while ($days < 365)
>{
> my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
>localtime (time () + ($days * 86400));
> ++$days;
>}
>
>Works, except Very Bad Things happen when called at certain times... the day
>the clock is rolled back appears twice, etc.
>
>
>Ideas?
This is all perfectly fine, if you're playing around, but if you're
serious about this:
http://search.cpan.org/search?dist=DateManip
and stop messing with the BS Junior High School details of this type
calculation.
------------------------------
Date: 6 Sep 2001 11:22:39 GMT
From: news@roaima.demon.co.uk
Subject: Re: Daily iteration
Message-Id: <3b974e6f@news.netserv.net>
Sean Hamilton <sh@planetquake.com> wrote:
> I want to perform some action once for every day from today to some
> arbitrary point into the future.
Does it matter at what time the action is performed? Should it be the
same time every day, or just once the first time your program is run?
On a UNIX/Linux box, use cron. If you're on Windows, use the Task
Scheduler (or whatever it's called). Other platforms will almost
certainly have equivalents.
> while ($days < 365)
> {
> my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
> gmtime (time () + ($days * 86400));
> ++$days;
> }
Haven't you missed the sleep() instruction somewhere?
How about this:
while ($forever) {
# When will it be tomorrow?
my $tomorrow = time + (24 * 60 * 60);
# Do my processing now; this may take a while...
do { stuff };
# Wait until tomorrow comes
sleep ($tomorrow - time) while time < $tomorrow;
}
> my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
> localtime (time () + ($days * 86400));
> Works, except Very Bad Things happen when called at certain times... the day
> the clock is rolled back appears twice, etc.
This is a good reason (and the correct reason, usually) for using gmtime()
instead of localtime().
Chris
------------------------------
Date: Thu, 06 Sep 2001 10:53:21 GMT
From: "Sean Hamilton" <sh@planetquake.com>
Subject: Re: Daily iteration
Message-Id: <BAIl7.2070$C57.516429@news1.telusplanet.net>
Woah, major misconception.
I'm trying to draw a calendar (via CGI) with the first visible day set to
today.
sh
<news@roaima.demon.co.uk> wrote in message news:3b974e6f@news.netserv.net...
> Sean Hamilton <sh@planetquake.com> wrote:
> > I want to perform some action once for every day from today to some
> > arbitrary point into the future.
>
> Does it matter at what time the action is performed? Should it be the
> same time every day, or just once the first time your program is run?
>
> On a UNIX/Linux box, use cron. If you're on Windows, use the Task
> Scheduler (or whatever it's called). Other platforms will almost
> certainly have equivalents.
>
> > while ($days < 365)
> > {
> > my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
> > gmtime (time () + ($days * 86400));
> > ++$days;
> > }
>
> Haven't you missed the sleep() instruction somewhere?
>
> How about this:
>
> while ($forever) {
> # When will it be tomorrow?
> my $tomorrow = time + (24 * 60 * 60);
>
> # Do my processing now; this may take a while...
> do { stuff };
>
> # Wait until tomorrow comes
> sleep ($tomorrow - time) while time < $tomorrow;
> }
>
>
> > my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
> > localtime (time () + ($days * 86400));
>
> > Works, except Very Bad Things happen when called at certain times... the
day
> > the clock is rolled back appears twice, etc.
>
> This is a good reason (and the correct reason, usually) for using gmtime()
> instead of localtime().
>
> Chris
------------------------------
Date: Thu, 06 Sep 2001 11:47:37 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Daily iteration
Message-Id: <pfoeptobeo5vbj6p66qsv3tvo98iu9j2h2@4ax.com>
Sean Hamilton wrote:
>I'm trying to draw a calendar (via CGI) with the first visible day set to
>today.
>> > while ($days < 365)
>> > {
>> > my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
>> > gmtime (time () + ($days * 86400));
>> > ++$days;
>> > }
The don't use time(). If plain CGI, use $^T instead. That is the time
when the script was started.
If running under mod_perl or similar (long process), this won't work.
Then, assign time() to a variable before entering the loop, and use
that.
--
Bart.
------------------------------
Date: 06 Sep 2001 12:58:05 +0200
From: jacklam@math.uio.no (Peter J. Acklam)
Subject: Re: dec2hex conversion ,uninitialized value
Message-Id: <cxc3d60wpqa.fsf@tiamat.uio.no>
Bart Lateur <bart.lateur@skynet.be> wrote:
> sub int2dec {
> return "$_[0]";
> }
Hmm. Then I guess dec2int would be
sub dec2int {
return +$_[0];
}
Peter
--
#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
# matlab comment stripper (strips comments from Matlab m-files)
s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;
------------------------------
Date: 6 Sep 2001 06:55:20 GMT
From: dkcombs@panix.com (David Combs)
Subject: Re: File::Find not recursing on Win32 Perl 5.001
Message-Id: <9n76ko$bd0$2@news.panix.com>
In article <m3pu9ct9la.fsf@dhcp9-161.support.tivoli.com>,
Ren Maddox <ren@tivoli.com> wrote:
>On Thu, 30 Aug 2001, bart.lateur@skynet.be wrote:
>
>> Phil Hibbs wrote:
>>
>>>> What version of perl is it? I tried it on 5.6.1 on 2000 Pro.
>>>
>>>It's 5.001 as per the subject line. And no, I can't upgrade it, much
>>>though I'd like to.
>>
Do you have any idea how many *bugs* they've fixed
since then?
Perl 6.1 or 6.01 or whatever they call it is pretty
darned good.
Why not at least get it onto *your* computer and
simply *try* your application?
It just might work with *no* changes at all.
If so, then send out the msg to the 5000 users
that, if they want, they can upgrade to the new
version.
Those who want to, will.
And anyone can of course fall back to the 5.001.
(Would you ride in an airplane like 5.001, first off
the assembly line, no required fixes ever made to it?
I guess your "clients" would answer "yes!".)
David
------------------------------
Date: Thu, 06 Sep 2001 07:11:56 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: File::Find not recursing on Win32 Perl 5.001
Message-Id: <mb8eptok36igd7i6i1rrva6f2vhlfqee1e@4ax.com>
David Combs wrote:
>Perl 6.1 or 6.01 or whatever they call it is pretty
>darned good.
It's 5.6.1. In the old notation, that would be 5.006_01.
Perl6 is still years away.
--
Bart.
------------------------------
Date: 6 Sep 2001 04:38:19 -0700
From: phil@snark.freeserve.co.uk (Phil Hibbs)
Subject: Re: File::Find not recursing on Win32 Perl 5.001
Message-Id: <979ae699.0109060338.72c85a11@posting.google.com>
dkcombs@panix.com (David Combs) wrote in message news:<9n76ko$bd0$2@news.panix.com>...
> Why not at least get it onto *your* computer and
> simply *try* your application?
> It just might work with *no* changes at all.
> If so, then send out the msg to the 5000 users
> that, if they want, they can upgrade to the new
> version.
I'd like to upgrade it, I really would. But it isn't an option. End of
story. Please, no more suggestions that involve upgrading. These
aren't my clients, they're the clients of a customer who I am working
for, I just have to support the systems as they are. I'm writing a
perl script to help with my support. The customer isn't going to do an
expensive rollout just to make my support job fractionally easier.
Does anyone have any ideas on how to do a subdirectory scan on Perl
5.001?
Phil.
------------------------------
Date: Thu, 06 Sep 2001 11:50:04 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: File::Find not recursing on Win32 Perl 5.001
Message-Id: <hjoeptsd0kku5lnttn6vdhiafqako205k7@4ax.com>
Phil Hibbs wrote:
>I'd like to upgrade it, I really would. But it isn't an option. End of
>story. Please, no more suggestions that involve upgrading.
Can't you upgrade just File::Find?
Oh, blimey, the version that comes with 5.6.1 requires 5.005_64. I
wonder why.
--
Bart.
------------------------------
Date: Thu, 06 Sep 2001 04:37:42 GMT
From: "Christopher Van Beek" <cv74215@home.com>
Subject: Re: Getting CPU load from remote computers
Message-Id: <q4Dl7.43429$MK5.25274993@news1.sttln1.wa.home.com>
In article
<Pine.LNX.4.33.0109051729180.19771-100000@schewanella.stanford.edu>, "Les
Ander" <citykid@nospam.edu> wrote:
> Hi,
> I would like to get information on cpu type, make and number of
> processors, as well as get the cpu load information by executing the
> "uptime" command on various computers on our network. All of these
> computers are intel PCs and are running Redhat 6.2/7.1. All of them
> allow incoming rlogin, ssh and telnet connections.
> I can do this for my localhost using CGI and Linux::Cpuinfo modules, but
> don't have a clue how i can do this on remote computers. Can someone
> give me an example?
> thankyou
> les
>
If the rusers server is installed on each machine, all you have to do
is run "rup" from the rusers package. It performs a broadcast "ping"
to get all uptimes. It will run a lot faster than logging into each
machine.
------------------------------
Date: 6 Sep 2001 01:00:08 -0700
From: billy@arnis-bsl.com (Ilja Tabachniks)
Subject: Re: How can I find the PID's of my children?
Message-Id: <5d4a715a.0109060000.1d861cd7@posting.google.com>
"John W. Krahn" <krahnj@acm.org> wrote in message news:<3B96C27A.CE943E5B@acm.org>...
...skipped...
> >
> > 1. The 'command' format for ps(1) is not so portable (say AFAIK on Solaris
> > you'd use 'args' instead).
>
> Tell me about it. DG/UX uses nps for user defined formats.
>
AFAIK according to the Single UNIX Specification v.2 for ps(1)
there are 'comm' and 'args' formats defined for use with -o option.
Ilja.
------------------------------
Date: 6 Sep 2001 06:56:38 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: How to Benchmark CGI Performance ?
Message-Id: <slrn9pe7hf.b80.rgarciasuarez@rafael.kazibao.net>
Toni Duago wrote in comp.lang.perl.misc:
} Hy everybody,
} I'd like to know how I could possibly run a reliable Benchmarking
} test on a Server that has different perl CGIs on it. I think it is not
} sufficient to just send requests to the server and watch the CPU usage
} grow. I would like to have results like "20 requests/second processed".
}
} Maybe this is a little off-topic, but does anybody know if there are
} tools that can do these Benchmarks ? Or does anybody know how I could
} write a script that can do exactly this thing ?
} Thanks in advance.
If you have apache, you can use ab(1).
--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Thu, 06 Sep 2001 13:37:52 +0200
From: Toni Duago <tag@gmx.de>
Subject: Re: How to Benchmark CGI Performance ?
Message-Id: <3B976010.391C3E5@gmx.de>
> If you have apache, you can use ab(1).
Whoa ! Thank you very much, thats exactly what I needed !!
Since I am not very familiar with Apache I did not notice that there was
such a cool tool included !
Y.T.,
Toni
------------------------------
Date: 06 Sep 2001 12:26:20 +0200
From: jacklam@math.uio.no (Peter J. Acklam)
Subject: Re: how to get named constants in Perl
Message-Id: <cxcpu94aa43.fsf@tiamat.uio.no>
abigail@foad.org (Abigail) wrote:
> Peter J. Acklam (jacklam@math.uio.no) wrote:
> >
> > > Martien Verbruggen <mgjv@tradingpost.com.au> writes:
> > >
> > > > use const PI => 4 * atan2(1, 1);
> > >
> > > Why the 4? Why not just pick the right x,y?
> >
> > Because that's what's suggested in the docs. The "constant" man
> > page says
> >
> > use constant PI => 4 * atan2 1, 1;
> >
> > and the "perlsub" man page says
> >
> > sub PI () { 4 * atan2 1, 1 } # As good as it gets,
> >
> > > use constant PI => atan2(0,-1);
> >
> > Sure, but this isn't suggested anywhere in the docs.
>
> Just because it's in the docs doesn't mean you shouldn't think
> for yourself. The docs aren't about pi. They are about how to
> use the pragma.
Yes, and _I_ know that, but my point was merely to explain why the
poster had used "4 * atan2 1, 1" rather than "atan2(0,-1)".
Peter
--
#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
# matlab comment stripper (strips comments from Matlab m-files)
s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;
------------------------------
Date: 6 Sep 2001 12:56:24 GMT
From: mfox@localhost.localdomain (Maurice Fox)
Subject: Re: how to get named constants in Perl
Message-Id: <slrn9peskq.59n.mfox@localhost.localdomain>
On 06 Sep 2001 12:26:20 +0200, Peter J. Acklam <jacklam@math.uio.no> wrote:
>abigail@foad.org (Abigail) wrote:
>
>> Peter J. Acklam (jacklam@math.uio.no) wrote:
>> >
>> > > Martien Verbruggen <mgjv@tradingpost.com.au> writes:
>> > >
>> > > > use const PI => 4 * atan2(1, 1);
>> > >
>> > > Why the 4? Why not just pick the right x,y?
>> >
>> > Because that's what's suggested in the docs. The "constant" man
>> > page says
>> >
>> > use constant PI => 4 * atan2 1, 1;
>> >
>> > and the "perlsub" man page says
>> >
>> > sub PI () { 4 * atan2 1, 1 } # As good as it gets,
>> >
>> > > use constant PI => atan2(0,-1);
>> >
>> > Sure, but this isn't suggested anywhere in the docs.
>>
>> Just because it's in the docs doesn't mean you shouldn't think
>> for yourself. The docs aren't about pi. They are about how to
>> use the pragma.
>
>Yes, and _I_ know that, but my point was merely to explain why the
>poster had used "4 * atan2 1, 1" rather than "atan2(0,-1)".
>
>Peter
>
>--
>#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
># matlab comment stripper (strips comments from Matlab m-files)
>s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;
Because computer programs are not mathematics. Just because in
math atan(0/-1) is PI, you can't assume that holds true for a library
routine. Strictly speaking, inverse tangent is not a function,
because for any real x, there exists a countable infinitude of y
such that tan y = x.
Bottom line - RTFM.
Maurice
------------------------------
Date: 6 Sep 2001 04:28:28 -0700
From: ianjy@hotmail.com (ian)
Subject: Net::Telnet module
Message-Id: <ef7a627c.0109060328.2021eae6@posting.google.com>
I seem to be having a random problem with this module.....
Using the basic example provided (telnet to a host,run 'who' and print
the results)
Some of the time it works fine - output is as expected - no probs.
But there are a lot of times when there is no output at all.
The logs show the prompts and the command being sent and more
prompts...
but no command echo and no results.
Could this be a timing issue??
I've tried various prompt matches - and simplified the remote systems
prompt,
the prompt is being recognised, but the command doesn't seem to be
seen by the remote host.
Thanks
------------------------------
Date: 6 Sep 2001 04:08:09 -0700
From: norbert.beetz@telekom.de (n.beetz)
Subject: NET:SSH Confirm
Message-Id: <37be98c0.0109060308.469dbeb4@posting.google.com>
Big Trouble.
Please help me.
I try the module NET:SSH. Everything is working fine.
But one Problem, if i start my Script at the Command Line i must
confirm with yes to execute the command in my script!
But i want to execute the script without any interaktivity.
Here the script:
use Net::SSH qw(sshopen2);
use strict;
my $user = "";
my $host = "we201328";
my $cmd = "command";
sshopen2("$host", *READER, *WRITER, "$cmd") || die "ssh: $!";
while (<READER>) {
chomp();
print "$_\n";
}
close(READER);
close(WRITER);
And here the error:
command-line line 0: Missing yes/no argument.
If i try the script with issh following happens:
use Net::SSH qw(issh);
use strict;
my $user = "";
my $host = "we201328";
my $cmd = "command";
issh("$host","$cmd") || die "ssh: $!";
print "$_\n";
Error:
ssh we201328 command
Proceed [y/N]:
Please help
------------------------------
Date: Thu, 06 Sep 2001 09:46:22 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: Open 2 exes from Perl
Message-Id: <3b974419.666784835@news.isholf.is>
On Wed, 5 Sep 2001 15:45:12 +0000 (UTC), Ilya Zakharevich
<nospam-abuse@ilyaz.org> wrote:
>[A complimentary Cc of this posting was sent to
>Helgi Briem
><helgi@NOSPAMdecode.is>], who wrote in article <3b949cc6.492862739@news.isholf.is>:
>> >>With the exception of legacy systems, you can put 1 as the first
>> >>argument to system() to start a program asyncroneously (retval is the PID).
>
>> >I can't find any mention in the docs (perldoc -f system). Is this one of
>> >those undocumented features, one that may disappear some time in the
>> >near future?
>>
>> That's because it has nothing to do with perl.
>> It is a feature of the cmd.exe shell.
>
>B******t.
Ok Ilya, you usually know better, but I couldn't find
any mention of the first argument being 1 in the Perl
documentation for system nor exec, so I assumed
(ok, it's dangerous to assume) that this was a shell
feature (mentioning cmd.exe because that is what
the OP seemed to be using).
Ok, so where is this first argument documented
and can it take any other values and if so, are
any other values useful?
Regards,
Helgi Briem
------------------------------
Date: Thu, 06 Sep 2001 11:17:39 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Open 2 exes from Perl
Message-Id: <5kmept036acqhuiblephjnur00ci4a1357@4ax.com>
Helgi Briem wrote:
>Ok Ilya, you usually know better, but I couldn't find
>any mention of the first argument being 1 in the Perl
>documentation for system nor exec, so I assumed
>(ok, it's dangerous to assume) that this was a shell
>feature (mentioning cmd.exe because that is what
>the OP seemed to be using).
>
>Ok, so where is this first argument documented
>and can it take any other values and if so, are
>any other values useful?
Well... as Ilya said: look at perlos2.pod (yes, even on Win32). There,
there's a mention of system():
"system()"
Multi-argument form of "system()" allows an additional numeric
argument. The meaning of this argument is described in the
OS2::Process manpage.
Of course, in the Win32 ports, this module, and its manpage are missing.
Bugger.
--
Bart.
------------------------------
Date: Thu, 6 Sep 2001 11:19:55 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Open 2 exes from Perl
Message-Id: <9n7m4r$etn$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Helgi Briem
<helgi@NOSPAMdecode.is>], who wrote in article <3b974419.666784835@news.isholf.is>:
> >B******t.
>
> Ok Ilya, you usually know better, but I couldn't find
> any mention of the first argument being 1 in the Perl
> documentation for system nor exec, so I assumed
> (ok, it's dangerous to assume) that this was a shell
> feature (mentioning cmd.exe because that is what
> the OP seemed to be using).
???! system() is documented not to use shell unless blah-blah-blah.
[Never mind that many Win* ports break this.]
Ilya
------------------------------
Date: 6 Sep 2001 02:49:32 -0700
From: sami@xenetic.fi (Samppa)
Subject: PERL modules and GPL license
Message-Id: <30586a1d.0109060149.2fa2141a@posting.google.com>
hello there,
I am planning to use PERL modules which are publised under
GPL license. I am not changing the code of these modules just
using them.
What is your opinion, how does these modules (under GPL)
affect to my code licensing and the availability
to my source code ?
Can I distribute the code without source codes ?
We are planning to distribute the code as binary
version only, but without license payments.
Thanks Sami
------------------------------
Date: Thu, 06 Sep 2001 12:08:10 GMT
From: "Ben Kennedy" <bkennedy99@Home.com>
Subject: Re: Perlscript memory leak
Message-Id: <KGJl7.175976$EP6.50666656@news1.rdc2.pa.home.com>
"vrac" <xvrac@mediaone.net> wrote in message
news:1a6d415b.0108311756.30f36dd9@posting.google.com...
> <script language="PerlScript">
> <![CDATA[
>
> sub exec{
> }
> ]]>
> </script>
>
> When I replace PerlScript with vbscript or javascript and put in a
> similar empty function there is no increase in memory use no matter
> how many times it runs.
I don't know anything about PerlScript, but you could experiment with
creating anonymous subs - perhaps that memory gets freed more easily. Hope
this helps --
--Ben Kennedy
------------------------------
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.
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 V10 Issue 1702
***************************************