[6832] in Perl-Users-Digest
Perl-Users Digest, Issue: 458 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 9 18:07:09 1997
Date: Fri, 9 May 97 15:02:54 -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 Fri, 9 May 1997 Volume: 8 Number: 458
Today's topics:
Re: Notice to antispammers - is there a list of spammer <usenet-tag@qz.little-neck.ny.us>
Perl - Time question (nataraj)
Re: Perl - Time question (I R A Aggie)
Perl 5.003 .PDF Manual. WHERE??? (Gary K. Nitzberg)
Re: Perl auto-replier (John Bollenbacher)
PerlScript Objects jcoleman@alison.sbc.edu
Problem with file handles (Gene Johannsen)
problems with open command john2@zapcom.net
Re: Remove HTML tags from docs???? <levass@gdesystems.com>
Re: Renaming a mail file based on the date (Icarus Sparry)
Sockets (Logan78)
STRAW POLL: RFD: comp.lang.perl reorg (A. Deckers)
Re: url detection in a string <usenet-tag@qz.little-neck.ny.us>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 May 1997 15:16:08 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Notice to antispammers - is there a list of spammers to pluginto procmail?
Message-Id: <5kvf3o$j2i$1@news.netusa.net>
In article <d67wvfj11.fsf@s3i.com>, Clark Dorman <dorman@s3i.com> wrote:
>> sitaram@diac.com (Sitaram Chamarty) writes:
>> >My question, for Nathan or Tom or anyone else who knows, is: is there
>> >a frequently updated list of spammers that I can periodically plug
>> >into my procmail recipe as an include file? (I do use procmail, but I
>> >got tired of constantly adding addresses to it, hence this question).
>Ok, I've just started using procmail, and have had the same problem,
>namely that spammers come from many addresses. Here's a first cut
>script. Procmail gurus please let me know how to improve the procmail
>file format. If there is a better or additional source of spammers, I
>can add that to the script as well.
The procmail looke dfine to me, but I am not a procmail guru. Panix, an
old NYC ISP, has a shared procmail filter that gets updated as needed
by the staff there. It filters based on headers and body so those with
consistent message fragments, eg postal addresses, can be filtered
reguardless of originating address.
I am pretty sure all of it is availible at
<URL:http://www.panix.com/e-spam.html>
People who use it report good results. I use a multiple address scheme
and have had good results with that so I have not tried them.
Elijah
------
use dejanews to search for "Post your procmailrc" in comp.mail.misc for mine
------------------------------
Date: Fri, 9 May 1997 18:25:38 GMT
From: nataraj@netcom.com (nataraj)
Subject: Perl - Time question
Message-Id: <natarajE9xF6q.1DM@netcom.com>
I have the time in localtime with a timezone (say EST)
How do i find easily find the equivalent time in GMT .
in C, i could use the external variable altzone..
and a combination of mktime,gmtime..etc
to get conversion seconds..etc and finally the
correct value.
How do i do this in Perl ?? I have tried the
POSIX package equivalents, but dont know
how to get the extern value equivalents...??
Thanks for all suggestions.
nataraj/.
------------------------------
Date: Fri, 09 May 1997 14:40:11 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Perl - Time question
Message-Id: <fl_aggie-ya02408000R0905971440110001@news.fsu.edu>
In article <natarajE9xF6q.1DM@netcom.com>, nataraj@netcom.com (nataraj) wrote:
[posted && cc'd because you have a deliverable address]
+ I have the time in localtime with a timezone (say EST)
+ How do i find easily find the equivalent time in GMT .
gmtime()? see 'man perlfunc' for details.
+ in C, i could use the external variable altzone..
+ and a combination of mktime,gmtime..etc
+ to get conversion seconds..etc and finally the
+ correct value.
System libraries like those are generally available from perl. Use
them the same way you would in C.
James
--
Consulting Minister for Consultants, DNRC
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: 9 May 1997 17:16:04 GMT
From: gknitz@nitzspace.com (Gary K. Nitzberg)
Subject: Perl 5.003 .PDF Manual. WHERE???
Message-Id: <5kvm4k$bbe@dfw-ixnews7.ix.netcom.com>
I'm trying to find a copy of the Perl 5.003 Manual in .PDF format.
All I can find is the 5.004 Beta. Does anyone know where there
is a copy of the 5.003 manual in PDF format. TIA.
Gary.
gknitz@nitzspace.com
------------------------------
Date: 9 May 1997 19:03:26 GMT
From: jhb@delmar (John Bollenbacher)
Subject: Re: Perl auto-replier
Message-Id: <5kvsdu$pjs@taxis.corp.titan.com>
Since it will always be the case that inquisitive, well-meaning neophytes will
from time-to-time stumble into this newsgroup before knowing what FAQ stands
for (or in other ways be ignorant of Netiquette), perhaps it would make sense
to institute an auto-replier that can be disabled easily by a poster.
How about an auto-replier that sends mail to the poster explaining some of the
basics of Netiquette plus the advisory that this same mail will be sent in
reply to any posting which does not contain '*' in the title.
Readers of postings might then have a clearer idea of how worldly the poster is
and adjust flame length accordingly.
Regards.
--
-----------------------------------------------------------------------------
- John Bollenbacher (work) (619) 552-9963 -
- Titan Linkabit Corp. jhb@titan.com -
- 3033 Science Park Rd. -
- San Diego, Ca. 92121 (home) jhb@cts.com -
-----------------------------------------------------------------------------
------------------------------
Date: 9 May 97 13:39:03 EDT
From: jcoleman@alison.sbc.edu
Subject: PerlScript Objects
Message-Id: <1997May9.133903.283@alison.sbc.edu>
Does anyone know the proper syntax to use when accessing ASP objects with
PerlScript? If so, can you point me to a webpage where this information is
kept? Or atleast post it here for everyone else?
Thanks,
John Coleman
jcoleman@sbc.edu
------------------------------
Date: 9 May 1997 18:11:14 GMT
From: gej@spamalot.mfg.sgi.com (Gene Johannsen)
Subject: Problem with file handles
Message-Id: <5kvpc2$6td$1@murrow.corp.sgi.com>
Hey:
I'm trying to implement a simple log file package, and I use this
for the open:
sub open {
my $class = shift;
my $logfile = shift;
my $header = shift;
open LOG, ">>$logfile" || die "can't open $logfile: $!";
return bless [\*LOG, $header], $class;
}
This works okay when I open up just one log file, but when I try to
open up two, all the log messages go to the second one. I think the
problem is that file handles are sort of global. I thought LOG would
go away after the function call, but I could keep the reference and use
it to access the file, and then reuse LOG on another file.
Using 'local *LOG' doesn't work, because then the filehandle does go
away when the sub ends, and the reference too.
Does anyone know how to do this?
gene
------------------------------
Date: Fri, 09 May 1997 18:45:22 GMT
From: john2@zapcom.net
Subject: problems with open command
Message-Id: <33737036.15956643@news.zapcom.net>
I'm a newbie and have a very basic question. Can anyone tell me why
the following won't work? I have the permissions wide open (777) and
of course, I have my own path in the $logdir.
I'd really appreciate any help.
Liz
liz@zapcom.net
#!/usr/bin/perl
$logdir = path/to/log/dir";
$logfile = "test.log";
$reflog = "$logdir/$logfile";
$crlf = "\x0d\x0a";
print "content-type: text/html$crlf";
print "$crlf";
$referer = $ENV{HTTP_REFERER} or exit 0;
print qq(<a href="$referer">Back</a>);
lock();
open(REFLOG, ">>$reflog") or die "cannot open $reflog!\n";
print REFLOG "$referer\n";
close REFLOG;
unlock();
------------------------------
Date: Fri, 09 May 1997 10:22:14 -0700
From: Michael Levasseur <levass@gdesystems.com>
Subject: Re: Remove HTML tags from docs????
Message-Id: <33735D46.97E@gdesystems.com>
Bob Wilkinson wrote:
>
> In article <33669651.1028679@news.hooked.net>, steve@gamespot.com (Steven
> Young) wrote:
>
> > It sure would be nice if someone could post a script that removes IMG
> > and TABLE tags from HTML docs.
>
> And what have you tried to accomplish this task?
>
> Bob
>
> --
> I have become death, destroyer of the worlds.
Well I have a SED script:
#!/usr/bin/csh
sed 's/<[^>]*>//g' $argv.html > $argv.txt
------------------------------
Date: Thu, 8 May 1997 08:49:17 GMT
From: ccsis@bath.ac.uk (Icarus Sparry)
Subject: Re: Renaming a mail file based on the date
Message-Id: <E9utu4.M7M.B.stealth@bath.ac.uk>
In article <5kptj9$mov@lynx.dac.neu.edu>,
Zachary Brown <zbrown@lynx.dac.neu.edu> wrote:
>I want to use procmail and formail to organize mailboxes, and part of the
>organization process is to put groups of messages in date order. Procmail
>and formail won't do this, unless I have a short script that can
>understand email headers, extract the date, translate it into the number
>of seconds since 1970 (or whatever that number is that I've read about),
>and use that as the new filename to put the message in.
You might consider looking at 'MH', instead of procmail. This is mainly designed
as tool for reading mail, but it has extensive facilities for sorting messages
according to date, subject etc.
------------------------------
Date: 9 May 1997 17:26:38 GMT
From: logan78@aol.com (Logan78)
Subject: Sockets
Message-Id: <19970509172601.NAA28811@ladder01.news.aol.com>
Ok, I'm having a prob that's driving me nuts, I connect to port 6667 of an
irc server (like irc.phoenix.net), I know I'm connected because it shows
up with netstat -a. Next I do something like:
while () {
if ($line=<SOCK>) {
print $line;
}
if ($input=<STDIN>) {
print SOCK $input;
}
now, the probs:
1. the second if block doesn't loop right unless I comment out the first
(I know
this because I changed SOCK to STDOUT and it only echo'ed the first
input)
and the same holds true for the first
2. it's not sending anything to the SOCK for some reason (I also tried
send
SOCK, $input, MSG_OOB)
I'm just really stuck, suggestions please?
Thanks,
Logan
------------------------------
Date: 9 May 1997 18:31:03 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: STRAW POLL: RFD: comp.lang.perl reorg
Message-Id: <slrn5n6rb7.pv6.I-hate-cyber-promo@news.rediris.es>
[NB: followup to poster]
In order to gage which groups would have a fighting chance of passing a
CFV vote, I would like to ask you to participate in an INFORMAL ballot.
This is NOT a vote to decide upon the creation of these groups, but a
non-binding consultation to assist the proponents in deciding which
groups should be included in the official RFD. Vote on the proposed
group names and subject areas ONLY. At this stage, I'm not interested
whether or not you agree with the moderation provisions of the charter.
Please take into account that the script that will process your vote is
a quick hack I've just thrown together in a few minutes. It is not very
sophisticated, and will not deal with blank or erroneous ballots
particularly graciously. It will however send you an acknowldgement
including what it thinks your vote was, so if you think there was an
error somewhere, vote again, using the same From and Reply-To addresses
(the script prefers the Reply-To address over the from).
Whatever else you do, PLEASE include the words "straw poll" (case is
not significant; the quotes don't matter) in the subject header, since
that's how my email filtering software will pick out ballots and pipe
them to the script.
Do NOT publish your vote in the group; send it to me by EMAIL.
The ballot will close on Saturday, 10th of May sometime in the morning
(as soon as I'm awake enough to logon).
Now for the vote: please fill in either YES or NO in the space provided
below. Your vote MUST be between the square brackets. Don't alter the
line in any other way. You may add a quote mark at the beginning of the
line, but if you use some silly quoting mechanism that will make the
lines wrap, please edit them manually so they don't.
I vote [ ] to comp.lang.perl.data-structure
I vote [ ] to comp.lang.perl.inter-process
I vote [ ] to comp.lang.perl.programmer
I vote [ ] to comp.lang.perl.regex
If you would like to suggest any alternative/additional groups, please
complete the group name below (one group per line). If you don't,
please delete the following line altogether.
I vote [ YES ] to comp.lang.perl.
Don't bother voting for comp.lang.perl.{cgi,www,wizards,guru,etc.}
since I will not include any such thing in the official RFD. I am
confident that all the proponents share this position.
I repeat that if the vote ack you receive from the script doesn't
correspond to your vote, vote again using the same address. If all
else fails (and I see no reason why it should), mail me your vote
without the words "straw poll" in the subject, and I'll process it
manually.
Multiple votes will only be counted once, so Netscape users can breathe
easy. Hit that send button as many times as you want. :-)
NB: the dodgy looking address in the headers is perfectly good. Please
use it.
Cheers,
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl archive: <URL:http://www.perl.com/CPAN/>
------------------------------
Date: 9 May 1997 16:23:31 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: url detection in a string
Message-Id: <5kvj23$l98$1@news.netusa.net>
Alastair Aitken <a.aitken@unl.ac.uk> wrote:
>Sascha Kerschhofer wrote:
>> $test = "look at http://info.com/mor.html for further information";
>> &findurl($test);
>>
>> $test should now be: "look at <A
>> HREF="http://info.com/more.html">http://info.com/more.html</A> for further
>> information"
>> $_ =~ s/(.*)(\shttp://.*\s)(.*)/$1 <A HREF="$2">$2</A> $3/g
^^^^^^^^^^^^^^^
Oh. Bad idea. That will not work at all.
s,(\bhttp://\S+),<A HREF="$1">$1</A>,g
Would be much better. It still has some flaws, such as what if there is
a ',' '.' etc after the URL that is not part of it. Without knowing all
the data you will encounter these are hard to deal with.
>require 5.003;
I believe mine will work in perl4.
> $test = s#"|\\##g;
Why does he want to do this?
> $test =~ s#(.*)\s(http://.*?)\s(.*)#$1 <A HREF="$2">$2</A> $3#g;
I don't like how you replace \s with a space, but I suppose it is
consistent with the original attempt. I hate your usage of ".*?" to
mean "\S*". It breaks regexp portibility (of concept) without gaining
anything. "*?" is only used to advantage on multibyte boundry strings.
>The first substitution (using the '#' character to separate the elements
>of the 's' function) removes all escape characters and double quote -
You seem to have a broken definition of "escape" characters. You are
removing " and \ for no reason I can deterimine. If these belong in
a URL, then you just broke the URL. AFAIK raw "\"s are fine in URLs.
Raw "s are not, they should be encoded as "%22". You should not even
see them in your source text URLs.
RFC 1738 defines a method of encapsulating URLs in plain text. If
you use this, then finding URLs is made very easy:
m,<(url):([^>]*)>,i;
$pre=$`;
$encaps=$1; # preserve case of original
$post=$';
$url=$2;
$url =~ tr: \t\n\r::d ;
$_ = $pre . '<' . $encaps .
':<A HREF="' . $url . '">'
. $url . '>' . $post;
Repeat as needed.
Or if you are really sick and twisted, this one works, too:
s@<(url):([^>]*)>
@'<' . $1 .
':<A HREF="' .
($foo=$2,$foo=~tr: \t\n\r::d,$foo) .
'">' . $2 . '>'
@gixe;
Elijah
------
s/<...>/<...>s:<...>:<...>:<...>/e has got to be my favorite perlism
------------------------------
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 458
*************************************