[19751] in Perl-Users-Digest
Perl-Users Digest, Issue: 1946 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 17 14:05:50 2001
Date: Wed, 17 Oct 2001 11:05:11 -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: <1003341911-v10-i1946@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 17 Oct 2001 Volume: 10 Number: 1946
Today's topics:
Astro::Sunrise version 0.05 released to CPAN <hillr@ugs.com>
Compiling Error <peter.reid2000@ntlworld.com>
Re: Compiling Error <s.warhurst@rl.ac.uk>
Re: Entering Name-Value pairs - Still Confused <mjcarman@home.com>
Glob limitations. <godfrey@nexus-soft.com>
Re: How do you get paid for Perl work over the Internet <lmoran@wtsg.com>
Re: how to find memory leaks in perl 5.004_04 (Jim Anderson)
Re: how to find memory leaks in perl 5.004_04 <dtweed@acm.org>
Re: how to find memory leaks in perl 5.004_04 <mjcarman@home.com>
How to Ping to an IP <sasha_lui@yahoo.com>
Re: How to Ping to an IP <hillr@ugs.com>
Re: How to Ping to an IP <jeff@vpservices.com>
Re: How to Ping to an IP <sasha_lui@yahoo.com>
Re: how to write to different host+port on one socket? (Thomas Erskine)
Re: how to write to different host+port on one socket? <Thomas@Baetzler.de>
Re: IE6 Error - Perl Output <rlally1@nycap.rr.com>
Re: IE6 Error - Perl Output <rlally1@nycap.rr.com>
Re: IE6 Error - Perl Output <jeff@vpservices.com>
Looking for DOS equiv to pause <lmoran@wtsg.com>
Re: Looking for DOS equiv to pause (Garry Williams)
Re: Looking for DOS equiv to pause <Thomas@Baetzler.de>
Re: Looking for DOS equiv to pause <CCX138@coventry.ac.uk>
Re: Looking for DOS equiv to pause <lmoran@wtsg.com>
Re: Looking for DOS equiv to pause <rereidy@indra.com>
Re: Manipulating Strings Within A Text File (Mua Bao)
Module to get WIN PIDs <lmoran@wtsg.com>
Re: Module to get WIN PIDs <arnuga@yahoo.com>
NMAKE error while installing Net-SNMP package (Tony McIver)
NMAKE error while installing SNMP module <tmciver@yottanetworks.com>
Re: Objects: Setting defaults and calling themselves?? (Peter Scott)
pcl printer codes <mwinter@nrel.nrel.gov>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 17 Oct 2001 07:51:19 -0700
From: "Ron Hill" <hillr@ugs.com>
Subject: Astro::Sunrise version 0.05 released to CPAN
Message-Id: <tsr8i9hlecu944@corp.supernews.com>
I have just release a new version of this module. This contains a fix for
the conversion to local time.
Here is the readme:
NAME
Astro::Sunrise - Perl extension for computing the sunrise/sunset on a
given day
SYNOPSIS
use Astro::Sunrise;
($sunrise, $sunset) = sunrise(YYYY,MM,DD,longitude,latitude,Time
Zone,DST);
DESCRIPTION
This module will return the sunrise/sunset for a given day.
Eastern longitude is entered as a positive number
Western longitude is entered as a negative number
Northern latitude is entered as a positive number
Southern latitude is entered as a negative number
There are a number of altitides to chose from, I have chosen
-0.833 because this is what most countries use. Feel free to
change it if you need to. Here is the list:
h = 0 degrees: Center of Sun's disk touches a mathematical horizon
h = -0.25 degrees: Sun's upper limb touches a mathematical horizon
h = -0.583 degrees: Center of Sun's disk touches the horizon;
atmospheric refraction accounted for
h = -0.833 degrees: Sun's supper limb touches the horizon;
atmospheric refraction accounted for
h = -6 degrees: Civil twilight (one can no longer read outside
without artificial illumination)
h = -12 degrees: Nautical twilight (navigation using a sea horizon no
longer possible)
h = -15 degrees: Amateur astronomical twilight (the sky is dark
enough for most astronomical observations)
h = -18 degrees: Astronomical twilight (the sky is completely dark)
sunrise
($sunrise, $sunset) = sunrise(YYYY,MM,DD,longitude,latitude,Time
Zone,DST);
($sunrise, $sunset) = sunrise( 2001, 3, 10, 17.384, 98.625, -5, 0 );
Returns the sunrise and sunset times, in HH:MM format. (Note: Time Zone
is the offset from GMT and DST is daylight
savings time, 1 means DST is in effect and 0 is not.
AUTHOR
Ron Hill rkhill@firstlight.net
Many thanks also go to Paul Schlyer, Stockholm, Sweden for his excellent
web page on the subject.
CREDITS
Thanks very much to:
Rich Bowen (rbowen@rbowen.com) for suggestions
Adrian Blockley [adrian.blockley@environ.wa.gov.au] for finding a bug in
the conversion to local time
COPYRIGHT and LICENSE
Here is the copyright information provided by Paul Schlyer:
Written as DAYLEN.C, 1989-08-16
Modified to SUNRISET.C, 1992-12-01
(c) Paul Schlyter, 1989, 1992
Released to the public domain by Paul Schlyter, December 1992
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated
documentation files (the "Software"), to deal in the Software without
restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
SEE ALSO
perl(1).
------------------------------
Date: Wed, 17 Oct 2001 15:44:01 +0100
From: "Peter Reid" <peter.reid2000@ntlworld.com>
Subject: Compiling Error
Message-Id: <3Qgz7.13595$T05.1562328@news2-win.server.ntlworld.com>
Whenever I use perlcc to compile a script into an executable, I ALWAYS get
the following error:
"Use of uninitialized value in C:/Perl/lib/B.pm line 194"
written lots of times and then
"Unassigned value assigned to typeglob at C:/perl/lib/B.pm line 192
Compiling C(tester) for tester.pl!
Couldn't open!"
(I was trying to compile a file called "tester.pl" but it doesn't work with
any filenames).
I use Win98 with ActiveState Perl 5.005_003
Any ideas anybody?
Thanks. Pete.
------------------------------
Date: Wed, 17 Oct 2001 16:45:18 +0100
From: "S Warhurst" <s.warhurst@rl.ac.uk>
Subject: Re: Compiling Error
Message-Id: <9qk92e$14j0@newton.cc.rl.ac.uk>
"Peter Reid" <peter.reid2000@ntlworld.com> wrote in message
news:3Qgz7.13595$T05.1562328@news2-win.server.ntlworld.com...
> Whenever I use perlcc to compile a script into an executable, I ALWAYS get
> the following error:
>
> "Use of uninitialized value in C:/Perl/lib/B.pm line 194"
That is a warning that a variable hasn't been initialised before being
used.. eg:
use warnings;
@array = (qw/1 2 3 4 5/);
foreach(@array)
{
if($_ >= 3){$counter++;}
}
The above code would not generate the warning even though $counter is not
declared previously, because you are ASSIGNING a value $counter, however:
use warnings;
@array = (qw/1 2 3 4 5/);
foreach(@array)
{
if($_ >= $num){$counter++;}
}
The above code would generate the warning because you are COMPARING $_ to
the variable $num which hasn't been declared before.
Does that clarify it? Check the context of that variable on line 194.
Spencer
------------------------------
Date: Wed, 17 Oct 2001 07:53:56 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Entering Name-Value pairs - Still Confused
Message-Id: <3BCD7F64.D6915165@home.com>
William Alexander Segraves wrote:
>
> Finally, YOUR query is off-topic for this newsgroup.
No, it is not. His question was about using CGI.pm (a Perl module) not
about a CGI action (like setting a cookie). As such, it is on-topic
here. Note that it's still inappropriate[1] -- the OP should have
checked the documentation before posting -- but that doesn't make it
off-topic.
[1] as defined by the conventions of this ng.
-mjc
------------------------------
Date: Wed, 17 Oct 2001 17:50:52 +0100
From: "Godfrey Guinan" <godfrey@nexus-soft.com>
Subject: Glob limitations.
Message-Id: <9qkcsh$2bj$1@newsg1.svr.pol.co.uk>
Hi all,
I'm having trouble using the glob comand when trying to process a few
thousand files.
I'm using version Perl 5.005_03 under Solaris 2.6 on a Sun Ultra.
A sample of the code looks like this :-
while (glob("*.html"))
{
$file = $_;
blah blah blah.....
}
The error I get is :-
glob failed (child exited with status 1) at file_exist.pl line 71, <_GEN_0>
chunk 193696.
Any ideas?
Thanks in advance,
Godfrey.
------------------------------
Date: Wed, 17 Oct 2001 09:40:41 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: How do you get paid for Perl work over the Internet??
Message-Id: <jh2rstogrnqc3coloq7dsm2h7qjo07kle3@4ax.com>
On Fri, 12 Oct 2001 17:27:29 GMT, Carlos C. Gonzalez
<aperlprogrammer@yahoo.com> wrote wonderful things about sparkplugs:
>Hi everyone,
SNIP
>Thanks.
>
>---
>Carlos
Best troll ever.
--
TMTOWTDI: My way tends to be wrong...
lmoran@wtsg.com
------------------------------
Date: 17 Oct 2001 06:15:15 -0700
From: james.h.anderson@ssmb.com (Jim Anderson)
Subject: Re: how to find memory leaks in perl 5.004_04
Message-Id: <2cfb060a.0110170515.78c2704@posting.google.com>
Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> wrote in message news:<3BCCBA12.8040804@post.rwth-aachen.de>...
> Jim Anderson wrote:
>
> > I've got a socket server implemented in perl (5.004_04). It gradually
> > eats up more and more memory until it eventually dies trying to fork a
> > child, due to insufficient swap space.
> >
> > When the process first starts, it takes up 23MB; just before it
>
> !!^^^^!!
> Something wrong with your design. Better post some code to give us a
> chance to see how you did that.
1. It's not my code.
2. It's very big.
3. It's proprietary.
I'm just asking for some general guidelines.
Thanks.
>
>
> > crashes, it's up to 200MB :-(
>
>
> Tassilo
------------------------------
Date: Wed, 17 Oct 2001 13:48:43 GMT
From: Dave Tweed <dtweed@acm.org>
Subject: Re: how to find memory leaks in perl 5.004_04
Message-Id: <3BCD8AE0.95DC3913@acm.org>
Jim Anderson wrote:
> 1. It's not my code.
> 2. It's very big.
> 3. It's proprietary.
>
> I'm just asking for some general guidelines.
The general guideline is this: If the person who wrote your code
isn't going to support it, and you can't show it to anyone else,
either dump it and find another solution, or learn enough Perl so
that you can debug it yourself. It's up to you.
-- Dave Tweed
------------------------------
Date: Wed, 17 Oct 2001 09:30:13 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: how to find memory leaks in perl 5.004_04
Message-Id: <3BCD95F5.F1656F8A@home.com>
Jim Anderson wrote:
>
> I've got a socket server implemented in perl (5.004_04). It gradually
> eats up more and more memory until it eventually dies trying to fork a
> child, due to insufficient swap space.
>
> When the process first starts, it takes up 23MB; just before it
> crashes, it's up to 200MB :-(
>
> Any suggestions how to isolate the problem would be greatly
> appreciated! (The environment is Solaris 5.6)
Take a look at the Devel::Leak module, available on CPAN.
-mjc
------------------------------
Date: Wed, 17 Oct 2001 17:42:38 +0200
From: "Sasha" <sasha_lui@yahoo.com>
Subject: How to Ping to an IP
Message-Id: <9qk7n2$m4a$1@newstoo.ericsson.se>
Hi all,
I am a new Perl programmer, I want to write a small program that could ping
to a an IP address and see if it is alive or not, I want also be able to get
answer in a certain period of time, for example if I didn't get answer in 10
seconds so it is not alive.I want to write like this
starting timer # i dont know how to start timer, or it is posible to count
the seconds
my $howmanysecods = 10;
my $timeStep; # A counter for counting the seconds
my$result = system (ping); # I dont know how can i see if it is alive or not
if (timeStep < $howmanysecods ) { # if we have time
if ($result ==alive) {print "IP is alive "; } # How can i see if it is
alive or not
else if ($result !=alive) {print "IP is no alive "; }
}
else print "IP is no alive ";
I hope some body could help me out, thanks
Thanks in advance Sasha
------------------------------
Date: Wed, 17 Oct 2001 08:45:47 -0700
From: "Ron Hill" <hillr@ugs.com>
Subject: Re: How to Ping to an IP
Message-Id: <3bcda64f$1@usenet.ugs.com>
"Sasha" <sasha_lui@yahoo.com> wrote in message
news:9qk7n2$m4a$1@newstoo.ericsson.se...
> Hi all,
> I am a new Perl programmer, I want to write a small program that could
ping
> to a an IP address and see if it is alive or not, I want also be able to
get
> answer in a certain period of time, for example if I didn't get answer in
10
> seconds so it is not alive.I want to write like this
[snipped]
> I hope some body could help me out, thanks
>
use Net::Ping;
$p = Net::Ping->new();
print "$host is alive.\n" if $p->ping($host);
$p->close();
for more info take a look at
perldoc Net::Ping
------------------------------
Date: Wed, 17 Oct 2001 08:49:29 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: How to Ping to an IP
Message-Id: <3BCDA889.C3A7AA17@vpservices.com>
Sasha wrote:
>
> Hi all,
> I am a new Perl programmer, I want to write a small program that could ping
> to a an IP address and see if it is alive or not, I want also be able to get
> answer in a certain period of time, for example if I didn't get answer in 10
> seconds so it is not alive.
Get Net::Ping in the libnet bundle of modules, then:
use Net::Ping
my $p = Net::Ping->new($protocol);
my $is_alive = $p->ping($host, $timeout);
__END__
$protocol is one of tcp, udp, or icmp.
$host is the hostname or IP number you want to contact
$timeout is the number of seconds you want to wait.
That's all there is to it.
--
Jeff
------------------------------
Date: Wed, 17 Oct 2001 18:10:52 +0200
From: "Sasha" <sasha_lui@yahoo.com>
Subject: Re: How to Ping to an IP
Message-Id: <9qk9bv$6fq$1@newstoo.ericsson.se>
Thank you guys,
Is it also posible to see if an IP adress is valid ?
Thanks Sasha
------------------------------
Date: 17 Oct 2001 06:55:55 -0700
From: erskine-google@sourceworks.com (Thomas Erskine)
Subject: Re: how to write to different host+port on one socket?
Message-Id: <afb40365.0110170555.538fcacc@posting.google.com>
Thomas Bätzler <Thomas@Baetzler.de> wrote in message news:<la9qsto4pdpvbah324k6ib676o2cg67thd@4ax.com>...
> On 16 Oct 2001 11:00:59 -0700, erskine-google@sourceworks.com (Thomas
> Erskine) wrote:
>
> >What am I doing wrong? Here's my attempt:
>
> >$sock->send( 'xxx1', 0, '205.189.80.197:10002') or
>
> That should be
>
> my $hisiaddr = inet_aton("205.189.80.197");
> my $hispaddr = sockaddr_in( 10002, $hisiaddr );
> $sock->send( 'xxx1', 0, $hispaddr ) or die "Error sending: $!\n";
>
> See "UDP: Message Passing" in the perlipc manpage for details.
>
> HTH,
Thanks. That did the trick. I'm sure I saw the syntax I used
somewhere. The docs for IO::Socket are sparse and look like the
writer meant to add UTSL :-). A couple of examples of using something
other than new would have helped. I'd suggest one basic send(data)
and one send( data, flags, dest).
------------------------------
Date: Wed, 17 Oct 2001 16:22:02 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: how to write to different host+port on one socket?
Message-Id: <rp4rst0sn5so3rj95163hpo1eoq8vo70a0@4ax.com>
On 17 Oct 2001, erskine-google@sourceworks.com (Thomas Erskine) wrote:
>The docs for IO::Socket are sparse and look like the
>writer meant to add UTSL :-).
This is true for much of the IO:: and IPC:: stuff that wrap "plain" libc
networking and ipc calls.
>A couple of examples of using something
>other than new would have helped. I'd suggest one basic send(data)
>and one send( data, flags, dest).
Well, perlipc has examples. And if you have money, the Perl Cookbook has
them, too :-)
HTH,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Wed, 17 Oct 2001 15:44:48 GMT
From: "RSL" <rlally1@nycap.rr.com>
Subject: Re: IE6 Error - Perl Output
Message-Id: <QHhz7.691154$T97.95041803@typhoon.nyroc.rr.com>
Hi:
How much more on topic can this be? My question is can I change the error
code from one value (say 404) to another from a Perl script? Not a VB
script or any other type of script but a Perl script.
Bob
"Rob - Rock13.com" <rob_13@excite.com> wrote in message
news:Xns913CD7B52C4A1rock13com@64.8.1.226...
> Jon Ericson <news:86vghfbl4d.fsf@jon_ericson.jpl.nasa.gov>:
>
> > [comp.lang.perl removed from newsgroups]
> >
> > "RSL" <rlally1@nycap.rr.com> writes:
> >
> >> I modified my .htaccess so 404 errors cause a Perl CGI script
> >> to execute. The script has been modified to output a small
> >> amount of code to the browser that says, "An Error has
> >> Occurred".
> >> [But it doesn't work in IE...]
> >>
> >> Is there an Environment variable that holds the error code so
> >> I can change it to something else?
>
> Yup, this is OT but I can see (sorta) how you could think it has
> something to do with Perl.
>
> It is a configuration in IE. Tell it not to show "friendly" error
> pages. Then make sure your error outputs a decent amount of content
> (can't recall the number of bytes--do a search) or IE will ignore
> your error page if viewers have not adjusted their IE.
>
> --
> Rob - http://rock13.com/
> Web Stuff: http://rock13.com/webhelp/
------------------------------
Date: Wed, 17 Oct 2001 16:22:04 GMT
From: "RSL" <rlally1@nycap.rr.com>
Subject: Re: IE6 Error - Perl Output
Message-Id: <Meiz7.691157$T97.95059870@typhoon.nyroc.rr.com>
Hi:
I added 5,000 spaces and it works fine. Thank you.
Bob
"Rob - Rock13.com" <rob_13@excite.com> wrote in message
news:Xns913CD7B52C4A1rock13com@64.8.1.226...
> Jon Ericson <news:86vghfbl4d.fsf@jon_ericson.jpl.nasa.gov>:
>
> > [comp.lang.perl removed from newsgroups]
> >
> > "RSL" <rlally1@nycap.rr.com> writes:
> >
> >> I modified my .htaccess so 404 errors cause a Perl CGI script
> >> to execute. The script has been modified to output a small
> >> amount of code to the browser that says, "An Error has
> >> Occurred".
> >> [But it doesn't work in IE...]
> >>
> >> Is there an Environment variable that holds the error code so
> >> I can change it to something else?
>
> Yup, this is OT but I can see (sorta) how you could think it has
> something to do with Perl.
>
> It is a configuration in IE. Tell it not to show "friendly" error
> pages. Then make sure your error outputs a decent amount of content
> (can't recall the number of bytes--do a search) or IE will ignore
> your error page if viewers have not adjusted their IE.
>
> --
> Rob - http://rock13.com/
> Web Stuff: http://rock13.com/webhelp/
------------------------------
Date: Wed, 17 Oct 2001 09:23:19 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: IE6 Error - Perl Output
Message-Id: <3BCDB077.8347391C@vpservices.com>
RSL wrote:
>
> How much more on topic can this be?
> My question is can I change the error
> code from one value (say 404) to another from a Perl script?
Yes you can change the value in Perl, just print a different value. The
question then becomes what value should you print and what impact will
that new value have. Those questions have nothing to do with Perl. The
number 404 has absolutely no special significance in Perl while it does
in CGI and HTTP so it's in newsgroups and documentation on those issues
you should be seeking.
> Not a VB
> script or any other type of script but a Perl script.
Please take a minute to think about your logic here. You are saying
that because X is printed using perl, that therefore X is on topic to a
perl newsgroup. What if X is a dictionary of Ancient Greek? Is Ancient
Greek therefore on topic in a perl newsgroup?
We aren't telling you this to be rude, it would not be a favor to you to
make you think that you can understand CGI and HTTP by learning Perl.
If you want to understand CGI and HTTP, you need to learn them and
learning Perl syntax won't help you do that.
--
Jeff
------------------------------
Date: Wed, 17 Oct 2001 09:50:39 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Looking for DOS equiv to pause
Message-Id: <mt2rsts4coktdr1hrg7gkage1ubp15u5th@4ax.com>
I have searched the perldocs for a perl verison of the DOS command
pause.
Currently I am using:
my $pause eq (`pause`) ;
Which is fine since I run this on Windows but I was looking for the
Perl version.
Pointers? Better places to look. The right term?
thanks
--
TMTOWTDI: My way tends to be wrong...
lmoran@wtsg.com
------------------------------
Date: Wed, 17 Oct 2001 14:25:44 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Looking for DOS equiv to pause
Message-Id: <slrn9sr578.ko3.garry@zfw.zvolve.net>
On Wed, 17 Oct 2001 09:50:39 -0400, Lou Moran <lmoran@wtsg.com> wrote:
> I have searched the perldocs for a perl verison of the DOS command
> pause.
>
> Currently I am using:
> my $pause eq (`pause`) ;
> Which is fine since I run this on Windows but I was looking for the
> Perl version.
>
> Pointers? Better places to look. The right term?
<>
--
Garry Williams
------------------------------
Date: Wed, 17 Oct 2001 16:27:00 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Looking for DOS equiv to pause
Message-Id: <a25rst0n34p2i8qg5l1isnijs4mkuj3roa@4ax.com>
On Wed, 17 Oct 2001, Lou Moran <lmoran@wtsg.com> wrote:
>I have searched the perldocs for a perl verison of the DOS command
>pause.
print "Press any key to continue . . .\n";
then read today's FAQ Posting " How do I read just one key without
waiting for a return key?"
HTH,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Wed, 17 Oct 2001 15:20:29 +0100
From: JMT <CCX138@coventry.ac.uk>
Subject: Re: Looking for DOS equiv to pause
Message-Id: <3BCD93AD.6E8E35EC@coventry.ac.uk>
Lou Moran wrote:
>
> I have searched the perldocs for a perl verison of the DOS command
> pause.
>
> Currently I am using:
> my $pause eq (`pause`) ;
> Which is fine since I run this on Windows but I was looking for the
> Perl version.
>
> Pointers? Better places to look. The right term?
>
> thanks
>
> --
> TMTOWTDI: My way tends to be wrong...
> lmoran@wtsg.com
print qq(Press any key to continue . . .);
<STDIN>;
------------------------------
Date: Wed, 17 Oct 2001 10:46:33 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Looking for DOS equiv to pause
Message-Id: <2d6rstk6foh6ku2lvokkq6b3bbi38ipjqn@4ax.com>
On Wed, 17 Oct 2001 15:20:29 +0100, JMT <CCX138@coventry.ac.uk> wrote
wonderful things about sparkplugs:
SNIP
>
>print qq(Press any key to continue . . .);
><STDIN>;
Good but it would have to print out "Press Enter to continue..."
Thanks though.
--
TMTOWTDI: My way tends to be wrong...
lmoran@wtsg.com
------------------------------
Date: Wed, 17 Oct 2001 09:20:17 -0600
From: Ron Reidy <rereidy@indra.com>
Subject: Re: Looking for DOS equiv to pause
Message-Id: <3BCDA1B1.A8F4C73C@indra.com>
Lou Moran wrote:
>
> I have searched the perldocs for a perl verison of the DOS command
> pause.
>
> Currently I am using:
> my $pause eq (`pause`) ;
> Which is fine since I run this on Windows but I was looking for the
> Perl version.
>
> Pointers? Better places to look. The right term?
>
> thanks
>
> --
> TMTOWTDI: My way tends to be wrong...
> lmoran@wtsg.com
use Term::ReadKey;
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
------------------------------
Date: 17 Oct 2001 10:47:54 -0700
From: muabao@hotmail.com (Mua Bao)
Subject: Re: Manipulating Strings Within A Text File
Message-Id: <f15abf0e.0110170947.2ae6fe5a@posting.google.com>
Hi Garry,
Thank you for helping me out. I'm embarassed to say that I'm a
complete beginner to Perl.
Your line of code works on the command line, I take it?
So if I'm to put that into a .pl file, what would the syntax be like?
How do I open the .txt file, read the value, & write the
newly-incremented value to that file?
Thanks a million,
MuaBao
> > How do I do that?
>
> perl -wpe 's/^(#define BUILD_VERSION )(\d+)/$1.($2+1)/e' filename
------------------------------
Date: Wed, 17 Oct 2001 09:59:28 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Module to get WIN PIDs
Message-Id: <if3rstkbispnq1631dnrb20cjksgb2nhd7@4ax.com>
--I am looking for a module to get WINXX PIDs so I can kill processes.
--The script would basically ask a user for the task names find their
corresponding PIDs and then issue a "kill" via backticks.
--Something like that out there? I am having a hard time finding such
a module. (actually I'm having a ahard time finding anything, maybe I
should go home.)
--
TMTOWTDI: My way tends to be wrong...
lmoran@wtsg.com
------------------------------
Date: Wed, 17 Oct 2001 10:58:19 -0700
From: Arnuga <arnuga@yahoo.com>
Subject: Re: Module to get WIN PIDs
Message-Id: <vkhrstsmoo3nlcmr7ikd0a9mnk5gc6eqhi@4ax.com>
Check the Win32::* modules...
Im pretty sure there is a Win32::Process module, or something similar
David S.
On Wed, 17 Oct 2001 09:59:28 -0400, Lou Moran <lmoran@wtsg.com> wrote:
>--I am looking for a module to get WINXX PIDs so I can kill processes.
>
>--The script would basically ask a user for the task names find their
>corresponding PIDs and then issue a "kill" via backticks.
>
>--Something like that out there? I am having a hard time finding such
>a module. (actually I'm having a ahard time finding anything, maybe I
>should go home.)
>
>
------------------------------
Date: 17 Oct 2001 07:51:00 -0700
From: Tmciver@yottanetworks.com (Tony McIver)
Subject: NMAKE error while installing Net-SNMP package
Message-Id: <d4289be7.0110170650.45de9aa7@posting.google.com>
I am trying to build the package for use on an WIN/2000 system so that
I can use the Perl module SNMP.PM in Perl scripts. Everthing build ok
using MS Visual C++. I did not build with the SSL support for SNMPv3.
When I execute nmake I get the error "SNMP.xs(26) : fatal error C1083:
Cannot open include file: 'unistd.h': No such file or directory"
------------------------------
Date: Wed, 17 Oct 2001 08:34:33 -0500
From: "Tony McIver" <tmciver@yottanetworks.com>
Subject: NMAKE error while installing SNMP module
Message-Id: <C58F3EDF9FAD5A15.C9D1AF234F402479.0C127544CE417246@lp.airnews.net>
I am trying to build the net-snmp-4.2.2 package for use on an WIN/2000
system so that I can use the Perl module SNMP.PM in Perl scripts. Everything
built using MS Visual C++ correctly. When I execute nmake I get the error
"SNMP.xs(26) : fatal error C1083: Cannot open include file: 'unistd.h': No
such file or directory" How do I solve this problem? Any help would be
greatly appreciated.
Thanks in advance,
Tony McIver
------------------------------
Date: Wed, 17 Oct 2001 17:00:30 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: Objects: Setting defaults and calling themselves??
Message-Id: <OOiz7.4296$Gh2.1305871@news2.rdc1.bc.home.com>
In article <86669fd63w.fsf@jon_ericson.jpl.nasa.gov>,
Jon Ericson <Jon.Ericson@jpl.nasa.gov> writes:
>Ed Kulis <ekulis@apple.com> writes:
>
>> use lib ".";
>
>This is ok for testing, I guess, but it will break when you call the
>script from some other directory. Consider using absolute pathing and
>the PERLLIB environment variable.
Not to mention that it is in @INC by default unless you're root...
--
Peter Scott
http://www.perldebugged.com
------------------------------
Date: Wed, 17 Oct 2001 11:48:27 -0600
From: Mark Winter <mwinter@nrel.nrel.gov>
Subject: pcl printer codes
Message-Id: <3BCDC46B.141BD984@nrel.nrel.gov>
Hello,
I am trying to write a perl program that embeds a HP printer code in the
file useing something
like this:
print(OUT"ord(027) ord(038) ord(108) ord(054) ord(103) \n");
which tells a HP printer what bin to use.
How can I do this either with a print command or a vi 'ed header file.
Thank you in advance.
MW
------------------------------
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 1946
***************************************