[7520] in Perl-Users-Digest
Perl-Users Digest, Issue: 1147 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 8 18:17:16 1997
Date: Wed, 8 Oct 97 15:00:22 -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 Wed, 8 Oct 1997 Volume: 8 Number: 1147
Today's topics:
Re: "19971008" and (....)(..) <khera@kciLink.com>
Re: #!/usr/bin/perl for NT ??? (Faust Gertz)
Re: 64,000 Question (Abigail)
Re: [Q - newbie] Sockets and bi-directional communicati <kermit@ticnet.com>
Re: check password on shadow password system.. (O'Shaughnessy Evans)
Re: DATABASING IN PERL (HELP!) (Faust Gertz)
Date::Manip Minutes return??? rlindner@lse.fullfeed.com
Download site for NT version of Perl <girardj@primenet.com>
Re: E-mail a WWW file <rootbeer@teleport.com>
Re: Forcing numeric interpretation? (brian d foy)
Re: Forcing numeric interpretation? samdie@ibm.net
Re: Forcing numeric interpretation? samdie@ibm.net
Graham Barr: Public Apology <greg_wright@cmsinc.com>
Need To Clear Screen With Perl 5...? <todd@pca.net>
Net::Ftp on solaris 2.6 (Simon Lee)
Re: New Perl syntax idea <rootbeer@teleport.com>
Re: Passing Parameters from an HTML!! <rootbeer@teleport.com>
Re: Pro's and Cons - Sub's from Sub's? <rootbeer@teleport.com>
Re: Problem with script in LLama book (Faust Gertz)
Problems getting Perl to work with dbm files. <devans@atpco.com>
Syntax <josh@jersey.net>
Re: Trivial question: Can this syntax be cleaned up? (brian d foy)
Re: Where to get WIN95 Perl??? <reid@dt.wdc.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 08 Oct 1997 17:25:20 -0400
From: Vivek Khera <khera@kciLink.com>
To: Koos_Pol@bigfoot.com
Subject: Re: "19971008" and (....)(..)
Message-Id: <x7201woslb.fsf@kci.kciLink.com>
>>>>> "KP" == Koos Pol <Koos_Pol@nl.compuware.com> writes:
KP> ($year,$month) = ("19971008" =~ (....)(..))
KP> Why doesn't this return $year and $month? Instead, it returns the empty
KP> string. But I have a match on the first two, don't I?
Try
($year,$month) = ("19971008" =~ m/(....)(..)/)
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@kciLink.com Rockville, MD +1-301-258-8292
PGP/MIME spoken here http://www.kciLink.com/home/khera/
------------------------------
Date: Wed, 08 Oct 1997 21:44:30 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: #!/usr/bin/perl for NT ???
Message-Id: <343bfd54.7139975@news.wwa.com>
On 8 Oct 1997 19:39:49 GMT, "Authorized User"
<matthew.kravitz@systecinc.com> wrote:
>i know how to declare a perl script in unix, but how is this accomplished
>in NT?
>i wanted to avoid typing 'perl <script_name> .
Modify the Registry. I you _need_ more info than that, the you _need_
to read the FAQs. They can be found at
ftp://ftp.digital.com/pub/plan/perl/CPAN/doc/FAQs/FAQ/PerlFAQ.html and
ftp://ftp.digital.com/pub/plan/perl/CPAN/doc/FAQs/nt/Perl_for_Win32_FAQ.html
Streben nach Wahrheit
Faust Gertz
Philosopher at Large
"I've paid my dues in the dirty work of life and the world of sports.
And hey, basketball is a little monotonous now...I'd love to do a
L'eggs commercial, where I shave my legs onscreen. I want to do
feminine things that will make people be like, 'Oh, sh--.' I truly
believe there's a feminine side to every male in the world, and I
just want to bring it out and help people get in contact with their
femininity." -- Dennis Rodman
------------------------------
Date: 8 Oct 1997 21:46:55 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: 64,000 Question
Message-Id: <slrn63nvui.a8i.abigail@betelgeuse.rel.fnx.com>
Mike Stok (mike@stok.co.uk) wrote on 1499 September 1993 in
<URL: news:61gocp$ssc@news-central.tiac.net>:
++ In article <343bdec4.58695784@news.chickasaw.com>,
++ <unlisted@internet.com> wrote:
++ >Is there a way (easy way) using printf to have numbers printed out
++ >with a ',' where it is supposed to be? I am doing some math
++ >calculations and some of the results are like 64000.00456. I am using
++ >the &.2f to change that at 64000.00 but would like to have the comma's
++ >in there like 64,000.00 is there a way this can be done using printf?
++
++ Not using printf directly, but the FAQ (frequently asked questions) which
++ is at http://www.perl.com/ and can be found on any comprehensive perl
++ archive network (CPAN) site (the master is at ftp.funet.fi under
++ /pub/languages/perl/CPAN and the FAQs section is in the doc directory)
++ suggests:
++
++ How can I output my numbers with commas added?
++
++ This one will do it for you:
++
++ sub commify {
++ local $_ = shift;
++ 1 while s/^(-?\d+)(\d{3})/$1,$2/;
++ return $_;
++ }
++
++ $n = 23659019423.2331;
++ print "GOT: ", commify($n), "\n";
++
++ GOT: 23,659,019,423.2331
++
++ You can't just:
++
++ s/^(-?\d+)(\d{3})/$1,$2/g;
++
++ because you have to put the comma in and then recalculate your position.
Yeah, but it's running time is at least quadratic in the length of the
number. Grabbing the number, reversing it, add a , after each third
digit, then reversing it again is linear, and hence way faster (*):
s/^(-?\d+)/do {my $t = reverse $1; $t =~ s[(\d{3}(?=\d))][$1,]g; reverse $t}/e;
(*) Well, in the long run.
Abigail
------------------------------
Date: Wed, 08 Oct 1997 13:18:35 -0500
From: Kermit Tensmeyer <kermit@ticnet.com>
To: "J. Gregory Wright" <greg_wright@cmsinc.com>
Subject: Re: [Q - newbie] Sockets and bi-directional communication
Message-Id: <343BCE7B.325AB098@ticnet.com>
J. Gregory Wright wrote:
>
> J. Gregory Wright <greg_wright@smsinc.com> wrote in article
> <01bcd27a$d1ac3be0$990d10ac@gregw-pc.cmsinc.com>...
> > J. Gregory Wright <greg_wright@smsinc.com> wrote in article
> > <01bcd272$7d3596e0$990d10ac@gregw-pc.cmsinc.com>...
> >
> > [ snip ]
> >
> > > My experience with socket programs in 'C' indicates that this should
> > > work, but both the client and the server hang (and I never see the output
> > > from the 'logmsg "Received..." line in the server).
> First of all, my apologies to anyone who responded to my post via E-mail -
> typos in newsreader profiles can cause problems with reply-to-addresses.
> The sole exception to this apology is Graham Barr <gbarr@ti.com>,
> whose response was forwarded to me by the folks at "smsinc.com":
<softly> the author of the package that deals with sockets
of the form Net::XX
where XX is IO, FTP, Telnet and a whole host of other is
Graham Barr.
In this area, he is as highly regarded as Larry Wall.
<all praise....>
>
> >Surly your experience with C code should tell you that using
> >stdio and sockets do not mix. You shold be calling sysread,
> >syswrite and using select to determine if there is any data
> >on the socket.
>
> [flame on]
> This is the kind of snotty help that gets folks on these newsgroups
> labelled as "jerks", "creeps" and "dweebs". I attempted to follow
> general rules of ettiquette by supplying as much information as
> possible, and pointed out that I was taking my examples from
> Wall's book, which *does* show using 'print SOCK' and '$var = <SOCK>'
> for I/O.
I think _you_ used the example of your knownleged of C and sockets
to initiate the request for help.
to use that form requires that an open be done on a file handle.
That particular format requires some other things be done
which were not shown in your request. None of which is
done by command line parameters but only by user written
code.
> A simple "The examples in the book are only good for
> connect-read data-disconnect" and "The standard way to do this
> is to use sysread / syswrite..." would have sufficed. Did you see
> "newbie" in the header? I did not claim to be an expert in Perl -
> I was taking an example in a well-respected book, and modify it
> to do something a little different. My posting to the newsgroup
> after sifting through web sites, FAQs and the books was an attempt
> to get an intelligent answer to my dilema, not a invitation for you
> to pump your flagging ego. Jerk.
> [flame off]
Graham Barr does not do that. In my experience, he has been most
gentle and kind, even with my rank stupid mistakes.
Is it possible that you have a first edition Perl book? (which
documents Perl 4) The IO and Net:: modules are examples of
Perl 5.
The documents (pod pages) get delievered with the source code
and are available with the standard installation. see the
sys admin (bofh)
of course if you are using the Activeware version of Perl
Nothing will work as described. ;-(
>
> At any rate, you *can* use 'print' and '<SOCK>' to do bi-directional
> I/O over a single socket connection, if you use the following code:
>
> my $oldfh = select(SOCK);
> $| = 1;
> select($oldfh);
>
> which turns on auto-flush for output operations on the pipe. It makes
> data available to the other side as soon as the output record separator
> character is encountered in the output stream. This was derived from
> the responses to the article titled "fflush".
>
> Is this the most optimal way to go about doing this? Probably not...
> but I would need some input on the second part of my question, which
> had to do with the use of the IO::Socket library:
>
> >Now one thing I have noticed from digging around in the newsgroup is
> >that most folks seem to be using the IO::Socket library, instead of the
> >"use Sockets". Did I miss something?
>
> Is this a better way to do things? And when did it show up (as in, which
> version of Perl).
>
> Thank you in advance (and my apologies to those who were not the target
> of the "flame" segment of the message for the outburst).
>
> --
> Gregory Wright
> Credit Management Solutions, Inc.
> greg_wright@cmsinc.com
--
-------
Kermit Tensmeyer (E & T - Networking)
Kermit@ticnet.com Dallas
------------------------------
Date: 8 Oct 1997 20:29:22 GMT
From: shaug@callamer.com (O'Shaughnessy Evans)
Subject: Re: check password on shadow password system..
Message-Id: <61gqf2$cc4$1@ha1.rdc1.occa.home.com>
In article <ask-0610970341310001@balder.netcetera.dk>,
ask@netcetera.dk (Ask Bjxrn Hansen) writes:
> Hi,
>
> How can I check a password on a system with shadow passwords? getpwnam
> just returns 'x' in the password field (as it should do afaik). Do I have
> to create a suid program just to do this?
Just like everyone else said, you've gotta be root (AFAIK). Here's a
script I use for checking a login/password pair. It has to run setuid
root. I call it from another perl script using system(), and then
check the return value. If it's zero, there's a match. If it's 1,
there's no match. If it's 2, there was an error. It's worked for me
so far, but YMMV. And, of course, I encourage you to check it out
before using it ... I'm certainly capable of missing security concerns
here. If there are any problems with it, security-related or otherwise,
I'd appreciate comments from more knowledgeable people in this group.
#!/bin/perl -T
# Compare two passwords, returning non-zero if equal, zero otherwise.
sub check_pwd
{
my($pwd1, $pwd2) = @_;
my $salt = substr $pwd1, 0, 2;
return crypt($pwd2, $salt) eq $pwd1 ? 0 : 1;
}
# Read in the encryped password for $login from the file $shadow
# Arguments: 1 - path to password file
# 2 - account login to find password of
#
# Returns: password found - encrypted password for $login
# password not found - `undef' value
# error reading $pwfile - "" (empty string)
sub read_pwd {
my($pwfile, $login) = @_;
local(*PWFILE);
open(PWFILE, $pwfile)
or ( print STDERR ("Couldn't open $pwfile: $!"), return "" );
$< = $>; # set real uid to effective uid
($() = split(' ', $), 2); # set real gid to effective gid
# Find the entry of $login and grab the encrypted password from it.
my($enc_pwd);
while (<PWFILE>) {
if (/^$login:/) {
$enc_pwd = (split(':', $_))[1];
last;
}
}
close PWFILE;
return $enc_pwd;
}
BEGIN {
$def_pwd_file = "/etc/shadow";
$SLEEP_TIME = 2;
$< = $>; # set real uid to effective uid
($() = split(' ', $), 2); # set real gid to effective gid
}
my ($login, $test_pwd, $pwd_file) = @ARGV;
if ($#ARGV < 1) {
print STDERR "Usage: check-password <login > <password> ",
"[ <passwd file> ]\n";
exit 3;
}
if (!defined $pwd_file or $pwd_file eq "") {
$pwd_file = $def_pwd_file;
}
my $real_pwd = read_pwd($pwd_file, $login);
if (!defined $real_pwd) { # login not found
print STDERR "Error: login $login not found.\n";
exit 2;
}
elsif ($real_pwd eq "") { # problem opening $pwd_file
exit 2;
}
else {
my $status = check_pwd($real_pwd, $test_pwd)
or sleep $SLEEP_TIME;
exit $status;
}
--
O'Shaughnessy Evans -
http://www.callamer.com/shaug -
UNIX Sys Admin, GST Call America; San Luis Obispo, California -
------------------------------
Date: Wed, 08 Oct 1997 19:55:59 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: DATABASING IN PERL (HELP!)
Message-Id: <343be108.239747@news.wwa.com>
On Thu, 09 Oct 1997 06:04:33 +0200, || Fains || <fain@actcom.co.il>
wrote:
>OK, if you are willing, I have another question.
>in your example (and something I see everywhere):
>my ($company_name, $date, $number, $description) = split /\s+/, $_, 4;
I didn't know my example was so popular. :-)
>you use = split /\s+/, $_, 4;
>what does that do exactly (what does /\s+ do as opposed to some other
>combination), how does it affect:
>my ($company_name, $date, $number, $description)
>?
I'll try, but, as I often give bad information, you should consult the
other documentation I cited in my last article. :-) Seriously, the
documentation is much more accurate than anything I will write here.
split / /
will split the line on every _single_ space, causing a line with
consecutive spaces to return undefined strings.
($company_name, $date, $number, $description) = split / /, "Company
08/01/04 ##### We rock!";
would give you
($company_name, $date, $number, $description) = ("Company", undef,
"08/01/04", undef);
split /\s+/
will split the line on every occurrence of white space at least one
character long, where white space is defined as it is in UNIX, as any
blank space in a document [ \r\t\n\f]. The '\s' stands for the white
space and the '+' is the one or more occurrences part. This, in fact,
is the default pattern for 'split', so
split
is equal to
split /\s+/
So, now we know that
($company_name, $date, $number, $description) = split /\s+/, "Company
08/01/04 ##### We rock!";
will give us
($company_name, $date, $number, $description) = ("Company",
"08/01/04", "#####", "We");
I limited the number of fields for split to break the line into with
split /\s+/, $_, 4
so that $description would equal 'We rock' instead of just 'We'. That
is the problem you might have with using split with the way your data
is structured and that is why I told you to look elsewhere for more
information. I don't believe that white space is going to be your
delimiter. The advice Benjamin Holzman <bholzman@mail.earthlink.net>
gave you is probably better than mine.
>The database that I am trying to use looks like this (a sample line from the
>actual file):
>-2 open pc386 AIM386 CT906M00022 132.65.181.8 utp pcftp2 42 - 640 + * * *
>12-1-2-6
>each space you see (" ") makes a different cell. What I need to do is make my
>perl program split the line by each space (not commas or anything else) and
>make a variable like what was in your example.
>how would I have to change this: = split /\s+/, $_, 4;
>in order to make it work?
If you look at the documentation and what I have said, I think you can
figure it out for yourself. I can't learn this for you and, remember,
I give lots of bad information. :-)
>I will definitely look for the books you suggested (although I don't know how
>available they will be here in Israel)
I imagine you can find a way to get them. If you can get just one and
are on a Unix platform, get _Learning Perl_.
HTH
Faust Gertz
Philosopher at Large
"Our music is pure art. Like I'm moving, I'm creating the truth. I'm
not trying to entertain people, I'm playing the truth for those who
can listen. I realize that not everybody is capable of listening to
real beauty. Real beauty is beyond most people, it's only for a select
few. I'm hoping in the future that more people will listen. They'll
have to attune themselves to the truth." -- Albert Ayler
------------------------------
Date: Wed, 08 Oct 1997 16:03:27 -0600
From: rlindner@lse.fullfeed.com
To: rlindner@lse.fullfeed.com
Subject: Date::Manip Minutes return???
Message-Id: <876343713.898@dejanews.com>
I have figured out how to determine the time between two business dates
by using the Date::Manip routines as shown below. However this returns
the results in the Years:Months:Days:Hours:Minutes:Seconds format. What
I'm wondering is how can I display that value in hours alone? As in
1,232,234 hours. Can anyone offer any help with this?
Any help you can send my way is greatly appreciated. And thanks to those
of you who answered my previous post.
Bob
--snip--
#!/usr/bin/perl5
use Date::Manip;
$LastAccident = "March 11 11:23:00 1996";
$Evaltime = localtime;
$pd1=&ParseDate($LastAccident);
$pd2=&ParseDate($Evaltime);
$delta= &DateCalc($pd1, $pd2, \$err, 2);
$years = (split(/:/,$delta))[0];
$years = $years * 1;
$months = (split(/:/,$delta))[1];
$days = (split(/:/,$delta))[2];
$hours = (split(/:/,$delta))[3];
$mins = (split(/:/,$delta))[4];
$secs = (split(/:/,$delta))[5];
#inform content type
print "Content-type: text/html\n\n";
#start html
print "<HTML><HEAD><TITLE>AVS Group</TITLE></HEAD>\n";
print "<BODY bgcolor=\"FFFFFF\">\n";
print "<h2>Since it is now $Evaltime\n<BR>and our last accident was on
$LastAccident\n<BR>we have been";
print " accident free for<BR><UL><LI>$years year(s)<LI>$months month(s)
<LI>$hours hour(s)<LI>$mins minute(s)<LI>$secs second(s).\n</ul></h2>";
print "</body></html>\n";
--snip--
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 8 Oct 1997 14:27:00 -0700
From: "Jeff Girard" <girardj@primenet.com>
Subject: Download site for NT version of Perl
Message-Id: <01bcd430$fe7aa320$78da1b8a@girardj.army.mil>
The www.perl.com only has the download in latest.tar.gz format. Can
someone please point me to a source for Perl (preferably the latest
version) in Winzip format?
Jeff
------------------------------
Date: Wed, 8 Oct 1997 13:36:51 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Liam Bateman <liam@dircon.co.uk>
Subject: Re: E-mail a WWW file
Message-Id: <Pine.GSO.3.96.971008133441.26698K-100000@usertest.teleport.com>
On 8 Oct 1997, Liam Bateman wrote:
> from what little I know i s'pos I need to use cron ?
> and use the 'sendmail' program but I do not know how!
Sounds like a plan. To find out more about cron and sendmail, ask your
local expert, check the docs and FAQs, or (if those fail) look for
newsgroups about Unix in general (for cron) or on sendmail in particular
(for sendmail). Those sources can give you better and more complete
answers than we can here. Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Wed, 08 Oct 1997 16:25:20 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Forcing numeric interpretation?
Message-Id: <comdog-ya02408000R0810971625200001@news.panix.com>
In article <343bd3b3$2$fnzqvr$mr2ice@news-s01.ny.us.ibm.net>, samdie@ibm.net wrote:
>In <comdog-ya02408000R0810971329560001@news.panix.com>, on 10/08/97
> at 01, comdog@computerdog.com (brian d foy) said:
>
>> In article <343bb067$1$fnzqvr$mr2ice@news-s01.ny.us.ibm.net>, samdie@ibm.net
>> wrote:
[snip]
>> >I assume that,
>> >left to its own devices, perl would store the rates in the hash as strings.
>
>> why assume anything when you can read the man pages? in this case the
>> perldata man page answers your question.
>
>> good luck :)
>
>Maybe I just don't have good luck.
>
>Didn't find the answer beforehand; don't find it afterwards. Any chance you
>could provide some unambiguous string on which I could search in order to
>locate what you believe to be an answer?
read the perldata man page, starting from the beginning,
until you get to the part that answers your question (it's
only a few screenfuls of info and will enlighten you as to
how perl stores data). or just check out chapter 2 of
Learning Perl [1] (yes, that's how elementary this question
is - it's covered in the first chapter after the
introductory tour of Perl).
should you not want to read, just fool around with a bit of code and see
what happens :)
#!/usr/bin/perl
$data = 36;
print $data++, "\n";
print "$data\n";
print $data , ", $data++, " , $data++, "\n"; #trick question...
__END__
[1]
Learning Perl
Randal L. Schwartz & Tom Christensen
ISBN 1-56592-284-0.
<http://www.oreilly.com>
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 08 Oct 97 16:23:03 -0400
From: samdie@ibm.net
Subject: Re: Forcing numeric interpretation?
Message-Id: <343bef38$3$fnzqvr$mr2ice@news-s01.ny.us.ibm.net>
In <61gnv5$o1h@news-central.tiac.net>, on 10/08/97
at 07, mike@stok.co.uk (Mike Stok) said:
> In article <343bd3b3$2$fnzqvr$mr2ice@news-s01.ny.us.ibm.net>,
> <samdie@ibm.net> wrote:
> >> >Is there a way to force perl to store fields obtained by reading a file as
> >> >numbers?
> It doesn't matter that much, using the Devel::Peek module in the debugger:
> DB<1> use Devel::Peek
> DB<2> $foo{'bar'} = '1.23'
> DB<4> $x = $foo{'bar'} + 2
> DB<5> Dump $foo{'bar'}
> SV = PVNV(0x8144fa0)
> REFCNT = 1
> FLAGS = (NOK,POK,pNOK,pPOK)
> IV = 0
> NV = 1.23
> PV = 0x8114278 "1.23"
> CUR = 4
> LEN = 5
> Now I've used it as a number perl has stashed the numeric representation in
> there *as well as* the string reporesentation, both are marked as OK, so if
> I use the scalar as either a string or a number perl doesn't have to do any
> conversion
> So, as long as you don't change the scalar's value perl only does one
> conversion. If you do change the scalar's value then you pay the price of
> conversion again when it's needed in the "other" context e.g.
> I'm sure if I'm lying or mistaken someone will correct me, that's just my
> understanding as I try to avoid perl internals as a rule :-)
> Hope this helps,
Thank you. That is *just* the sort of answer that I was looking for.
--
-----------------------------------------------------------
samdie@ibm.net 199710080423 -0400
------------------------------
Date: Wed, 08 Oct 97 16:46:49 -0400
From: samdie@ibm.net
Subject: Re: Forcing numeric interpretation?
Message-Id: <343bfcba$4$fnzqvr$mr2ice@news-s01.ny.us.ibm.net>
In <comdog-ya02408000R0810971625200001@news.panix.com>, on 10/08/97
at 04, comdog@computerdog.com (brian d foy) said:
> read the perldata man page, starting from the beginning,
> until you get to the part that answers your question (it's
> only a few screenfuls of info and will enlighten you as to
> how perl stores data). or just check out chapter 2 of
> Learning Perl [1] (yes, that's how elementary this question
> is - it's covered in the first chapter after the
> introductory tour of Perl).
My question must have been poorly phrased, since you so completely
misunderstood its intent. In the meantime, however, someone else (despite the
poor phrasing, apparently) did manage to understand what I was asking and
posted the answer I sought.
Thanks, anyway, for your time and efforts.
--
-----------------------------------------------------------
samdie@ibm.net 199710080446 -0400
------------------------------
Date: 8 Oct 1997 21:13:23 GMT
From: "J. Gregory Wright" <greg_wright@cmsinc.com>
Subject: Graham Barr: Public Apology
Message-Id: <01bcd42f$919454a0$990d10ac@gregw-pc.cmsinc.com>
>From the e-mail responses I received from members of the group,
it appears that I have:
(a) Taken offense where it may not have been warranted, and
(b) given offense where it may not have been warranted.
So, since I "flamed" in public, it is only right that I apologise there:
To Graham Barr, for reading a tone of voice which I am told was
not (and is not typically) there, and for responding in public to a
e-mail which was sent to me alone. Apparently I did not observe
all points of newsgroup ettiquette, not the least of which is to
always treat the other person the way you would want to be treated.
To the newsgroup, for wasting the bandwidth.
Now I go to "lurk", and will be more careful posting in the future.
--
Gregory Wright
Credit Management Solutions, Inc.
greg_wright@cmsinc.com
------------------------------
Date: 8 Oct 1997 21:17:46 GMT
From: "Todd Carlton" <todd@pca.net>
Subject: Need To Clear Screen With Perl 5...?
Message-Id: <01bcd42f$b1eecd20$2c2a88cf@todd.pca.net>
I have two related questions. Both should be EASY for experienced perl
people...
(1) I'm converting some old basic programs to perl to run over telnet
sessions (don't ask...) and need to be able to clear the screen... Any idea
what the perl clear screen command is?!?!? (DOS=cls linux=clear)
(2) I wrote a script that outputs to a browser. I need it to auto-update
every two seconds without having to click the reload button. If I use a
goto label, the output just starts walking down the page over and over. I
either need to re-call the script every two seconds, or I need to
auto-forward the browser back to the script every two seconds. I tried
'system' and 'exec' WITHOUT SUCCESS.
I have very limited access to news, but e-mail flows freely. A reply to
todd@pca.net would make my day!
-Todd Carlton
------------------------------
Date: Wed, 08 Oct 1997 18:23:14 GMT
From: simon_lee~NoSpam~@super.zippo.com (Simon Lee)
Subject: Net::Ftp on solaris 2.6
Message-Id: <343bcc7e.2020815@snews.zippo.com>
Firstly if your name is Jeremy D. Zawodny ->go jump.
Ok,
My original machine was a sparc10 running sunos4.1.3, I'm now trying
to switch everything to solaris2.6 (different machine).
Anyway I did try a perl build using a leached gcc binary distribution
(and you know what happened).
So... I downloaded a binary disribution of perl 5.003 (built on
solaris2.6) all my forms and stuff are working fine, but I have a few
niggles;
Fistly the stdout unbuffered is not working (this might be the
webserver since I'm coming from nsca to the free solaris one(yea ok
they're both free..dugh))
The bit that had my head itching was a few .cgi's that use ftp
modules. I did a h2ph on the socket.h, then I tried using ftplib.pl
but I still got error messages 'Protocol not supported'. It looks like
I'm going to have to do my own perl build, but maybe you guys might
have a few more suggestions).
;)
Simon
------------------------------
Date: Wed, 8 Oct 1997 14:08:47 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: O'Shaughnessy Evans <shaug@callamer.com>
Subject: Re: New Perl syntax idea
Message-Id: <Pine.GSO.3.96.971008134419.26698O-100000@usertest.teleport.com>
On 8 Oct 1997, O'Shaughnessy Evans wrote:
> Since $self seems to be a somewhat "magical" variable anyhow, maybe
> it would be appropriate to make it one of the last few special-char
> variables: ${ or $}.
Not more punctuation mark variables! :-) But I think that ${ (at least)
has remained unused because the curly braces are used for too many other
things. I think this would be ambiguous code if ${ were a valid variable
name, but I don't know for sure. (Not that I'd ever use this in real
code... :-)
$foo = ${ & m } and m { bar }; # Huh?
> An object is a hash of sorts, or appears to be
> in some ways, so it sort of makes sense :)
Well, it might or might not be implemented as a hash, so you've got
something there... But I'd prefer a name like 'me' or 'self', one way or
another.
> I think it'd be cool, anyway. On the other hand, it could make code
> pretty hard to read, and would kill the "bounce on %" feature of vi.
And you can't sufficiently confuse vi with the current syntax? :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Wed, 8 Oct 1997 13:41:52 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Billy Messemore <messemor@netdoor.com>
Subject: Re: Passing Parameters from an HTML!!
Message-Id: <Pine.GSO.3.96.971008134012.26698N-100000@usertest.teleport.com>
On Wed, 8 Oct 1997, Billy Messemore wrote:
> I have tried the <!--#exec cgi="test.cgi"-->, but I could not
> figure out how to pass the parameters to the CGI.
If you can't find the answer in your server's docs and FAQs, or the ones
about the CGI spec, this would be a question to ask in a newsgroup
specific to CGI scripting or to servers, since those sources should be
able to give you a better and more-complete answer than we can here. Good
luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Wed, 8 Oct 1997 13:39:27 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: webmaster@proliferate.com
Subject: Re: Pro's and Cons - Sub's from Sub's?
Message-Id: <Pine.GSO.3.96.971008133835.26698M-100000@usertest.teleport.com>
On Tue, 7 Oct 1997 webmaster@proliferate.com wrote:
> I was wondering if anyone could point out the hazards of calling a
> subroutine from within another subroutine.
The perlsub(1) manpage should tell you everything you need to know, but if
you still have questions after you've read the docs and FAQs, please post
your Perl questions here. Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Wed, 08 Oct 1997 20:07:54 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Problem with script in LLama book
Message-Id: <343ce615.1532737@news.wwa.com>
On Wed, 08 Oct 1997 18:51:22 GMT, amacater@galactic.demon.co.uk
(Andrew Martin Adrian Cater [Andy]) wrote:
>No obvious reason why: I can't get the script on page 10 to
>work.
It is obvious to me. :-)
>It dies on the line with
>
>$secretword = $words(name);
>
>Perl -w throws up a warning about that line which tells me nothing.
>Script is typed verbatim from the book.
I don't have a Llama Book in front of me, but I am almost sure that
Randal would have written
:$secretword = $words{$name};
and not
:$secretword = $words(name);
as the former would take the value of the scalar variable called
'$name' and use it to look up the secret word in the hash called
'%words' and assign it to the scalar variable called '$secretword'.
HTH
Faust Gertz
Philosopher at Large
Yet another famous Proof of P
Hillary Putnam:
Some philosophers have argued that not-p, on the grounds that q.
It would be an interesting exercise to count all the fallacies in
this "argument". (It's really awful, isn't it?) Therefore p.
------------------------------
Date: Wed, 08 Oct 1997 16:11:12 -0400
From: David Evans <devans@atpco.com>
Subject: Problems getting Perl to work with dbm files.
Message-Id: <343BE8E0.26A3@atpco.com>
I am trying to set up Perl 5.004.01 on a Sun Spar20, running Solaris
2.5.1.
I have tried to run the following small Perl script:
#!/app/perl5.004_01/perl
dbmopen(%DB, "./gctest", 0666) || die "Error: $!\n";
dbmclose(%DB);
exit;
It errors out with the following:
No dbm on this machine at ./gctest.pl line 2.
What is causing this error, and what does it mean?
After running configure and make, I ran test and notice that it skipped
the following tests with the message "Skipping test on this platform::
db-btree, db-hash, db-recno and gdbm. It also failed the test 3 of the
filehand test. What are the implications of skipping these tests on my
machine? Are these errors related to the failure of my script?
David Evans
Army Times Publishing Company
------------------------------
Date: Wed, 08 Oct 1997 17:17:28 -0400
From: Josh <josh@jersey.net>
Subject: Syntax
Message-Id: <343BF868.7A28@jersey.net>
How would I test to see if $test is equal to either 0 or 1 or 2 or x or
X. Nothing else and not a combination of 2 or more.
Thanks :)
Josh
josh@jersey.net
------------------------------
Date: Wed, 08 Oct 1997 16:08:36 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Trivial question: Can this syntax be cleaned up?
Message-Id: <comdog-ya02408000R0810971608360001@news.panix.com>
In article <343bbc2a.0@cfanews.harvard.edu>, rpete@ascda3.harvard.edu (Pete Ratzlaff) wrote:
>Suppose I have a sub which returns array references...
>
>sub return_array_refs {
> return ( [qw(ya ya ya)], [qw(da da da)])
>}
>
>and I want to make arrays from these returned refs.
>Here is how I do it:
>
>my @tmp=return_array_refs();
>my @a1=@{$tmp[0]};
>my @a2=@{$tmp[1]};
>
>Is there a way to shorten the above three lines of code
>to just one line? Note that the use of semicolons does
>not count...
no semi-colons? okay...
probably not the solution you would like to use, but symbolic
references are fun to play with...
#!/usr/bin/perl -wT
#as requested, there are no semi-colons
BEGIN { srand }
#something to play with later
sub gimme_anonymous_arrays
{
return (
[eval(eval(q[sprintf q<int(rand(6)), > x int(rand(6)+1)]))],
[qw(a b c)]
)
}
#here's the line that you wanted. notice how we can use a
#variable's value as a symbolic reference (only works for
#global variable though).
foreach( gimme_anonymous_arrays ) { @{$count++} = @$_ }
#just to show you that there are some arrays
foreach( 0..$count-1 ) { foreach( @$_ ) { print "$_\n" } }
__END__
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 08 Oct 1997 13:51:08 -0700
From: Bruce Reid <reid@dt.wdc.com>
To: Norbert McKenna <norbmckenna@sprynet.com>
Subject: Re: Where to get WIN95 Perl???
Message-Id: <343BF23C.EFC56FCE@dt.wdc.com>
I connected to www.activeware.com just now with no trouble, and found
the following FTP site that you might try:
ftp://ftp.linux.ActiveState.com/pub/Perl-Win32/Release
Their web page also provides the following instructions for how to
obtain Perl for Win32 via email:
Send email to ListManager@ActiveState.com with the one of the following
commands in the text of the message:
GET perl-win32-announce Pw32i310.exe (Perl for Win32 Intel/x86 binary)
GET perl-win32-announce PlSEi310.exe (PerlScript Intel/x86 binary)
GET perl-win32-announce PlISi310.exe (Perl for ISAPI Intel/x86 binary)
GET perl-win32-announce Pw32a310.zip (Perl for Win32 Alpha binary)
GET perl-win32-announce PlSEa310.zip (PerlScript Alpha binary)
GET perl-win32-announce PlISa310.zip (Perl for ISAPI Alpha binary)
GET perl-win32-announce Pw32s310.zip (Perl for Win32 Source Files)
Hope that helps
--
Bruce Reid
Western Digital Corp.
(714) 932-5143
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 1147
**************************************