[6385] in Perl-Users-Digest
Perl-Users Digest, Issue: 10 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 25 11:27:09 1997
Date: Tue, 25 Feb 97 08:00:29 -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, 25 Feb 1997 Volume: 8 Number: 10
Today's topics:
Re: BEGINNER: Help with (Tad McClellan)
Re: CGI.pm - unintialized value <nmljn@wombat.staff.ichange.com>
Re: Executing Here doc shell commands <hejdeman>
Re: Executing Here doc shell commands <hejdeman>
Re: Executing Here doc shell commands <Ron.Hejdeman@nmp.nokia.com>
Re: Executing Here doc shell commands <hejdeman>
Re: Executing Here doc shell commands <Ron.Hejdeman@nmp.nokia.com>
File access time (Jon Hamlin)
Re: futur de perl et java-script (I R A Aggie)
Re: Generating a randomly sorted list of integers (Tad McClellan)
Re: Generating a randomly sorted list of integers (Dave Thomas)
HELP: Is there some standard code to filter out html ta (Mark Perkins)
Re: How to override "open" function correctly (M.J.T. Guy)
Re: How to spam - legitimately (Chris Nandor)
Re: Libwww, Simple.pm and env_proxy.al? @INC trouble. (Tom Grydeland)
make for windows NT ? (Paul S. Cutt)
Re: memory leak in HTML::LinkExtor <aas@bergen.sn.no>
Perl + Cisam <raconway@axime.com>
Perl and win95 <basvreek@channels.nl>
Re: Perl FTP->HTML script?? (Mike Stok)
Re: perl probs with files (Nathan V. Patwardhan)
Re: perl probs with files (Nathan V. Patwardhan)
Re: Perl Script for DNS? <jander@ml.com>
Re: PERL what is it ? what can it do ? (Nathan V. Patwardhan)
Re: Q: Free PERL Database Tools? (Bob Wilkinson)
Re: Q: How to delete several files in one operation (ne (Nathan V. Patwardhan)
Re: regexp's in XEmacs vs. Perl (Matthew D. Healy)
Re: Solution for "Use of uninitialized value"? <nmljn@wombat.staff.ichange.com>
Testing.... <kw@dtc.rankxerox.co.uk>
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 25 Feb 1997 07:21:20 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: BEGINNER: Help with
Message-Id: <g0pue5.cq.ln@localhost>
Mark Hagan (mark.hagan@sophia.ncr.com) wrote:
: Help!!
: I've inherited a Perl script tied to a Web page form which I need to
: modify and I have no Perl background. The problem I am encountering is
: that the Web form is sending tailing spaces to the Perl script. This is
: a problem since the Perl script is preparing these fields to be plugged
: into another application and the tailing spaces are causing a problem.
: So, I need to be able to eliminate all trailing spaces from a string
: using Perl. Any ideas how I can do this? I am RTMFing as we speak but
: of course, this is something that needs to be done quickly - as always.
: Thanks in advance for any assistance any of you Perl gurus can provide.
$_ = 'I have trailing spaces (and tabs) ';
s/\s+$//;
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 25 Feb 1997 10:21:11 -0500
From: nelson <nmljn@wombat.staff.ichange.com>
Subject: Re: CGI.pm - unintialized value
Message-Id: <w10n2ssap3s.fsf@wombat.staff.ichange.com>
gsi@visi.com () writes:
> Can someone point me to whatever FAQ explains this?
>
> I've installed CGI.pm, but when I run a program using it, I
> get the intended output along with the warning:
> Use of uninitialized value at /home/gsi/lib/perl/CGI.pm-2.30/CGI.pm line 83.
>
> The program is pretty basic:
> #!/usr/local/bin/perl5 -w
> use lib '/home/gsi/lib/perl/CGI.pm-2.30';
> use CGI;
>
> print "hello world\n";
Read your error message:
Use of uninitialized value
This means that there is a variable somewhere that sprang into
existence without having been explicitly initialized by its
programmer.
at /home/gsi/lib/perl/CGI.pm-2.30/CGI.pm line 83
This is the file and the line number in which the error was
encountered. Note that it is in the CGI module itself. This means
that Lincoln Stein probably built this module without the -w switch.
:-) You can (a) scroll to line 83 of CGI.pm and see what variable
appears on that line or in that block--that will be the one that is
not initialized--and then edit CGI.pm (not recommended unless
necessary) such that you initialize that variable earlier on or (b)
you can send Lincoln mail and get him to give you a patch or
something.
Lastly, you can ignore the message while you're developing and then
when you get to release you can turn the -w switch off. I NEVER
recommend this, but sometimes it beats editing source code that isn't
yours.
Cheers,
Laird
--
<laird.nelson@netsinc.com> perl FAQ: http://www.perl.com/perl/faq Perl manual:
http://www.perl.com/CPAN/doc/manual/html/frames.html. If CGI/web appears in
your comp.lang.perl.* post, see news:comp.infosystems.www.authoring.cgi. CGI
stands for Common Gateway *Interface*, not Language or Program or Script.
Consolidated perl reference page: http://www.amherst.edu/~ljnelson/perl.html
------------------------------
Date: 25 Feb 1997 13:04:25 GMT
From: Ron Hejdeman <hejdeman>
To: Rmatrone@cris.com
Subject: Re: Executing Here doc shell commands
Message-Id: <5euo0p$6ge1@nmp02.nmp.nokia.com>
Hi,
I've been battling with just the same problem, and here's my solution :
system ("sqlplus -S ai/aisat8110 << _SELECT_STATUS > $BUSY \n
\
\nset heading on
\nset numwidth 2
\ncolumn ACTIVE_SCAUDF heading SC
\ncolumn ACTIVE_GAUDF heading GA
\ncolumn ACTIVE_CKNSN heading CK
\ncolumn ACTIVE_MKUDF heading MK
\ncolumn ACTIVE_CVERT heading CV
\ncolumn ACTIVE_JMX heading JX
\nselect ACTIVE_SCAUDF, ACTIVE_GAUDF, ACTIVE_CKNSN,
\n ACTIVE_MKUDF, ACTIVE_CVERT, ACTIVE_JMX
\nfrom aiparms;
\n_SELECT_STATUS");
I didn't try it, but I've basically done the same thing.
Hope this helps.
Ron.
_____________________________________________________________________________
_/_/_/ _/_/ _/_/ _/ Ron Hejdeman
_/ _/ _/ _/ _/ _/ _/ Email: Ron.Hejdeman@nmp.nokia.com
_/_/_/ _/ _/ _/ _/ _/ Tel: +44 (0) 1276 686116
_/ _/ _/ _/ _/ _/ _/ GSM: +44 (0) 385 502105
_/ _/ _/_/ _/ _/_/ Fax: +44 (0) 1276 676672
Nokia Mobile Phones (UK) Limited
Ashwood House, Pembroke Broadway, Camberley, Surrey GU15 3XD, United Kingdom
______________________________________________________________________________
------------------------------
Date: 25 Feb 1997 13:04:42 GMT
From: Ron Hejdeman <hejdeman>
To: Rmatrone@cris.com
Subject: Re: Executing Here doc shell commands
Message-Id: <5euo1a$6ge2@nmp02.nmp.nokia.com>
Hi,
I've been battling with just the same problem, and here's my solution :
system ("sqlplus -S ai/aisat8110 << _SELECT_STATUS > $BUSY \n
\
\nset heading on
\nset numwidth 2
\ncolumn ACTIVE_SCAUDF heading SC
\ncolumn ACTIVE_GAUDF heading GA
\ncolumn ACTIVE_CKNSN heading CK
\ncolumn ACTIVE_MKUDF heading MK
\ncolumn ACTIVE_CVERT heading CV
\ncolumn ACTIVE_JMX heading JX
\nselect ACTIVE_SCAUDF, ACTIVE_GAUDF, ACTIVE_CKNSN,
\n ACTIVE_MKUDF, ACTIVE_CVERT, ACTIVE_JMX
\nfrom aiparms;
\n_SELECT_STATUS");
I didn't try it, but I've basically done the same thing.
Hope this helps.
Ron.
_____________________________________________________________________________
_/_/_/ _/_/ _/_/ _/ Ron Hejdeman
_/ _/ _/ _/ _/ _/ _/ Email: Ron.Hejdeman@nmp.nokia.com
_/_/_/ _/ _/ _/ _/ _/ Tel: +44 (0) 1276 686116
_/ _/ _/ _/ _/ _/ _/ GSM: +44 (0) 385 502105
_/ _/ _/_/ _/ _/_/ Fax: +44 (0) 1276 676672
Nokia Mobile Phones (UK) Limited
Ashwood House, Pembroke Broadway, Camberley, Surrey GU15 3XD, United Kingdom
______________________________________________________________________________
------------------------------
Date: 25 Feb 1997 13:10:58 GMT
From: Ron Hejdeman <Ron.Hejdeman@nmp.nokia.com>
To: Rmatrone@cris.com
Subject: Re: Executing Here doc shell commands
Message-Id: <5euod2$6ge5@nmp02.nmp.nokia.com>
Hi,
I've been having basically the same problem myself. Here's what I did...
system ("sqlplus -S ai/aisat8110 << _SELECT_STATUS > $BUSY \n
\n
\n set heading on
\n set numwidth 2
\n column ACTIVE_SCAUDF heading SC
\n column ACTIVE_GAUDF heading GA
\n column ACTIVE_CKNSN heading CK
\n column ACTIVE_MKUDF heading MK
\n column ACTIVE_CVERT heading CV
\n column ACTIVE_JMX heading JX
\n select ACTIVE_SCAUDF, ACTIVE_GAUDF, ACTIVE_CKNSN,
\n ACTIVE_MKUDF, ACTIVE_CVERT, ACTIVE_JMX
\n from aiparms;
\n_SELECT_STATUS");
Hope this helps,
Ron.
_____________________________________________________________________________
_/_/_/ _/_/ _/_/ _/ Ron Hejdeman
_/ _/ _/ _/ _/ _/ _/ Email: Ron.Hejdeman@nmp.nokia.com
_/_/_/ _/ _/ _/ _/ _/ Tel: +44 (0) 1276 686116
_/ _/ _/ _/ _/ _/ _/ GSM: +44 (0) 385 502105
_/ _/ _/_/ _/ _/_/ Fax: +44 (0) 1276 676672
Nokia Mobile Phones (UK) Limited
Ashwood House, Pembroke Broadway, Camberley, Surrey GU15 3XD, United Kingdom
______________________________________________________________________________
------------------------------
Date: 25 Feb 1997 13:05:29 GMT
From: Ron Hejdeman <hejdeman>
To: Rmatrone@cris.com
Subject: Re: Executing Here doc shell commands
Message-Id: <5euo2p$6ge3@nmp02.nmp.nokia.com>
Hi,
I've been battling with just the same problem, and here's my solution :
system ("sqlplus -S ai/aisat8110 << _SELECT_STATUS > $BUSY \n
\
\nset heading on
\nset numwidth 2
\ncolumn ACTIVE_SCAUDF heading SC
\ncolumn ACTIVE_GAUDF heading GA
\ncolumn ACTIVE_CKNSN heading CK
\ncolumn ACTIVE_MKUDF heading MK
\ncolumn ACTIVE_CVERT heading CV
\ncolumn ACTIVE_JMX heading JX
\nselect ACTIVE_SCAUDF, ACTIVE_GAUDF, ACTIVE_CKNSN,
\n ACTIVE_MKUDF, ACTIVE_CVERT, ACTIVE_JMX
\nfrom aiparms;
\n_SELECT_STATUS");
I didn't try it, but I've basically done the same thing.
Hope this helps.
Ron.
_____________________________________________________________________________
_/_/_/ _/_/ _/_/ _/ Ron Hejdeman
_/ _/ _/ _/ _/ _/ _/ Email: Ron.Hejdeman@nmp.nokia.com
_/_/_/ _/ _/ _/ _/ _/ Tel: +44 (0) 1276 686116
_/ _/ _/ _/ _/ _/ _/ GSM: +44 (0) 385 502105
_/ _/ _/_/ _/ _/_/ Fax: +44 (0) 1276 676672
Nokia Mobile Phones (UK) Limited
Ashwood House, Pembroke Broadway, Camberley, Surrey GU15 3XD, United Kingdom
______________________________________________________________________________
------------------------------
Date: 25 Feb 1997 13:06:34 GMT
From: Ron Hejdeman <Ron.Hejdeman@nmp.nokia.com>
To: Rmatrone@cris.com
Subject: Re: Executing Here doc shell commands
Message-Id: <5euo4q$6ge4@nmp02.nmp.nokia.com>
Hi,
I've been battling with just the same problem, and here's my solution :
system ("sqlplus -S ai/aisat8110 << _SELECT_STATUS > $BUSY \n
\
\nset heading on
\nset numwidth 2
\ncolumn ACTIVE_SCAUDF heading SC
\ncolumn ACTIVE_GAUDF heading GA
\ncolumn ACTIVE_CKNSN heading CK
\ncolumn ACTIVE_MKUDF heading MK
\ncolumn ACTIVE_CVERT heading CV
\ncolumn ACTIVE_JMX heading JX
\nselect ACTIVE_SCAUDF, ACTIVE_GAUDF, ACTIVE_CKNSN,
\n ACTIVE_MKUDF, ACTIVE_CVERT, ACTIVE_JMX
\nfrom aiparms;
\n_SELECT_STATUS");
I didn't try it, but I've basically done the same thing.
Hope this helps.
Ron.
_____________________________________________________________________________
_/_/_/ _/_/ _/_/ _/ Ron Hejdeman
_/ _/ _/ _/ _/ _/ _/ Email: Ron.Hejdeman@nmp.nokia.com
_/_/_/ _/ _/ _/ _/ _/ Tel: +44 (0) 1276 686116
_/ _/ _/ _/ _/ _/ _/ GSM: +44 (0) 385 502105
_/ _/ _/_/ _/ _/_/ Fax: +44 (0) 1276 676672
Nokia Mobile Phones (UK) Limited
Ashwood House, Pembroke Broadway, Camberley, Surrey GU15 3XD, United Kingdom
______________________________________________________________________________
------------------------------
Date: 25 Feb 1997 14:38:16 GMT
From: jhamlin@ai.uga.edu (Jon Hamlin)
Subject: File access time
Message-Id: <5eutgo$f7f@hobbes.cc.uga.edu>
How can I get a file's access time (not modification time) in Perl?
utime allows it to be changed, but I need to read it, not write it.
------------------------------------------------------------------------------
Jon Hamlin, Sys Admin jhamlin@ai.uga.edu
Artificial Intelligence Center http://www.ai.uga.edu/~jhamlin
University of Georgia Voice: (706) 542-0358
------------------------------
Date: Tue, 25 Feb 1997 10:06:17 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: futur de perl et java-script
Message-Id: <fl_aggie-ya02408000R2502971006170001@news.fsu.edu>
In article <E63DGz.Coz@midway.uchicago.edu>, Tim Pierce
<twpierce+usenet@mail.bsd.uchicago.edu> wrote:
+ Someone who posts here in French is unlikely to do so out
+ of ignorance for that fact, but more probably for a more practical
+ reason, such as not knowing English. (Shame on them, what?) If
+ they're not understood, it's their business, IMNSFHO.
I have no problem with that. As long as they don't mutter under their
breath "stupid Americans who only speak English".
James
--
Consulting Minster for Consultants, DNRC
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Tue, 25 Feb 1997 07:15:10 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Generating a randomly sorted list of integers
Message-Id: <ukoue5.cq.ln@localhost>
Stephen Frost (frostbyt@shell01.ozemail.com.au) wrote:
: Tom Phoenix (rootbeer@teleport.com) wrote:
: Steve Frost (steve.frost@frostbyte.com.au) wrote:
: : > for ($x = 1; $x < ($high + 1); $x++) {
: : No doubt you meant to write this. :-) Perl does a lot to make your life
: : easier, no?
: : for $x (1..$high) {
: <embarassed silence!>
: Ah well, you're right, I meant to write it, but I sure didn't mean
: to make such a fool o' myself! ;-) That's what I get for loaning
: my Llama and Camel books to a workmate. I got them back tonight
: which is just as well. Hopefully I can avoid such silliness from
: here on in...
Well, you could have salvaged _some_ respect by responding instead:
"But (1..$high) will use a lot of memory for large values of $high."
Oh, but you had $high only about 9999...
I know! You could have said:
"I'm writing this on my Timex Sinclair, with only 2K of memory..." ;-)
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 25 Feb 1997 14:32:42 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Generating a randomly sorted list of integers
Message-Id: <slrn5h5tra.d6m.dave@fast.thomases.com>
On 25 Feb 1997 11:55:27 GMT, Stephen Frost <frostbyt@shell01.ozemail.com.au> wrote:
> Tom Phoenix (rootbeer@teleport.com) wrote:
>
> Steve Frost (steve.frost@frostbyte.com.au) wrote:
> : > for ($x = 1; $x < ($high + 1); $x++) {
>
> : No doubt you meant to write this. :-) Perl does a lot to make your life
> : easier, no?
> : for $x (1..$high) {
>
> <embarassed silence!>
>
> Ah well, you're right, I meant to write it, but I sure didn't mean
> to make such a fool o' myself! ;-) That's what I get for loaning
> my Llama and Camel books to a workmate. I got them back tonight
> which is just as well. Hopefully I can avoid such silliness from
> here on in...
Except I _wouldn't_ write
for $x (1..$high)
for large $high. The notational convenience is offset by the overhead of
creating a new list just to iterate over its members. For example, to sum
the first 1_000_000 numbers:
use Benchmark;
timethese(1, {
'Boring' => '$s=0; for ($i = 1; $i <= 1_000_000; $i++) { $s += $i;}',
'List' => '$s=0; for $i (1..1_000_000) { $s += $i;}'
});
Gives me:
Benchmark: timing 1 iterations of Boring, List...
Boring: 3 secs ( 2.53 usr 0.00 sys = 2.53 cpu)
(warning: too few iterations for a reliable count)
Out of memory!
Sigh...
Dave
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Tue, 25 Feb 1997 13:31:35 GMT
From: mark@weymouth.gov.uk (Mark Perkins)
Subject: HELP: Is there some standard code to filter out html tags.
Message-Id: <3312e8f0.7412513@news.dircon.co.uk>
Hi,
Well from the subject you can probably tell that Im new to Perl
although I have a reasonable understanding of unix shell.
Q. Is there some standard Perl code that I can use to filter out the
html tags like, <CENTER> or <B> from text held in a perl variable?
Can anyone help please,
many thanks
Mark
------------------------------
Date: 25 Feb 1997 15:07:22 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: How to override "open" function correctly
Message-Id: <5euv7a$44e@lyra.csx.cam.ac.uk>
Cedar Milazzo <cedar.w.milazzo@boeing.com> wrote:
>
>But - and I may sound like a dunce here but I'm kinda new to perl - how
>do I access the CORE::open() function? Do I have to somehow include
>CORE?
Not a silly question at all. But the quick way to get answers to
questions like this is to try it - perl (usually) won't bite.
And indeed, experiment shows that the CORE:: functions are included
automatically.
Mike Guy
------------------------------
Date: Tue, 25 Feb 1997 09:50:49 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: How to spam - legitimately
Message-Id: <pudge-ya02408000R2502970950490001@news.idt.net>
In article <33125E0C.F94@ionaprep.pvt.k12.ny.us>,
99borns@ionaprep.pvt.k12.ny.us wrote:
#BTW, while we are on the subject is it spelled email or e-mail?
#I've seen it both ways.
In all liklihood, it will lose the hyphen and become email. It is rare for
hyphenation -- or any punctuation -- to remain embedded in popular nouns
and verbs for very long. It is not unheard of, however.
#================================================================
I have a map of the United States... Actual size. It says,
"Scale: 1 mile = 1 mile." I spent last summer folding it. I
also have a full-size map of the world. I hardly ever unroll it.
People ask me where I live, and I say, "E6".
--Steven Wright
Chris Nandor pudge@pobox.com
PGP Key 1024/B76E72AD http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10 1F F7 7F 13 81 80 B6 B6
------------------------------
Date: 25 Feb 1997 14:46:18 GMT
From: tom@palver.nospam.eiscat.no (Tom Grydeland)
Subject: Re: Libwww, Simple.pm and env_proxy.al? @INC trouble.
Message-Id: <TOM.97Feb25154621@palver.nospam.eiscat.no>
In article <Meyer-ya02408000R2502970734110001@news.algonet.se> Meyer@algonet.se (Scott Meyer) writes:
> When I ran this routine [make install] from within the libwww-perl-5.07
> directory, I got the message that some of the modules used by
> the libwww-perl library were missing:
> Can't locate IO/Socket.pm in @INC at Makefile.PL line 30.
> Can't locate Net/FTP.pm in @INC at Makefile.PL line 49.
> Can't locate MD5.pm in @INC at Makefile.PL line 70.
You need IO::Socket in the IO distribution (which you have)
and Net::FTP from the libnet distribution (which you don't have, I presume)
The MD5 module is not really necessary.
> So I downloaded the IO module and ran the same routine from
> within that directory to install that module locally as well.
you still need libnet. The current version is 1.04. Look at CPAN.
> But when I ran the libwwwperl make test again,
> the IO module still couldn't be found:
No, that test is done during 'perl Makefile.PL'.
> Will it be necessary to edit Makefile.PL to make it find
> the other locally installed modules?
No, doing a
perl Makefile.PL (and then 'make', then 'make test')
should be enough.
> Scott
//tom
--
//Tom Grydeland <Tom@nospam.eiscat.no> # delete 'nospam.' for valid address
The case of Randal Schwartz - http://www.lightlink.com/fors/
------------------------------
Date: Tue, 25 Feb 1997 15:43:47 GMT
From: cutt@netcom.com (Paul S. Cutt)
Subject: make for windows NT ?
Message-Id: <cuttE66110.E7o@netcom.com>
Hi,
I am using makemaker on windows NT and I need to do a make on the
resulting makefile. Does anyone use makemaker on windows NT and what do
they do about the make ?
paul
------------------------------
Date: 25 Feb 1997 14:56:13 +0100
From: Gisle Aas <aas@bergen.sn.no>
Subject: Re: memory leak in HTML::LinkExtor
Message-Id: <h67zh56rm.fsf@bergen.sn.no>
matt@callnet.com (Matthew Ahrens) writes:
> if I do this:
>
> $p = HTML::LinkExtor->new;
>
> and then do the following many times on different $in's:
>
> $p->parse($in);
> my @links = $p->links;
>
> then my perl script's memory size grows continually. When I use the
> debugger, I see that $p has an increasing number of empty arrays in it as my
> program continues to run.
The arrays should not be empty unless you have emptied them yourself.
Remember that array elements will be shared between the array returned
by $p->links and the internal array maintained by $p. It is also true
that the array will grow as it finds more links in the parsed HTML.
What do you suggest? Should $p->links also truncate the list of
links? Should there be a separate method to truncate the link list?
> To fix this problem, I just use
> my $p = HTML::LinkExtor->new;
> in the subroutine which processes each $in, so that $p gets thrown away and
> recreated often.
This should not be too expensive. Object creation in perl is fairly
light weight.
> Although the fix is easy, I don't see why there needs to be this memory
> leak. I hope that this post will bring this to the author's attention.
It has, but I am not sure I should do anything about it... I might be
in favour of making $p->links truncate the list.
--
Gisle Aas <aas@sn.no>
------------------------------
Date: Tue, 25 Feb 1997 14:31:05 +0000
From: "R.Allen Conway" <raconway@axime.com>
Subject: Perl + Cisam
Message-Id: <3312F7A9.2BD0@axime.com>
I know there is a "perlcisam" package for pre perl 4.XXX but has anyone
perl 5'd it? I'm hoping this is my lucky day ...
--
The low road from Burntisland to Aberdour; Elie past Pittenweem to
Anstruther; Loch Coruisk below Sgurr Alisdair; The Suilven from
Lochinver; Skye from Applecross; Traigh Sellebost
------------------------------
Date: Tue, 25 Feb 1997 16:38:16 +0100
From: Bas van Reek <basvreek@channels.nl>
Subject: Perl and win95
Message-Id: <33130768.721F@channels.nl>
I'm looking for a webserver that
makes it possible to run perl scrips
on a win95 machine.
I had installed folkweb (www.ilar.com)
worked fine wanted to register
but was impossible.
(email adress of ilar.com does not work anymore ??)
Has anybody the registration key or a tip
for another win95 webserver witth perl support?
------------------------------
Date: 25 Feb 1997 13:31:01 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Perl FTP->HTML script??
Message-Id: <5eupil$mo2@news-central.tiac.net>
In article <3311f00e.10391841@news.enterprise.net>,
Neil Johnson <njohnson@enterprise.net> wrote:
>I hope to add options so it can sort the files by file date, size etc.
>I have worked out how to create the HTML but don't know how to retrive
>the file list in the directory. Is there a script already like this
>that I could obtain to give me some hints??
>
>Any help would be great!!!
You could use oepndir/readdir and stat and a hash to do what you want e.g.
#!/usr/local/bin/perl -w
$dir = '/tmp';
if (opendir DIR, $dir) {
while (defined ($file = readdir DIR)) {
next unless -f "$dir/$file";
$info{$file}{size} = -s _;
}
closedir DIR; # should check error
}
else {
# failed to opendir - check $! and report
}
foreach $file (sort keys %info) {
print "$file is $info{$file}{size} byte(s) big\n";
}
__END__
might be a place to start playing. Check out the file test operators and
stat in the perl documentation, as well as the perldsc man page to see
what $info{$file}{size} means (assuming a recent perl... :-)
Hope this helps,
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@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: 25 Feb 1997 14:23:26 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: perl probs with files
Message-Id: <5eusku$kme@fridge-nf0.shore.net>
Iqbal Gandham (igandham@prestel.net) wrote:
: Also is is possible to delete one line from a file which matches a
: pattern.
Not quite. Here's something for you to get an idea:
The contents of my file are:
this is line foo
this is line bar
delete this line
leave this line alone
you wouldn't hit a guy with glasses, would ya?
One method would be to open the file in read/write mode. *You can easily
shoot yourself in the butt by accidentally deleting something, so this
method is not preferred*
$file = 'line.txt';
open(INFILE, "+<$file") || die("No: $!\n");
@lines = <INFILE>;
seek(INFILE,0,0);
foreach $line (@lines) {
next if $line =~ /delete/;
print INFILE $line;
}
close(INFILE);
Second method (preferred for the sake of sanity):
$file = 'file.txt';
$outfile = '$file.old';
open(IN, "$file") || die("No: $!\n");
open(OUT, ">$outfile") || die("No: $!\n");
while(<IN>) {
next if $line =~ /delete/;
print OUT $line;
}
close(OUT);
close(IN);
Then rename the old file to the new file.
--
Nathan V. Patwardhan
nvp@shore.net
"Lane, I've been in high school for
seven years. I'm no dummy"
--Charles Demar from _Better Off Dead_
------------------------------
Date: 25 Feb 1997 14:28:58 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: perl probs with files
Message-Id: <5eusva$kme@fridge-nf0.shore.net>
Nathan V. Patwardhan (nvp@shore.net) wrote:
POOP! A mistake!
: open(IN, "$file") || die("No: $!\n");
: open(OUT, ">$outfile") || die("No: $!\n");
: while(<IN>) {
: next if $line =~ /delete/;
^^^^^^^^^^^^^^^^^^^^^^^^^^
This should read: next if $_ =~ /delete/;
--
Nathan V. Patwardhan
nvp@shore.net
"Lane, I've been in high school for
seven years. I'm no dummy"
--Charles Demar from _Better Off Dead_
------------------------------
Date: 25 Feb 1997 09:59:47 -0500
From: Jim Anderson <jander@ml.com>
Subject: Re: Perl Script for DNS?
Message-Id: <wkbene5szh8.fsf@swapsdvlp15.i-did-not-set--mail-host-address--so-shoot-me>
Jonathan Quist <jquist@slip.net> writes:
> I'm looking for a script to help maintain my DNS database. Any
> recommendations?
Check out CPAN. There's a DNS module in beta. I think you can still
find it in the "RECENT" category.
------------------------------
Date: 25 Feb 1997 14:26:07 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: PERL what is it ? what can it do ?
Message-Id: <5euspv$kme@fridge-nf0.shore.net>
NT_server (mb420@hi.ft.hse.nl) wrote:
: Can someone inform me whether it is possible to create a script using perl
: to handle form mail messages.
Yes. You must do the following things:
(1) Check out Matt's script archive and get formmail.pl
(2) Re-direct any and all questions like this to
comp.infosystems.www.authoring.cgi in the future. This is
comp.lang.perl.misc which has nothing to do with form-mailing
or CGI programming.
--
Nathan V. Patwardhan
nvp@shore.net
"Lane, I've been in high school for
seven years. I'm no dummy"
--Charles Demar from _Better Off Dead_
------------------------------
Date: Tue, 25 Feb 1997 13:52:37 -0500
From: b.wilkinson@pindar.co.uk (Bob Wilkinson)
Subject: Re: Q: Free PERL Database Tools?
Message-Id: <b.wilkinson-2502971352370001@ip57-york.pindar.co.uk>
In article <01bc2257$f5c419e0$02151ecf@krypton.afai.com>, "Dante Lorenso"
<dlorenso@afai.com> wrote:
> Question:
>
> Does anyone know of some free Database engine/tools for PERL?
Preferably
> one that understands SQL-like commands?
>
> -------> I don't want to pay for sybase or Oracle or Informix or ... BUT, I
> want to manage databases...and I want to do it in PERL. I have written a
> simple module that will implement a table by using dbm files and storing
> all my fields in the value by delimiting by '\e'. However, this is
> tedious, and still lacks some valuable functionality.
>
> Dante
> dlorenso@afai.com
> http://www.afai.com/~dlorenso/
Hello,
There is a DBD interface through to mSQL and mysql (both of which are
freely available (for personal use)). Look at
http://www.hermetica.com/technologia/DBI/
for more details of DBI/DBD. Both mSQL and mySQL support at least reasonable
subsets of SQL.
Bob
--
All is flux, nothing is still; nothing endures but change
- Heraclitus
------------------------------
Date: 25 Feb 1997 14:14:57 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Q: How to delete several files in one operation (newbie)
Message-Id: <5eus51$kme@fridge-nf0.shore.net>
Jarle Aasland (sajaa@sn.no) wrote:
: Problem: I can now delete each file by itself (by clicking it's
: respective "Delete" link), but what I want to do is choose several
: files, and then "Delete all marked files".
uh huh. I think you answered your own question without any
implementation. :-)
Each input has a name/value pair, so push all the name/value pairs
of selected files onto an array, and unlink() them.
foreach $goner (@selected) {
unlink($goner);
}
HTH!
--
Nathan V. Patwardhan
nvp@shore.net
"Lane, I've been in high school for
seven years. I'm no dummy"
--Charles Demar from _Better Off Dead_
------------------------------
Date: Tue, 25 Feb 1997 10:48:55 -0500
From: Matthew.Healy@yale.edu (Matthew D. Healy)
Subject: Re: regexp's in XEmacs vs. Perl
Message-Id: <Matthew.Healy-2502971048550001@pudding.med.yale.edu>
<flamebait>
Silly me, I use vi...
</flamebait>
:-) :-} :-O :-] :-() :-%} :-%>
---------
Matthew.Healy@yale.edu
http://paella.med.yale.edu/~healy
Go and share the Gospel. Use words only if necessary --St Francis
------------------------------
Date: 25 Feb 1997 10:36:38 -0500
From: nelson <nmljn@wombat.staff.ichange.com>
To: ljohnson@isys.ca
Subject: Re: Solution for "Use of uninitialized value"?
Message-Id: <w10k9nwaoe1.fsf@wombat.staff.ichange.com>
"Lee Johnson" <ljohnson@isys.ca> writes:
> Been through the man pages...understand the error more or less not
> quite sure what I'm doing wrong (again) though.
> I've tried variations on this line including $date_command, by
> nothing seems to work:
> $date =`$date+"%y%m%d"`; chop($date);
> Did I miss something again?
Specific solution: chomp($date);
General solution:
For any situation where I trigger uninitialized variable warnings, I
curse and then initialize my variables. :-) Specifically, I'll
initialize them this way:
my($a) = $DEFAULT_VALUE || '';
Note that there is a potentially large problem with this which is that
if $DEFAULT_VALUE can be 0 then $a will never get its value.
Depending on how you're using your variables, you can, of course, say
this:
my($a) = $DEFAULT_VALUE || 0;
...so that you'll get a numeric value in $a instead.
If I'm pulling variables off the command line I'll do something like
this:
my($arg) ||= $DEFAULT_ARG_VALUE || ''; # or use GetOpt :-)
...which says "my scalar-arg gets itself OR scalar-default-arg-value
OR nothing".
Always develop under 'use strict' and the -w switch (as you seem to be
doing).
Cheers,
Laird
--
<laird.nelson@netsinc.com> perl FAQ: http://www.perl.com/perl/faq Perl manual:
http://www.perl.com/CPAN/doc/manual/html/frames.html. If CGI/web appears in
your comp.lang.perl.* post, see news:comp.infosystems.www.authoring.cgi. CGI
stands for Common Gateway *Interface*, not Language or Program or Script.
Consolidated perl reference page: http://www.amherst.edu/~ljnelson/perl.html
------------------------------
Date: Tue, 25 Feb 1997 13:57:35 GMT
From: "Kieran Walshe" <kw@dtc.rankxerox.co.uk>
Subject: Testing....
Message-Id: <01bc2323$51e1a0a0$3c00cb0d@kraken>
Testing.....
------------------------------
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 10
************************************