[7994] in Perl-Users-Digest
Perl-Users Digest, Issue: 1619 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 12 00:04:21 1998
Date: Sun, 11 Jan 98 21:00:26 -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 Sun, 11 Jan 1998 Volume: 8 Number: 1619
Today's topics:
Re: "shift @array" question <rjk@coos.dartmouth.edu>
((keys %Pair) =~ /$Req/)) would it work (right)? <feng@haas.berkeley.edu>
Re: ((keys %Pair) =~ /$Req/)) would it work (right)? <rootbeer@teleport.com>
Re: ((keys %Pair) =~ /$Req/)) would it work (right)? (Martien Verbruggen)
Re: ((keys %Pair) =~ /$Req/)) would it work (right)? (Tad McClellan)
Re: **1A Please Help, Perl is harrassing me ** <rjk@coos.dartmouth.edu>
[Q] how to detect disk usage <kmart@kmworks.co.jp>
A newbie and File::Find wonders (Marek Jedlinski)
Re: A newbie is trying to use perl (Tad McClellan)
Re: Avoiding regular expressions (was: Re: Newbie quest <rjk@coos.dartmouth.edu>
Re: bison for perl <zenin@best.com>
Re: Can Perl talk smtp protocol under NT4? <neil@nsedley.dircon.co.uk-antispam>
Re: Can Perl talk smtp protocol under NT4? (Martien Verbruggen)
Re: file glob restrictions?! (Martien Verbruggen)
Re: File Listing (Martien Verbruggen)
Re: Finding the TITLE to a HTML page <mahe@tcs.co.at>
Re: How can i create a file in perl? (Martien Verbruggen)
Re: How can i create a file in perl? (Michael Budash)
Re: How to move a directory to another level in NT? (Tad McClellan)
Larry Wall on Dr. Dobb's Journal (John Robson)
MacPerl: diagnosing "Out of Memory!" (Michael W. J. West)
Re: pod2html for a bunch of files (Martien Verbruggen)
Re: POP3 (John Sievert)
Posted-To: instead of Newsgroups: on mailed copies of p <Russell_Schulz@locutus.ofB.ORG>
sending emails with perl ? (memeier@bene.baynet.de)
Re: serious post about gmtime and year-1900 <Russell_Schulz@locutus.ofB.ORG>
Simple OO help needed: Constructors for delegated objec <apollock@xlibrary.berkeley.edu>
Socket Help <Webmaster@csa.clpgh.org>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 11 Jan 1998 23:27:19 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: "Peter J. Schoenster" <pschon@baste.magibox.net>
Subject: Re: "shift @array" question
Message-Id: <34B99BA6.36C7A837@coos.dartmouth.edu>
[posted and mailed]
Peter J. Schoenster wrote:
>
> [cc to author]
> Jerry Lineberry <jerryl@connecti.com> wrote:
>
> >@users = `$finger$list$domain`;
> >shift @users; # How can I remove the first three lines
> >shift @users; # without doing this?
> >shift @users;
>
> Assume that @users contains three elements. You can get those 3 in the
> following way:
>
> ($0,$1,$3) = @users;
Besides the fact that that does not do what the author asked
(remove the first three elements from the array), there
are two problems with that line of code.
First, you skipped $2. :-)
Second, $0, $1, and $3 are all special variables.
$0 is the name of the file containing the perl script
which is being executed, and $1 and $3 are used with
pattern matches and also happen to be read-only.
Chipmunk
------------------------------
Date: Sun, 11 Jan 1998 16:37:48 -0800
From: Patience <feng@haas.berkeley.edu>
Subject: ((keys %Pair) =~ /$Req/)) would it work (right)?
Message-Id: <34B965DC.BFCBB1EC@haas.berkeley.edu>
Hi guys,
I am trying to see if any key element of a hash (%Pair) contains $Req.
Would this work?
Thanks a bunch in advance! : )
Patience
------------------------------
Date: Sun, 11 Jan 1998 19:34:04 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Patience <feng@haas.berkeley.edu>
Subject: Re: ((keys %Pair) =~ /$Req/)) would it work (right)?
Message-Id: <Pine.GSO.3.96.980111193330.25360G-100000@user2.teleport.com>
On Sun, 11 Jan 1998, Patience wrote:
> Subject: ((keys %Pair) =~ /$Req/)) would it work (right)?
No. :-)
> I am trying to see if any key element of a hash (%Pair) contains $Req.
I think you want exists(). Hope this helps!
--
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: 12 Jan 1998 01:56:27 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: ((keys %Pair) =~ /$Req/)) would it work (right)?
Message-Id: <69bt8b$do8$1@comdyn.comdyn.com.au>
In article <34B965DC.BFCBB1EC@haas.berkeley.edu>,
Patience <feng@haas.berkeley.edu> writes:
> Hi guys,
>
> I am trying to see if any key element of a hash (%Pair) contains $Req.
> Would this work?
'this' being ((keys %Pair) =~ /$Req/)) ?
Nope.
perldoc perlop
/Binding Operators
Binary "=~" binds a scalar expression to a pattern match.
^^^^^^
(keys %Pair) in a scalar context will return the number of elements in
the hash. You could of course have written a small test script, like
the following:
#!/usr/local/bin/perl -w
use strict;
my %hash = ( foo => 1, foobar => 1, bar => 1, barfoo => 1);
my $Req = 'foo';
print STDOUT ((keys %hash) =~ /$Req/ ? "Yep" : "Nope"), "\n";
print STDOUT ((keys %hash) =~ /4/ ? "Yep" : "Nope"), "\n";
And see it fail.
You will probably need to do something like:
#!/usr/local/bin/perl -w
use strict;
my %hash = ( foo => 1, foobar => 1, bar => 1, barfoo => 1);
my $Req = 'foo';
foreach my $key (keys %hash)
{
print STDOUT ($key =~ /$Req/ ? "Yep " : "Nope"), " for $key\n";
}
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: Sun, 11 Jan 1998 19:13:44 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: ((keys %Pair) =~ /$Req/)) would it work (right)?
Message-Id: <8oqb96.la6.ln@localhost>
Patience (feng@haas.berkeley.edu) wrote:
: I am trying to see if any key element of a hash (%Pair) contains $Req.
: Would this work?
Would what work? I don't see anythings whose "working" can be evaluated...
Maybe you meant to ask "How can I do this?" ?
while (grep /$Req/, keys %Pair) { print "found one\n"}
: Thanks a bunch in advance! : )
You're welcome, after the fact.
: Patience
Laziness, IMpatience, and Hubris ;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 11 Jan 1998 22:39:12 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: **1A Please Help, Perl is harrassing me **
Message-Id: <34B9905F.57628591@coos.dartmouth.edu>
brian d foy wrote:
>
> try
>
> s/@/\@/g;
>
> but it's likely to behave in ways that you don't expect.
Especially if you expect it to put a backslash before
all the at signs in a string.
s/@/\\@/g;
would be more useful.
Chipmunk
------------------------------
Date: Mon, 12 Jan 1998 11:40:38 +0900
From: KMART <kmart@kmworks.co.jp>
Subject: [Q] how to detect disk usage
Message-Id: <34B982A6.3892@kmworks.co.jp>
Hi,there
I am trying to detect disk size and available disk space in C:drive,
using NT Perl. That is the information found in File Manager's status
bar.
I remember that some C routine does that, but am not sure if Perl have a
code
that does the same possibly in simpler way.
if anyone knows the answer, please let me know.
KM
------------------------------
Date: Sun, 11 Jan 1998 22:42:33 GMT
From: cicho@free.polbox.pl (Marek Jedlinski)
Subject: A newbie and File::Find wonders
Message-Id: <34bb3d76.7516964@news.nask.org.pl>
Keywords: If this makes sense to you, you have a big problem...
Metavariables can be fun, but then, in File::Find documentation I
read:
>=head1 SYNOPSIS
>
> use File::Find;
> find(\&wanted, '/foo','/bar');
> sub wanted { ... }
...this, with no further reference to precisely what "/foo' and
'/bar' represent. I simple-mindedly assumed the former would
contain the starting directory and the latter, the required
filemask (this is how I would do it in dear old Pascal with which
I'm on very friendly terms :). So I try a simple script like:
use File::Find;
find(\&wanted, 'd:\\perl','*.pl');
# NOT QUITE RIGHT, OBVIOUSLY
sub wanted {
print "$_\n"; # JUST SHOW WHAT WE HAVE FOUND
}
This "works", in the sense that it does start in the "d:\perl"
and traverses subdirectories from there *but* it lists ALL the
files it finds. it also outputs the line "Can't stat *.pl: No
such file or directory". Interestingly (to a newbie), reversing
the '/foo' and '/bar' produces the very same output. Huh??
Also... Another newbie wonder. Before I even found the File::Find
package, I tried my own hand at listing files in a single
directory (no recursion intended). I got this far:
@file_mask = "*";
if (@ARGV) { @file_mask = @ARGV }
#I.e., if no commandline parameters, we will list everything
for (<@file_mask>) {
print "$_\n";
}
So now I can pass the file_mask to the script and have all the
matching files listed. This works... Except when I specify a file
mask that "should" return NO matches. Assuming that I have no
file called "xxx" in the current directory, and run the script as
perl findfile.pl x*x
the script does not output anything - correctly, since no match
exists. BUT, if I run
perl findfile.pl xxx
the script does output "xxx" AS IF a file by that name were
found. And, again, I go "huh??"
Thanks IA for enlightenment (or a pointer to such),
marek
--
Invalid thought. Close all mental processes and restart body.
Largactil Cafe http://www.lodz.pdi.net/~eristic/index.html
Send message with GET PGP_KEY in subject for PGP public key.
Hail Eris. *plonk* trolls. Fight spam: http://www.cauce.org/
------------------------------
Date: Sun, 11 Jan 1998 22:13:58 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: A newbie is trying to use perl
Message-Id: <6a5c96.ar6.ln@localhost>
George Russell (george.russell@clara.net) wrote:
: On Sun, 11 Jan 1998 11:25:20 -0600, tadmc@flash.net (Tad McClellan)
: wrote:
: Thanks for the help, btw.
: > use strict; # also a Very Good Idea...
: I get a lot of error mesg's and finally refuses to run.
: Any idea why i get "symbol requires explicit package name" and
: "variable is not imported"
Yes, that is what 'use strict' means. You must be strict about your
usage of variables, rather than relying on them springing into
existence at their first usage.
You declare _all_ your variables with my(). See below.
This is Good For You, as dictated by both common Software Engineering
principles, and by good sense. It will uncover errors in programs.
Most other programming languages _always_ require "strictness". Perl
is not so draconian. It does not require good engineering practice
unless you ask for good SW engineering practice with the "use strict"
pragma.
: Works without it.
It is just luck that it works.
The odds get worse the larger the program is. Trivial 40 line programs
can often be banged out without making a mistake. Production code
should use both -w and "use strict".
: >Your style of indenting is a little odd too...
: It doesn't survive too well between kedit in linux, then to windows
: and agent.
I figured the Devil had his hand in it somehow.
: >print <<ENDSTUFF;
: ><tr>
: ><td>$domain</td>
: ><td>$name</td>
: ><td>$file</td>
: ><td>$extra1</td>
: ><td>$number</td>
: ></tr>
: >ENDSTUFF
: >
: >That puts them on separate lines rather than mashing it altogether
: >on a single output line.
: Gives me the error " can't find string terminator anywhere before EOF"
You have not used it correctly then. There must be nothing following
the second ENDSTUFF. No spaces allowed before nor after it (you
cannot indent it).
Sometimes doing FTP file transfers between sane and silly computers
in the wrong mode will leave the wrong line endings in your script.
That is also a possible cause of that Frequently Asked Question.
( "Why don't my <<HERE documents work?" )
: My new and improved version
: ======================================================
: #!/usr/bin/perl -w
: # use strict;
: # under advice to do so wonder why :-)
^^^^^^^^^^
It will help you find mistakes in your programs. That is why.
This isn't really the place to go over accepted SW Eng stuff.
Take it on faith, or study the literature for a few months.
: #not yet - it won't run
: # tests for file open failure
: use diagnostics;
: $filename = "access.log" || die "could not open '$access.log'
^
^
Didn't -w complain about the $access variable that has never been
given a value?
Doesn't do any good to enable warnings and then ignore them ;-)
Anyway, you should check the return value from open() calls (deja vu).
That is not a call to open()...
: $!" ;
: $number=0;
my $filename = 'access.log';
my $number=0;
Declare all variables to keep "use strict" quiet...
: print "Content-type:text/html\n\n";
: print "<html><head><title>Access Log</title></head>";
: print "<body>";
:
: open(INF,$filename);
*There's* a call to open(). Still not checking to see if it succeeded...
: @indata = <INF>;
: close(INF);
:
: print "<table border=1>";
: print
: "<tr><th>Domain</th><th>Time</th><th>File?</th><th>HTTP</th><th>No</th></tr>\n";
: foreach $i (reverse @indata) {
: chop($i);
chomp() is safer than chop() if you are meaning to remove the newline.
: ($domain,$datetime,$file,$extra1) =(split(/
my($domain,$datetime,$file,$extra1) =(split...
For "use strict" compliance.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 11 Jan 1998 16:07:18 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Avoiding regular expressions (was: Re: Newbie question)
Message-Id: <34B93487.755621F4@coos.dartmouth.edu>
John C. Randolph wrote:
>
> No, there are definitely people who shouldn't be using Perl *or* Python, *or*
> anything other than the first language they learned (Visual Basic: it causes
> severe brain damage, just like all previous versions of Basic did.)
Excuse me, but the first programming language I learned was BASIC.
:-)
Chipmunk
------------------------------
Date: 12 Jan 1998 02:13:17 GMT
From: Zenin <zenin@best.com>
Subject: Re: bison for perl
Message-Id: <884571447.552586@thrush.omix.com>
John Porter <jdporter@min.net> wrote:
: Well, sure, anyone can make anything available if they want to.
: Is that official enough to be called a "perl distribution"?
Why not? It's a "Perl Binary Distribution".
: > They kind of have to for solaris, as Solaris doesn't bloody come
: > with a C compiler standard! :(
: So? As long as gcc is available, you don't need binaries... at least
: for the common unix flavors (including Solaris).
You're assuming that every piece of software has perfect makefiles
that work out of the box on every Unix system, every compiler, and
every version and combination of them. If you've been around any
length of time, you'd know the world is just not that nice and it's
vary oftin you'll need to tweak the makefile or even the source code
itself to work correctly or even to just compile at all. It would
be nice if all these tweaks get folded back into the standard
release, but the sad fact is that they don't for many different
reasons. Once the binary is created however, it oftin works fine
on many combinations.
On some systems there are standard sets of "adjustments" for most
pieces of software that allow for source level installs with most
if not all of the "tweaking" done for you already. FreeBSD does
a *great* job of this with it's /usr/ports system, but not all
other venders are so friendly.
BTW, how do you get gcc with out a C compiler or a "binary"
distribution of gcc...?
: > And they might for Win95 & NT as it is a real pain to try and port
: > stuff from UNIX to Win32...
: It makes sense to distribute the binaries for Win32 platforms, because
: they're binary-compatible.
You do know that gcc (and most of the entire GNU utility set) works
under Win32, right? So with the logic above why would anyone need
to distribute binaries for perl packages?
--
-Zenin
zenin@best.com
------------------------------
Date: Sun, 11 Jan 1998 22:14:58 -0000
From: "Neil Sedley" <neil@nsedley.dircon.co.uk-antispam>
Subject: Re: Can Perl talk smtp protocol under NT4?
Message-Id: <34b94468.0@newsread1.dircon.co.uk>
Get hold of the SMTP RFC ( 821 ISTR) and implement it yourself by opening a
socket on port 25 (provided it is not already opened by another
application). The protocol is very easy to implement ( I have written one to
receive SMTP so one to send it should by quite easy).
Neil Sedley
Cool Yam wrote in message <34B787D3.5344@mars.dti.ne.jp>...
>Hello,
>
>I need to make Form2Mail.pl under WindowsNT4.
>But,I can't use any sendmail aplication.
>
>I hear Perl can talk smtp protocol,but I don't know
>how to make it.
>
>Anybody know how to make that script??
>
>Please teach me.
>
>Thanks,
>
>----
>Cool Yam
>yamasaki@mars.dti.ne.jp
------------------------------
Date: 12 Jan 1998 00:05:38 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Can Perl talk smtp protocol under NT4?
Message-Id: <69bmoi$cqq$4@comdyn.comdyn.com.au>
In article <34B787D3.5344@mars.dti.ne.jp>,
Cool Yam <yamasaki@mars.dti.ne.jp> writes:
> I hear Perl can talk smtp protocol,but I don't know
> how to make it.
>
> Anybody know how to make that script??
Not a script, but a module.
It's called Net::SMTP, and you can get it from CPAN
(http://www.perl.com/CPAN/). Read the documentation that comes with
it.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd. | make a better idiot.
NSW, Australia |
------------------------------
Date: 11 Jan 1998 22:50:09 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: file glob restrictions?!
Message-Id: <69bib1$cj4$1@comdyn.comdyn.com.au>
In article <34B63DB6.446B@ulrik.uio.no>,
"Peter J. Acklam" <jacklam@ulrik.uio.no> writes:
> Has anyone written a subroutine/module/whatever that
> converts a file glob to a regex?
There's a module on CPAN, called File::KGlob, which comes with a
File::KGlob2RE module. I think that expands Kshell type globbing into
regular expressions.
Martien
PS. If you use the CPAN module, you could have found out in a minute.
perl -MCPAN -e shell
> i /glob/
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd. | you come to the end; then stop.
NSW, Australia |
------------------------------
Date: 12 Jan 1998 00:01:33 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: File Listing
Message-Id: <69bmgt$cqq$3@comdyn.comdyn.com.au>
In article <34B7F7BB.14FA2F32@virgin.net>,
Andrew Spiers <andrew.spiers@virgin.net> writes:
> This question may be PERL related ?!?
It's not. Not really.
> How is has this page http://www.perl.com/CPAN-local// been customized ?
> Is is using PERL or is it done on the server ?
It's most likely not a file, but a directory listing, generated by the
HTTP daemon on the other side receiving your request.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: Mon, 12 Jan 1998 00:18:12 +0100
From: Herbert Maier <mahe@tcs.co.at>
To: brian d foy <comdog@computerdog.com>
Subject: Re: Finding the TITLE to a HTML page
Message-Id: <34B95334.10C6846C@tcs.co.at>
brian d foy wrote:
> In article <34B69098.EAC50B34@tcs.co.at>, mahe@tcs.co.at posted:
>
> >
> > undef $/;
> >while(<>){
> >
> >if (/<title>(.*)<\/title>/si){print $1;}
> >}
>
> hasn't it already been shown why this doesn't work?
>
No.
I'v tested it and it worked (with perl5)
Herbert
------------------------------
Date: 11 Jan 1998 23:23:46 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How can i create a file in perl?
Message-Id: <69bka2$cmv$1@comdyn.comdyn.com.au>
In article <34b90697.0@news.one.net>,
"Phil" <mine@mycom.com> writes:
> OK, I've got a question, how would you chmod that file once it's created?
perldoc -f chmod
Gosh.. perl actually has a builtin function called chmod?
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: Sun, 11 Jan 1998 20:24:56 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: How can i create a file in perl?
Message-Id: <mbudash-1101982024560001@d82.pm2.sonic.net>
In article <34b90697.0@news.one.net>, "Phil" <mine@mycom.com> wrote:
>> OK, I've got a question, how would you chmod that file once it's created?
>>
how 'bout perl's chmod function?
--
Michael Budash, Owner * Michael Budash Consulting
mbudash@sonic.net * http://www.sonic.net/~mbudash
707-255-5371 * 707-258-7800 x7736
------------------------------
Date: Sun, 11 Jan 1998 19:23:25 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How to move a directory to another level in NT?
Message-Id: <darb96.la6.ln@localhost>
Stephen Warren (swarren@eclipse.net) wrote:
: system( "move c:\\temp\\dir_1 to c:\\perl\\source\\code\\dir_1" )
: == 0 || die "err msg" ;
: Perhaps the problem you had was using \ instead of \\ in the paths.
Just use single quotes, since there is nothing to interpolate anyway,
then single backslashes are good enough (unless the backslash is
followed by another backslash or by a single quote).
system('move c:\temp\dir_1 to c:\perl\source\code\dir_1')
&& die 'err msg';
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 11 Jan 1998 21:35:30 GMT
From: as646@FreeNet.Carleton.CA (John Robson)
Subject: Larry Wall on Dr. Dobb's Journal
Message-Id: <69bdv2$f6g@freenet-news.carleton.ca>
The current issue of the Dr. Dobb's Journal (February 1998) is entirely
devoted to scripting languages and has some articles on Perl.
The highlight is a long interview of Larry Wall in which he talked about
Perl 5.005, the Resource Kit, and (what else!!?) the philosophy and
art of Perl. As always, Larry is as entertaining and enlightening as ever.
Go read the interview at:
http://www.ddj.com/ddj/1998/1998_02/
------------------------------
Date: 11 Jan 1998 19:33:01 -0700
From: mwest@nyx.net (Michael W. J. West)
Subject: MacPerl: diagnosing "Out of Memory!"
Message-Id: <69bvct$ou$1@nyx.nyx.net>
What is a good strategy to understand why MacPerl is giving
"Out of Memory!" ? I wonder if one of my hashes is getting
far more keys than I thought, but some simple attempts to
see give me no clue.
Is there some way to show how much memory is in use? See what
variables use the most memory? On a Mac, is sysread, read,
or <INPUT> the cleanest way to get data from a filehandle?
Since MacPerl seems to preallocate for the application, and
I see no clues in the books, I am at a lost. Could I use
the debugger? How do I learn about it?
My problem is a medium sized application in Mac-Perl (51 K) which
reads 400 byte records from a 400 Mb file. Most of my
variables (a few hundreds) are counters: record X is shipped
to a state, with a color during a month, etc. Then, report on how
many blue items are shipped to California in May.
I had the little bugger working earlier, ripping through
500 megs, now it runs out after 100. Even though I increased
allocated RAM to 40 megs. So, I introduced a bug.
How to find it? Thanks for hints/clues/strategies.
Regards, Mike West mwest@nyx.net
------------------------------
Date: 11 Jan 1998 22:58:01 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
To: rz10@cornell.edu (Ray Zimmerman)
Subject: Re: pod2html for a bunch of files
Message-Id: <69bipp$cj4$2@comdyn.comdyn.com.au>
[Posted and Mailed]
In article <rz10-ya02408000R0801981058310001@newsstand.cit.cornell.edu>,
rz10@cornell.edu (Ray Zimmerman) writes:
> I have installed a bunch of modules from CPAN and would like to take all of
> the .pm and .pod files in my site_perl directory (and sub-dirs) and create
> a similar hierarchy of .pm.html and .pod.html files elsewhere.
Have a look at the installhtml script in the perl distribution. That
does what you want, and shows you how to do it. You might need to
rewrite a few little things.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: Sun, 11 Jan 1998 21:42:12 -0600
From: john@customer1st.com (John Sievert)
Subject: Re: POP3
Message-Id: <1998011121421226003@1cust18.max2.minneapolis.mn.ms.uu.net>
I have had a similiar problem on the mac with this same script. Does
this work, is there another POP3 client out there anywhere?
Peter Salomonsen <pesalomo@online.no> wrote:
> I've tried to use the freeware perl-script Mail::POP3Client. My wish is to
> run it from DOS under win95. But I only get the message, Socket not
> connected. What can I do to make it work?
>
> Please CC your answer to pesalomo@online.no
>
> Peter Salomonsen
------------------------------
Date: Sun, 11 Jan 1998 16:38:44 +0000
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Posted-To: instead of Newsgroups: on mailed copies of posts (was Re: serious post about gmtime and year-1900)
Message-Id: <19980111.163844.8F7.rnr.w164w_-_@locutus.ofB.ORG>
[ moved to news.software.readers; this used to come up a lot ]
Tom Phoenix <rootbeer@teleport.com> writes:
>> Tom, you should find software that indicates when you have mailed
>> a copy of a post,
>
> I already do. There should be a 'Newsgroups:' header on this message,
> for example. Hope this helps!
existing practice (including rn, I think) means that is insufficient;
Jamie Zawinski's `draft-zawinski-posted-to-00.txt' says it explicitly:
``
The requirement to ignore lone Newsgroups headers in mail messages is an
important one. Existing practice does not allow one to make any
assumptions about the interpretation of the Newsgroups header in mail,
as there are two widely used, conflicting interpretations of it: some
message-generating software uses it as an indication that this mail
message was also posted; and some message-generating software uses it as
an indication of the groups to which the message to which this message
is a reply was posted.
''
since this is going to n.s.readers: I noticed today that this
draft requires the Posted-To: header on news as well as mail
copies, but no explicit justification is given -- above having
both copies (with the same Message-ID: header) being the same
message. but this will never be true anyway -- the mail version
will always have gobs of other headers added into it.
making things worse, while this reader can optionally insert a
mailed and posted notice into the mailed copy, it by default adds a
`Comments: this message originated as a public newsgroup posting'
header, and changes a `CC: poster' header to a `To: full.address'
header (some mailers balk at CC: without To:, which I know isn't
822-compliant).
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: Sun, 11 Jan 1998 20:48:40 GMT
From: memeier@bene.baynet.de (memeier@bene.baynet.de)
Subject: sending emails with perl ?
Message-Id: <34b92f7c.5684565@news.uni-erlangen.de>
Hi !
Can anybody tell me how send emails with perl-scripts ?
Mike
------------------------------
Date: Sun, 11 Jan 1998 16:52:49 +0000
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: serious post about gmtime and year-1900
Message-Id: <19980111.165249.5F9.rnr.w164w_-_@locutus.ofB.ORG>
abigail@fnx.com (Abigail) writes:
> Uhm, my copy of the documentation that comes with Perl says:
>
> Also, $year is the number of
> years since 1900, that is, $year is 123 in year 2023.
well, how come everyone else is claiming it DOESN'T give examples?
> I wouldn't trust any programmer to make Y2K fixes that needs to think
> more than half a second to grasp the above sentence.
that covers the documentation then; I still think an explicit test in
the test suite (even though it does test things out of Perl's control)
would be good.
> X-Date: 1594 September 1993
now, now. :-)
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: 11 Jan 1998 22:01:53 GMT
From: "Alvin Pollock" <apollock@xlibrary.berkeley.edu>
Subject: Simple OO help needed: Constructors for delegated objects
Message-Id: <01bd1edc$45586020$dc612080@ns1.Berkeley.EDU>
I'm writing my first OO program in perl and am having a hard
time with some of the syntax and perl concepts (I have a C++
background). I have an unbalanced binary tree and I want to
provide it with the single accessor getElement( ) which iterates
through the tree and returns the first object of type Element
matching the search criteria that it finds, e.g. used as:
my $tree = new Tree ("/usr/local/rootfile.txt");
my $element = $tree->getElement ("Search string");
My problem is that I can't figure out how the "Search string"
argument should be passed to the Element constructor.
I read Tom Christiansen's perltoot section on aggregation
as well as studied some OO Perl example programs but
still can't seem to wind through it all. Here's a basic outline
of what I have so far. Specifically, where should my iteration/
search routine go? I suspect somewhere in Tree::getElement,
or should it go in Element::new?
package Tree;
use Tree::GetTree; # Binary tree building program. Exports function
GetTree();
my $Root = 0;
sub new {
my ($pkg, $rootfile) = @_;
my $self = {};
$Root = &GetTree ($rootfile); # Global ref to top element of tree
my self = {
_element => Element->new ( ); # How do I pass the search string
here??
};
bless $self, $pkg;
return $self;
}
sub getElement { # This is all I do here according to perltoot??
my $self = shift;
return $self->{_element};
}
sub getElement { # Here's what I sort of think it should be instead.
my ($self, $string) = @_;
&Iterate ($Root, $string);
# What should I return here??
}
package Element;
sub new {
my ($pkg, $string) = @_;
my $self = {
_name => undef,
_title => undef,
_location => undef,
_url => undef,
_level => undef,
_ancestry => undef,
_type => undef,
};
bless $self, $pkg;
return $self;
}
I hope this stripped-down example is enough to give people an
idea of what I'm trying to do and where my thought-processes
are going. Thanks for giving me any assistance you are able.
[NOTE: To respond to me by email, remove the 'x' from my
return email address]
Alvin Pollock
UC Berkeley
apollock@xlibrary.berkeley.edu
------------------------------
Date: Sun, 11 Jan 1998 22:37:01 -0500
From: John Kotwicki <Webmaster@csa.clpgh.org>
Subject: Socket Help
Message-Id: <69c350$pbq@bgtnsc02.worldnet.att.net>
I am looking for code examples that will help me out with the
following problem: I want to be able to retreive a file from a Web
site and save it to a local directory.
Everyone tells me that it is really easy, all I have to do is use a
socket connection, yet I have never actually seen this done. Has
anyone ever done this successfully? BTW: I am using NT 4.0
with Microsoft IIS as my Web server. Please help.
Thanks,
John Kotwicki
------------------------------
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 1619
**************************************