[6427] in Perl-Users-Digest
Perl-Users Digest, Issue: 52 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 5 01:07:34 1997
Date: Tue, 4 Mar 97 22:00:17 -0800
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, 4 Mar 1997 Volume: 8 Number: 52
Today's topics:
Re: Autostart perl program <fritz@fuse.net>
Comparing various srtings in a database <psaltis@cris.com>
Exporter doesn't (Ofer Inbar)
Re: Forms AHHHH...Help !!! nickp@futuris.net
Re: ftp.pl - Protocol not supported <tchrist@mox.perl.com>
Re: Initializing array contents to all zeros (Dave Thomas)
Re: Looking for Interactive Training CD-ROM for Perl (Paul Downing)
Re: Mail an attatchment with Perl (Jeremy)
NT 4.0 Perl 5 (Lon Hosford)
Re: PERL script for HTTP transfer ? (Ken Yap)
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 04 Mar 1997 23:27:48 -0500
From: Fritz <fritz@fuse.net>
Subject: Re: Autostart perl program
Message-Id: <331CF644.1802@fuse.net>
rlgolden@ngeorgia.com wrote:
>
> How do I tell a perl program to run at a certain time, even if I am not
> online? Please email an answer.
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
crontab...if you're on a Unix system
fritz@fuse.net
------------------------------
Date: 5 Mar 1997 05:30:59 GMT
From: "Andrew" <psaltis@cris.com>
Subject: Comparing various srtings in a database
Message-Id: <01bc2926$0a75ce40$4ca0adce@courtney>
Hi all, just a real quick question...
I am trying to write a perl script that will open a specific file (a sybase
database file on a RS6000 running AIX ) read in a line of data and then
compare it to all of the other lines of data in the file. And then repeat
the process with the next line of data, thus moving down the file comparing
each line to each other line and writing a file that lists all of the
duplicate records
Opening and reading the whole file is not a problem, the problem is trying
to comapare the first line read in to all the others and then repeating
that process and writing the file that of all duplicate records.
All help is greatly appreciated..
Thanks
Andrew Psaltis
psaltis@cris.com
axpsalt@rmhcc.com
------------------------------
Date: 5 Mar 1997 00:22:04 -0500
From: cos@zax.whoville.leftbank.com (Ofer Inbar)
Subject: Exporter doesn't
Message-Id: <5fivts$kt4@zax.whoville.leftbank.com>
This is perl, version 5.003 with EMBED
built under sunos at Nov 12 1996 11:07:30
+ suidperl security patch
I've got a perl script that looks sort of like this:
#!/usr/bin/perl
use MyModule 0.01;
print "script: $variable\n";
print "script qualified: $MyModule:variable\n";
exit;
----------------------------------------------------------------------
And then I've got MyModule which looks sort of like this:
package MyModule;
require Exporter;
@ISA = (Exporter);
@EXPORT = (variable);
@EXPORT_OK = (variable);
$VERSION = '0.01';
BEGIN { $variable = "goodvalue" }
print "module: $variable\n";
----------------------------------------------------------------------
When I run the script, I get this sort of output:
# runscript
module: goodvalue
script:
script qualified: goodvalue
#
So, what happened to the goodvalue of $variable in package main? Am I
misunderstanding how Exporter is supposed to work? This looks just
like the examples in the Camel. I've tried taking out the EXPORT_OK
definition, I've tried naming variable directly on the "use" line...
-- Cos (Ofer Inbar) -- cos@leftbank.com cos@cs.brandeis.edu
-- The Left Bank Operation -- lbo@leftbank.com http://www.leftbank.com/
"GUIs normally make it simple to accomplish simple actions and impossible to
accomplish complex actions." --Doug Gwyn (22/Jun/91 in comp.unix.wizards)
------------------------------
Date: Tue, 04 Mar 1997 22:11:37 -0600
From: nickp@futuris.net
Subject: Re: Forms AHHHH...Help !!!
Message-Id: <857530365.18437@dejanews.com>
In article <3315518f.1678832@news.demon.co.uk>,
mark@channelzero.demon.co.uk wrote:
>
> This is rather sad, i need desperate help with creating html forms. I
> can create the front end (ie. the actual bit where the user types in
> the info.) but i can't get it to process and e-mail the info to the
> address that i give it.
This is actually very simple. just specify the method and post attributes
at the begining in the form tag itself, like this:
<Form action="mailto:me@myplace.net" method=post Enctype=text/plain>
The enctype attribute just will make sure the returned information is
written in plain text, and not raw ASCII.
It's all explained in detail in my forms tutorial at:
http://www.futuris.net/nickp/tags/forms/
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 5 Mar 1997 03:47:31 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: ftp.pl - Protocol not supported
Message-Id: <5fiqcj$5rm$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
"Kevin L. Gross" <klg@westweb.com> writes:
:Hi,
:
:I used ftp.pl, chat2.pl and sys/socket.ph to write an automated ftp
:script in Perl5. It works flawlessly on BSDI, but when I try to run it
:between two Sun machines (solaris->sunos) or (solaris->solaris) I get
:this error:
:
: Protocol not supported at ./myprog line 64.
:
:Any idea what is going on here?
Q: Why doesn't my sockets program work under System V (Solaris)?
What does the error message "Protocol not supported" mean?
A: Some Sys-V based systems, notably Solaris 2.X, redefined some of the
standard socket constants. Since these were constant across all
architectures, they were often hardwired into perl code. The proper
way to deal with this is to "use Socket" to get the correct values.
Note that even though SunOS and Solaris are binary compatible, these
values are different. Go figure.
In short, those old libraries are outdated and fatally flawed.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
If you want to see useful Perl examples, we can certainly arrange to have
comp.lang.misc flooded with them, but I don't think that would help the
advance of civilization. :-) --Larry Wall in <1992Mar5.180926.19041@netlabs.com>
------------------------------
Date: 5 Mar 1997 05:19:43 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Initializing array contents to all zeros
Message-Id: <slrn5hq0cs.81u.dave@fast.thomases.com>
On 04 Mar 1997 13:02:04 -0500, eliot@dg-rtp.dg.com wrote:
> I need to create a lot of arrays and initialize their elements to zero.
> I want to initialized them explicitly because I may well read various
> elements before writing them, and perl -w burps out many screenfuls of
> warnings about using uninitialized values.
> Since I generally create several arrays of the same size at the same time,
> I have written a routine that takes one size parameter, and references
> to one or more arrays. It is:
>
> sub InitializeArrays {
> my $size = shift @_;
> my $firstarray = shift @_;
> my $otherarray;
>
> $#$firstarray = $size - 1;
> foreach $index (0 .. ($size - 1)) {
> $firstarray -> [$index] = 0;
> }
I don't know about better, but some observations:
- if your arrays are truely big, then this routine costs you big-time in
memory - the (0..($size-1)) construct actually constructs a list to hold
the values, so you are (at least temporaily) allocating twice what you need.
- if that's not an issue, a slightly faster way might be:
$#array = $size - 1;
@array = map { 0 } @array;
again, there's two arrays in here.
I suspect that in 5.004 we might be able to do
$#array = $size - 1;
map { $_ = 0 } @array;
But I'm still running 5.003_27.
- Otherwise, a more simple loop would save memory
for $index (0..$#array) {
$array[$index] = 0;
}
HOWEVER -
as of Perl 5.004, you may not have to worry - many of the warnings about
$a += 1;
where $a is undefined have been suppressed - undef is treated as zero. This
_is_ in my (somewhat old) development version:
dave[~/tmp 23:14:21] perl -w
my $last_subscript = 9999;
$#array = $last_subscript;
$array[5000] += 3;
print $array[5000], "\n";
3
Regards
Dave
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Wed, 05 Mar 1997 04:22:20 GMT
From: enc@pobox.com (Paul Downing)
Subject: Re: Looking for Interactive Training CD-ROM for Perl
Message-Id: <331cf48d.2916527@207.126.101.80>
On Fri, 21 Feb 1997 11:54:07 -0700, Rocky Kahn
<rokahn@hplb.hpl.hp.com> wrote:
>Looking for Interactive Training CD-ROM for Perl
>Any advice?
>
>Rocky Kahn
>rokahn@hplb.hpl.hp.com
I just saw at Barnes & Noble (big bookstore chain) a new series of
books called "Interactive <insert language here>". It has a CD and
gives you access to their website where you can take online tests and
if you pass all of them, you get a certificate. Check 'em out.
Paul Downing
------------------------------------------------------------
Enterprise Network Consulting / owner
Baker, Louisiana
E-mail: enc@pobox.com
-------------------------------------------------------------
------------------------------
Date: Wed, 05 Mar 1997 04:19:58 GMT
From: parrothd@hotmail.com (Jeremy)
Subject: Re: Mail an attatchment with Perl
Message-Id: <331cf408.18150204@news.netexpress.net>
On 4 Mar 1997 02:08:36 GMT, a00lcj00@elc012.nchc.gov.tw (Cheng Tyh
Lin) wrote:
>Hi,
> How can I do that if I want to attatch a file(not an plain text, such as
>tgz, zip...) after an mail? This may be useful if the file is too large
>to download or the network speed is so slow. By using this method, it may
>save much time to download from abroad on the web! Is there somebody could
>tell me how to do that or how to find the tools.
> Thanks in advance.
>
>Lin.
Check out http://worldwidemart.com/scripts/ it is matts script
archive he has a script that does just that.
Jeremy
------------------------------
Date: Wed, 05 Mar 1997 05:06:16 GMT
From: lon@hosfordusa.com (Lon Hosford)
Subject: NT 4.0 Perl 5
Message-Id: <331dfef1.1379944@news.eclipse.net>
Is it possible to run and learn Perl 5 if you have a NT 4.0
Workstation?
And if so where do you obtain a copy and installation info?
Lon Hosford
May many happy bits flow your way!
------------------------------
Date: Wed, 5 Mar 1997 03:11:46 GMT
From: ken@syd.dit.CSIRO.AU (Ken Yap)
Subject: Re: PERL script for HTTP transfer ?
Message-Id: <5fio9i$egq@degas.syd.dit.csiro.au>
In article <01bc22e3$6a9065e0$4c32e8c1@Drew.spb.inkom.ru>:
|Help to me! I would like to use MIRROR but it works only via native FTP,
|and my access in INTERNET is possible only through HTTP PROXY (Squid )!
|Where is possible get PERL SCRIPT for work with HTTP by the protocol or
|better MIRROR for HTTP PROXY ?
|
|Isaev A.
| St. Peterburg
Here's an idea, use the ProxyPass directive of Apache if you are
running it. This transparently (well almost) make remote pages look
like local pages.
Followups set to comp.infosystems.www.servers.unix as this is no longer
Perl.
------------------------------
Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Jan 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.
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 52
************************************