[10429] in Perl-Users-Digest
Perl-Users Digest, Issue: 4022 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 20 15:03:48 1998
Date: Tue, 20 Oct 98 12:01:39 -0700
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, 20 Oct 1998 Volume: 8 Number: 4022
Today's topics:
Re: Perl Y2K copmliance (William D. Reardon)
Re: Perl Y2K copmliance (Patrick Timmins)
Re: Question... (Steve Linberg)
Re: Question... (Daniel Beckham)
Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi <perlguy@technologist.com>
Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi droby@copyright.com
Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi <eashton@bbnplanet.com>
Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi <jdporter@min.net>
Randal's Big Day in Big D (Brand Hilton)
Re: Randal's Big Day in Big D <uri@camel.fastserv.com>
Request for Perl script that emulate Remote Shell (Tamir Hagit)
Re: Rounding Problem (Larry Rosler)
Re: Sambar help (Steve Linberg)
Re: Simple parsing of string - Thanks ! (Greg)
Re: Strict and Global Variables <uri@camel.fastserv.com>
Re: strip leading zeros (Mike Stok)
Re: Tilde delimited parsing <perlguy@technologist.com>
Re: values out of a routines <rootbeer@teleport.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 20 Oct 1998 16:51:54 GMT
From: wdr1@pobox.com (William D. Reardon)
Subject: Re: Perl Y2K copmliance
Message-Id: <F14xII.BJH@midway.uchicago.edu>
In article <fl_aggie-2010980942030001@aggie.coaps.fsu.edu>,
I R A Aggie <fl_aggie@thepentagon.com> wrote:
>In article <F14nAF.po@midway.uchicago.edu>, wdr1@pobox.com (William D.
>Reardon) wrote:
>+ Well, since it affects Microsoft systems, and Perl runs on
>+ Microsoft systems, in the end, a person's Perl program may not work as
>+ expected in the year 2000. While the problem is not particular to
>+ Perl, it may be something that a Perl programmer need be aware of.[1]
>+ I'd call that appropriate for clp.misc & on topic for this thread.
>
>I wouldn't.
Well, read the charter for clp.misc - "... comp.lang.perl.misc,
which will remain an unmoderated newsgroup for discussion of issues of
all sorts relating to perl."
>+ [1] Depending, of course, on if the Win32 versions of Perl do have
>+ this problem. (I don't know, but would like to.)
>
>The most straight forward way is to obtain the time from the OS. That's
>how its done under unix, anyway.
And this relates how? I use gmtime or localtime. Do the
Win32 versions obtain time correctly? I think that's a legitamite question.
-Bill
--
William Reardon ---- http://www.nhma.com/~wdr1/ ---- wdr1@pobox.com
I wish I was the radio song, the one that you couldn't turn up
------------------------------
Date: Tue, 20 Oct 1998 18:36:25 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Perl Y2K copmliance
Message-Id: <70il7a$26q$1@nnrp1.dejanews.com>
In article <F14nAF.po@midway.uchicago.edu>,
wdr1@pobox.com (William D. Reardon) wrote:
> In article <70hpgu$s83$1@pilot.njin.net>,
> David Alan Black <dblack@pilot.njin.net> wrote:
[snip]
> >I don't see a single reference to Perl in this article. It's all about
> >the BIOS on PCs, and how it interacts with Micros**t.
> >
> >Please (yawn) check out the usual archives and references for this
> >topic as it actually relates to Perl.
>
> Well, since it affects Microsoft systems, and Perl runs on
> Microsoft systems, in the end, a person's Perl program may not work as
> expected in the year 2000. While the problem is not particular to
> Perl, it may be something that a Perl programmer need be aware of.[1]
> I'd call that appropriate for clp.misc & on topic for this thread.
>
> -Bill
Well, since it affects cash register systems, and I buy my avocados
at cash registers, it's an avocado problem. :)
Patrick Timmins
$monger{Omaha}[0]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 20 Oct 1998 13:08:34 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Question...
Message-Id: <linberg-2010981308340001@ltl1.literacy.upenn.edu>
In article <362dabf8.26334974@news.icm.edu.pl>, jurek@univcomp.waw.pl
(Jerzy Orzeszek) wrote:
> Hello,
> I need to run script like this
> enter first_number
> enter second_number
> exec( "find / -size -first_number -size -second_number -exec ls -l
> {}\;
> exit;
>
> any help?
What do you need help with?
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: Tue, 20 Oct 1998 13:59:54 -0400
From: danbeck@eudoramail.com (Daniel Beckham)
Subject: Re: Question...
Message-Id: <MPG.109699a2e8409f17989694@news.supernews.com>
hehe, I think he need help getting input from STDIN
Try this:
$input = <STDIN>;
This will read a line of input from the console.
And instead of using the exec function, just use the backtics.
`find / - size -fi...`;
In article <linberg-2010981308340001@ltl1.literacy.upenn.edu>,
linberg@literacy.upenn.edu says...
> In article <362dabf8.26334974@news.icm.edu.pl>, jurek@univcomp.waw.pl
> (Jerzy Orzeszek) wrote:
>
> > Hello,
> > I need to run script like this
> > enter first_number
> > enter second_number
> > exec( "find / -size -first_number -size -second_number -exec ls -l
> > {}\;
> > exit;
> >
> > any help?
>
> What do you need help with?
> _____________________________________________________________________
> Steve Linberg National Center on Adult Literacy
> Systems Programmer &c. University of Pennsylvania
> linberg@literacy.upenn.edu http://www.literacyonline.org
>
------------------------------
Date: Tue, 20 Oct 1998 15:32:27 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <362CAD0B.D6EB3E2D@technologist.com>
Elaine -HappyFunBall- Ashton wrote:
> Free? I may be enough of a philanthropist to give Sparcs away to a good
> cause, but the beer, you buy. :) and buy me one as well.
I'll take a Sparc! Hell, I'd even buy you a beer for one :-)
Brent
--
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Tue, 20 Oct 1998 18:07:30 GMT
From: droby@copyright.com
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <70ijh2$9l$1@nnrp1.dejanews.com>
In article <362BFF9D.E9787B55@bbnplanet.com>,
Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:
> Adam Turoff wrote:
>
> > 100 scotches on tap?
>
> er, beers are on tap, scotches aren't :)
>
> > You're weird. Next you're going to be serving weissscotch with yeastybits
> > floating in it or even something icky like Belgian Trappist Scotch!
>
> I may be weird, but I know what I like. No Trappist beverages allowed.
>
And no Scotch is Belgian! Blech. Scotch is Scots.
> > Don't mess with a good thing here. No beer in the pub unless it's free.
>
> Free? I may be enough of a philanthropist to give Sparcs away to a good
> cause, but the beer, you buy. :) and buy me one as well.
>
> e.
Hey, I could use a Sparc at home. I may have to become Gloucester.pm. I'll
buy you a beer.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 20 Oct 1998 18:38:36 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <362CD625.1A991490@bbnplanet.com>
droby@copyright.com wrote:
> And no Scotch is Belgian! Blech. Scotch is Scots.
Scotch is made all over the world, but the Scots do seem to have more
bogs ;)
The Macallan 25 and Oban and Bowman are all from Scotland I believe.
> Hey, I could use a Sparc at home. I may have to become Gloucester.pm. I'll
> buy you a beer.
/me rumages around in office closet. Well, lessee, I have an IPC and a
3/260 on wheels I could spare :). Gloucester, England or Massachusetts?
e.
After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia. - U. Eco -
------------------------------
Date: Tue, 20 Oct 1998 14:59:26 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <362CDD8E.B6AA37DB@min.net>
Adam Turoff wrote:
>
> I'm not sure of the name, but it's the canonical example of legal
> scotch
> that's not blended in Scotland. The purveyor is a French blender who
> buys barrels after they've aged the minimum 3 (?) years on Scotland.
Now that's just too strange. The scotch makers prefer (IIRC)
to use used American bourbon casks. It seems that the second|later
batch of whiskey out of barrel is better than the previous.
Unless you're a bourbon fan. :-)
--
John "Gashlycrumb" Porter
"A fugitive and lurid gleam
Obliquely gilds the gliding stream." -- EG
------------------------------
Date: 20 Oct 1998 18:30:59 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Randal's Big Day in Big D
Message-Id: <70ikt3$7p217@mercury.adc.com>
Apologies to everyone for not getting this out sooner. My advanced
procrastination skills are occasionally a detriment.
Anyway, as many of you already know, Randal came to Dallas on October
3rd to give his Just Another Convicted Perl Hacker talk. If you're a
Perl Mongers leader, you REALLY need to take Randal up on his offer to
give this talk. The talk itself is very informative and entertaining,
and Randal is tons-o-fun to hang around with.
About 150 people packed into a conference room at the Doubletree Hotel
at Lincoln Center to hear the talk, and 25 or so hung around to buy
Randal beer at The Flying Saucer in Addison.
The event was co-hosted by the DFW Unix User Group. DFWUUG really
saved my bacon by getting a room for us and paying for it out of their
own pockets. They were then generous enough to offer Stonehenge
Consulting a free space for a year on their sponsors page.
Fun, fun, fun. I'm hoping we can get Randal back out next year to
give the same talk. I think we can get even more people now that I
kind of know what I'm doing. Keep your ears open.
--
_____
|/// | Brand Hilton bhilton@adc.com
| ADC| ADC Telecommunications, ATM Transport Division
|_____| Richardson, Texas
------------------------------
Date: 20 Oct 1998 14:52:28 -0400
From: Uri Guttman <uri@camel.fastserv.com>
Subject: Re: Randal's Big Day in Big D
Message-Id: <saraf2rnk0j.fsf@camel.fastserv.com>
>>>>> "BH" == Brand Hilton <bhilton@tsg.adc.com> writes:
BH> give the same talk. I think we can get even more people now that
BH> I kind of know what I'm doing. Keep your ears open.
i kinda suspected you didn't know what you are doing at the perl quiz!
:-)
just another sore second place perl quiz hacker,
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Tue, 20 Oct 1998 17:51:34 +0200
From: Hagitt@pelephone.co.il (Tamir Hagit)
Subject: Request for Perl script that emulate Remote Shell
Message-Id: <A055BED34932D21198E30008C728F3FE045E03@POST1>
Hello All,
I need help in writing a script that will connect to a non UNIX machines and
do something
that look like remote shell, which means that the program should do telnet
to any other
machine, ask something, get an answer, print it and exit.
Any ideas....???
I try to use other packages like chat2.pl, telnet.pl but had problem with
these scripts.
I have perl5 and perl4 install on my HPUX machines.
Thanks
Hagit
------------------------------
Date: Tue, 20 Oct 1998 11:11:56 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Rounding Problem
Message-Id: <MPG.10967246f1c98700989827@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <70i3a0$hm9$1@nntp.gulfsouth.verio.net> on Tue, 20 Oct 1998
08:26:06 -0500, Drew <andrew.simpson@matcomcorp.com> says...
>
> I am having trouble rounding certain numbers.
> Originally I used sprintf to do the rounding, but
> when
>
> $var = 0.325;
> $rslt = sprintf("%.3f",$var);
>
> resulted in 0.324, I delved into all the FAQs,
> Perl sites, etc. and discovered that 0.325
> is stored as 0.32499999 --> to 20 places?
> When rounded it obviously becomes 0.324.
I have tested this on PA-RISC and Intel architectures, and in each case
its value is 0.32500000000000001000 and the rounded result of course is
0.325 .
> I then used the borrowed code
>
> sub roundnum
> {
> my ($number, $precision) = @_;
> $precision = 2 unless defined $precision;
> $number = 0 unless defined $number;
> my $multiplier = (10 ** $precision);
> return int(($number * $multiplier) + .5) / $multiplier;
> }
>
> which still seems to cause the same problems.
Not when I tried it. Even roundnum(0.3249, 3) comes out as 0.325 .
0.3249 * 1000 = 324.9
int (325.4) = 325
325 / 1000 = 0.325 +/- 1e-17
and that should print as 0.325 also. In fact it isn't until I try
printing 0.325 +/- 1e-15 that I get anything other than 0.325 .
> SYSTEM/VERSION INFORMATION
> SunOS 5.5.1 Generic_103640-20 sun4u sparc SUNW,Ultra-1
> This is perl, version 5.003 with EMBED
> built under solaris at Oct 31 1996 10:54:50
> + suidperl security patch
There must be something "special" about this architecture.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 20 Oct 1998 13:09:54 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Sambar help
Message-Id: <linberg-2010981309540001@ltl1.literacy.upenn.edu>
In article <362CA1FE.621A5E58@echo-on.net>, Errol <enyoung@echo-on.net> wrote:
> I cannot figure out what the URL of the file should be. Can you help me
> over this hump?
Your server documentation probably can. I'd start there, or ask your
question in a group about servers.
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: Tue, 20 Oct 1998 18:29:08 GMT
From: gdevittREMOVE@interport.net (Greg)
Subject: Re: Simple parsing of string - Thanks !
Message-Id: <362ed60e.13128107@news.eclipse.net>
Many thanks to those who took the time to reply !
Your suggestions did the trick, and I'm looking forward to becoming more
adept with this sort of thing.
Thanks again.
* Reply address modified to reduce spam.
------------------------------
Date: 20 Oct 1998 13:32:26 -0400
From: Uri Guttman <uri@camel.fastserv.com>
Subject: Re: Strict and Global Variables
Message-Id: <sarg1cjnnpx.fsf@camel.fastserv.com>
>>>>> "AQ" == Ala Qumsieh <aqumsieh@matrox.com> writes:
AQ> On Mon, 19 Oct 1998, Michael Girone wrote:
>> Hello. I'm trying to write a Perl script that is somewhat
>> optimized for speed. To this end, I'd like to use global
>> variables. I'd also, however, like to "use strict".
AQ> So far so good.
>> So, I was wondering if the way to have global variables while
>> satisfying strict was to both "my" and then "local" every global
>> variable at the outermost level of code. Like this:
AQ> Declaring your variables as lexical variables (using my()) will
AQ> localize them to your enclosing block. Thus, declaring my()
AQ> variables at the "outermost level of code" will make these
AQ> variables visible from everything within your program;
^^^^^^^
AQ> effectively, these variables becomes global to your program.
^^^^^^^
these my variables are global to the file, not the program. if you
included other perl code via use or require, that code would not see
these my vars.
your comment is only true if the program is a single file of perl code
with no outside code read in.
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: 20 Oct 1998 18:16:08 GMT
From: mike@mike.stok.co.uk (Mike Stok)
Subject: Re: strip leading zeros
Message-Id: <70ik18$qia@news-central.tiac.net>
In article <MPG.10967ab97412523e989690@news.supernews.com>,
Daniel Beckham <danbeck@eudoramail.com> wrote:
>$crazy_num = 000005;
>
>$crazy_num now equals 5, perl does it for you. =);
Maybe not...
$crazy_num = 000012;
is equivalent to
$crazy_num = 10;
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Tue, 20 Oct 1998 11:09:04 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Tilde delimited parsing
Message-Id: <362C6F50.C7061633@technologist.com>
What have you tried?
I just tried:
$x="REC HEAD~016967~~19980728~SAMPLE INSTRUCTIONS";
$x =~ tr/~/|/;
print $x,"\n";
And it worked fine...
HTH,
Brent
--
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Tue, 20 Oct 1998 18:22:34 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: values out of a routines
Message-Id: <Pine.GSO.4.02A.9810201120070.5534-100000@user2.teleport.com>
On Fri, 16 Oct 1998, Xavier Cousin wrote:
> open (IN,essai_automat);
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
> foreach $key (sort keys %Molec){ # OK with writing 2 but
> print STDOUT "Molec $d $key\n"; # not with writing 1 in case
> } # 1 %Molec seams to not exist
I'm not sure what the problem is. But you've never set $d anywhere in the
sample code you posted.
If these ideas don't help you to fix your problem, make an example program
which doesn't do what you expect. It should have fewer than ten lines.
When you post that, we should be better able to see what you're needing.
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4022
**************************************