[6780] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 405 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 1 13:17:21 1997

Date: Thu, 1 May 97 10:00:25 -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           Thu, 1 May 1997     Volume: 8 Number: 405

Today's topics:
     &ReadParse(*input) (Jason Hang Yee Kwang)
     Re: &ReadParse(*input) (A. Deckers)
     Re: @INC and . (Quentin Fennessy)
     Re: Avoid writing a temp file (Andrew M. Langmead)
     Re: Built in Perl func to expand env vars??? (A. Deckers)
     Comm.pl (Jim Ray)
     Re: Creating files (Kyzer)
     data type request <rkm@cs.wayne.edu>
     Re: data type request (brian d foy)
     Re: Deadlock handler in Sybperl 2.0x mpeppler@mbay.net
     Re: dos2unix (Kyzer)
     Re: Good editor for W95? <sarapata@pobox.com>
     Re: hashes, -d's "x", and Data::Dumper <mcampbel@tvmaster.turner.com>
     Help... How do I Install Perl 5 for NT and MIIS? <support@cyberglobe.net>
     Re: How to join 2 different files togheter (marc spitzer)
     Re: Notice to antispammers <rsi@lucent.com>
     Re: Notice to antispammers <rsi+usenet@earthling.net>
     Re: Notice to antispammers (Nathan V. Patwardhan)
     Re: Notice to antispammers (I R A Aggie)
     Re: perfunc mkdir question <cdh@CompleteIS.com>
     Re: Perl 5.003 bug??? (Quentin Fennessy)
     Re: Perl auto-replier (Joel Coltoff)
     PRINTF irregularities? (Jeremy T. Elston)
     Re: question: how to trim a string passed via hard refe <merlyn@stonehenge.com>
     Question: regexp reduction? <yingchen@fir.fbc.com>
     request for help <rkm@cs.wayne.edu>
     Re: tarring files in memory (felix k sheng)
     Time Question... <cristo@consotech.se>
     Re: URGENT: Building perl 5.003 on Solaris 2.5.1 <coles@kos.net>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 01 May 1997 12:56:47 GMT
From: hangyk@singnet.com.sg (Jason Hang Yee Kwang)
Subject: &ReadParse(*input)
Message-Id: <336892d9.816569@news.singnet.com.sg>

Hi anyone,

	What does the * mean in...

	&ReadParse(*input);

	Thanks.



------------------------------

Date: 1 May 1997 15:36:26 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: &ReadParse(*input)
Message-Id: <slrn5mhe3f.od.I-hate-cyber-promo@nessie.mcc.ac.uk>

In comp.lang.perl.misc,
	hangyk@singnet.com.sg wrote:
>Hi anyone,
>
>	What does the * mean in...
>
>	&ReadParse(*input);

It's a typeglob, and it's outdated in this context. Use CGI.pm instead of
cgi-lib.pl.

For more information see the perl manual pages, the Camel book, and the
many Perl-related FAQs.

HTH,

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/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<


------------------------------

Date: 1 May 1997 15:04:03 GMT
From: quentin@remington.amd.com (Quentin Fennessy)
Subject: Re: @INC and .
Message-Id: <5kabd3$bd5$1@amdint2.amd.com>

In article <5k7n9l$n2c$1@news.more.net>, Dan Niles <dan@more.net> wrote:
>Why does perl stop printing if I remove '.' from @INC?

Dan -
	Please provide an example of code that fails.  Typically
perl works fine without . in @INC.  Unless of course that is where
you are loading some critical module from.


-- 
Quentin Fennessy			AMD, Austin Texas


------------------------------

Date: Thu, 1 May 1997 14:19:44 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Avoid writing a temp file
Message-Id: <E9IAGw.9yL@world.std.com>


Scott Chapal <schapal@jonesctr.org> writes:

>In the example below, I created the subroutine with find2perl.
>I then concatanate the 100's of small files found with:
>    print OUTFILE <IN>,"\n";
>to a temporary file.

Maybe you should pick up a perl tutrorial book and learn about the
basic array manipulation functions and operators.

push @collection, <IN>, "\n";

>Later, $rec is created by an ugly sequence of piped UNIX
>programs from the temporary file.

The important thing to notice, is that the unix shell commands are
looping through the file line by line. If the perl functions and
operators that you want to use work on scalars, you need to set up the
looping yourself. If they work on lists (especially if the take a list
as input, and return a list as output.) you can set them up in a way
similar to pipes. The big difference is the order is reversed. Instead
of:

   cat file | tr ^ @ | grep 'key:'

you say:

   print grep /key:/, tr/^/@/, @file;


So lets go over what the shell command does:

dos2unix is proably replacing dos formatted lines (each line
terminated by a carriage return/line feed) to unix ones (each line
terminated only by a linefeed.)

Obviously (well I hope obviously. Otherwise can I suggest the perl
tutorial again?), the way to do that on a scalar containing one line
of text would be to remove the carriage return with the operation
"s/\r//" or tr/\r//d; 

The tr command maps fairly well between the shell command and perl.
tr/\t/;/;

The sed program deleted every line that begins with a dollar sign. The
regular expression look identical to the perl equivilent, and all you
need to know is that /d deletes the line if it matches. (If you didn't
know that, you could look it up in the sed man page.)

The grep commands, because they have the -v option, are removing lines
that match the specified pattern.

That makes the result:

foreach $line (@collection) { # or while(defined $line = shift @collection) {
   $line =~ s/\r//; # remove dos carriage returns.
   $line =~ tr/\t/;/; # replace tabs with semicolons
   next if $line =~ /^\$/;  # skip lines that start with dollar sign
   next if $line =~ /Report/; # skip lines that contain the word "Report"
   next if $line =~ /Pkno/;   # skip lines that contain the word "Pkno"
   next if $line =~ /Total/;  # skip lines that contain the word "Total"
   push @srec, $line;         # add the result to the list of valid records.
}

Or a more shellish:

@srec = grep !/Total/, grep !/Pkno/, grep !/Report/, grep !/^\$/, 
        map { tr/\t/;/ } map { tr/\r//d } @collection;

(the tr/// commands operate on scalars. The map{} command repeats a
command for each element of a list. Essentially, it turns a scalar
operator into a list operator.)

You probably the first one.

Now once you have this loop done, you might want to start moving the
stuff from the loop on @srec, into the loop creating @srec. But I've
got to leave something for you to do, don't I.

-- 
Andrew Langmead


------------------------------

Date: 1 May 1997 15:38:06 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: Built in Perl func to expand env vars???
Message-Id: <slrn5mhe6j.od.I-hate-cyber-promo@nessie.mcc.ac.uk>

In comp.lang.perl.misc,
	keesh@cs.cmu.edu wrote:
>
>Hello,
>
>I am currently learning Perl from the Camel book.
>Is there any built-in Perl functionality(non system calls) to expand
>environmental variables?

while (($key, $val) = each %ENV) {
	print "$key=$val\n";
}

Perl stores environment varaibles in the %ENV hash.

HTH,

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/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<


------------------------------

Date: 1 May 1997 15:51:53 GMT
From: jdr@sloth.mlb.semi.harris.com (Jim Ray)
Subject: Comm.pl
Message-Id: <5kae6p$lnq@hearye.mlb.semi.harris.com>
Keywords: Comm.pl, expect

Has anyone seen that elusive Comm.pl.1.6 anywhere?  I saw a reference
to that release back in March (7) posted by Clay Irving, but have
neither found 1.6 or seen any more references to it.

Does anyone know where this version is?
Are there any plans to make this a standard module?

Any info would be welcome.

Thanks,



-- 
Jim Ray                                Harris Semiconductor
Internet:  jdr@semi.harris.com         PO Box 883   MS 62B-022
Phone:     (407) 729-5059              Melbourne, FL  32901


------------------------------

Date: 1 May 1997 16:24:25 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: Creating files
Message-Id: <5kag3p$437@info.abdn.ac.uk>

Darren Weiner, while smelling of fish, wrote:
: Another one of those "I thought I knew what I was doing, but" questions.
: I've been trying to create a file, using either sysopen or open.
: When I run the script via telnet, everything works fine.
: When I run the script via my browser, I DO NOT get an error, yet the
: file is not created.
: Thanks in advance for helping to make my world sane again...

Checklist:

the default checks always needed :)
- perl -w mode?
- have you read ALL the manpages AND dowloaded, installed, and read over the
  ENTIRE CPAN site?
- perl -w mode?

more useful checks
- open(FISH,'>blah') || die;  ?
- are you in the same directory in telnet as the CGI executor/wrapper switches
  to before executing?
- does the cgi executor/wrapper need a special switch to report errors?
- does the cgi executor/wrapper run as YOU? (otherwise it can't write to YOUR
  filespace)
- will you post this to comp.infosystems.www.authoring.cgi next time???

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!
Packing class and eating pies!


------------------------------

Date: Thu, 01 May 1997 10:25:25 -0500
From: mallela reddy <rkm@cs.wayne.edu>
Subject: data type request
Message-Id: <3368B5E5.5428@cs.wayne.edu>

Respected Sir/Madam,
I am a student from wayne state university.
I have a problem with the data type. I want to 
convert $45.5625 into $45.60 or $45.55 not by using 
chop twice.
please mail to me the solution. I need this as I 
have to submit the project today at 12:30 Pm.
Thanking you Sir/Madam,
Sincerely,
MALLELA REDDY
rkm@cs.wayne.edu
--


------------------------------

Date: Thu, 01 May 1997 12:48:39 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: data type request
Message-Id: <comdog-0105971248390001@nntp.netcruiser>

In article <3368B5E5.5428@cs.wayne.edu>, mallela reddy <rkm@cs.wayne.edu> wrote:

> Respected Sir/Madam,

well, that eliminates me, but here goes...

> I am a student from wayne state university.
> I have a problem with the data type. I want to 
> convert $45.5625 into $45.60 or $45.55 not by using 
> chop twice.
> please mail to me the solution. I need this as I 
> have to submit the project today at 12:30 Pm.

i suppose that printf() or sprintf() would do what you want, but
i'd have to check the perlfunc manpage to be sure. 

btw, where are all of those quarter cents going?  into the 
programmers bank account? ;)

-- 
brian d foy                              <URL:http://computerdog.com>                       
unsolicited commercial email is not appreciated


------------------------------

Date: Thu, 01 May 1997 09:21:20 -0600
From: mpeppler@mbay.net
To: paul@spry.com
Subject: Re: Deadlock handler in Sybperl 2.0x
Message-Id: <862496359.14551@dejanews.com>

In article <01bc55ae$e65bd620$a501b9c6@freedom>,
  "Paul Steward" <pauls@spry.com> wrote:
>
> Has anyone written a deadlock handler for Sybperl that is freely available?
>
> Paul Steward

I've done it like this:

First, in the msg_handler(), store the last error in a global (or
package global) variable (let's call it $_lastErr).

sub msg_handler {
    my ($db, $message, $state, $severity, $text, $server, $procedure,
$line) = @_;

    if($severity > 10) {
        $_lastErr = $message;
    }

        if ($severity > 0) {
                # do normal message handling here

etc...


Then the insert/update/delete function becomes something like:

sub DEADLOCK { 1205; }   # Sybase DEADLOCK error msg number

sub execSql {
    my $dbh = shift;
    my $sql = shift;

    my $max_retries = 10;

DEADLOCK: while($max_retries--) {
        $dbh->dbcmd($sql);
        if($dbh->dbsqlexec != SUCCEED) {
            if($_lastErr = DEADLOCK) {
                next DEADLOCK if($max_retries);
                carp "deadlocked more that 10 times, aborting...";
                last DEADLOCK;
            }
            last DEADLOCK;
        }
        my $ret;
        while(($ret = $dbh->dbresults) != NO_MORE_RESULTS) {
            if($ret == FAIL && $_lastErr == DEADLOCK) {
                next DEADLOCK if($max_retries);
                carp "deadlocked more than 10 times, aborting...";
                $dbh->dbcancel;
                last DEADLOCK;
            }
            if($dbh->DBROWS != FAIL) {
                warn "execSql($sql) returned rows!";
                my @dat;
                while(@dat = $dbh->dbnextrow) {
                    print STDERR "@dat\n";
                }
            }
        }
        last DEADLOCK;     # exit from the DEADLOCK loop, we're all done
    }
}


Hope this helps!

Michael

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


------------------------------

Date: 1 May 1997 16:16:21 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: dos2unix
Message-Id: <5kafkl$437@info.abdn.ac.uk>

Charles F. Ritter, while smelling of fish, wrote:
: Tammy (or Kevin) Cotter wrote:
: > Someone then told me I needed to dos2unix the thing (didn't know what that
: > was)- so I searched around the net and came to
: > http://traffic.ce.gatech.edu/courses/ce2523/dos2unix.htm
:  
: You could have saved yourself the search and learned more about perl if
: you had written your own dos2unix. Example:
[snip]

Actually, as for 'basic dos2unix' conversion, I prefer perl -wpe 's/\r\n/\n/;' 
but the "real" dos2unix is a bit more advanced than that; it not only converts
line endings (which I admit is all that would matter to a programmer and his
sources), but also maps the characters from the lamebrained DOS/Windoze
character set(s) to the ISO-Latin1 standard set as well. Therefore those foreign
types can write their essays with peace of mind.
As for doing the entire job of dos2unix in a perl script, you need to support
the multitude of dos text formats, but if you can get the correct one, you
just need to execute one very long tr/// composed of almost pure octal :)

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!
Mr Bishop from next door used to complain of a drafty passage, saucy devil.


------------------------------

Date: Thu, 01 May 1997 10:11:47 -0400
From: Steve Sarapata <sarapata@pobox.com>
Subject: Re: Good editor for W95?
Message-Id: <3368A4A3.44D4@pobox.com>

scott@lighthouse.softbase.com wrote:
> 
> George Rogers Clark (clarkgr@erinet.com) wrote:
> 
> : Your Unix boxes and Win95 (or DOS) boxes use different end-of-line
> : markers.  You need an editor which works on Win95, but allows you to
> : save the file to a Unix file format for transport to your Unix boxes.
> 
> I just use vi on the UNIX machine (I don't even bother writing a sed
> script) to change this. (As in :g/[enter]/s/// to delete all ^M's.) You
> could write a sed script to translate multiple files if you had a
> lot to do.
> 
> It's not a big deal, and not worth the solution of abandoning Emacs
> for some shareware editor you'd have to learn all over again.
> 
> Scott

There are other options here:

  To convert DOS to UNIX, run dos2unix on the UNIX machine,
  To convert UNIX to DOS, run unix2dos on the UNIX machine,
  Using vi on UNIX use the command :g/^V^M/s/// 

Steve


------------------------------

Date: 01 May 1997 12:10:53 -0400
From: Mike Campbell <mcampbel@tvmaster.turner.com>
Subject: Re: hashes, -d's "x", and Data::Dumper
Message-Id: <r5911zgoky.fsf@tvmaster.turner.com>

ilya@math.ohio-state.edu (Ilya Zakharevich) writes:


> > Given:
> >    use Data::Dumper;
> >    
> >    $myhash{'A'}{'0'}{'X'} = "hello";
> >    $myhash{'A'}{'0'}{'W'} = "world";
> >    
> >    $myhash{'A'}{'1'} = "now";
> >    $myhash{'A'}{'1'}{'X'} = "is";
> >    $myhash{'A'}{'1'}{'W'} = "the";
> 
> Your code is broken, you forgot to put
> 	use strict;
> at the top (as anyone should- unless you understand the complications you
> get into if you drop it).

And how exactly does the lack of "use strict;" in this context "break"
the code?











------------------------------

Date: 1 May 97 14:10:21 GMT
From: "Network/Systems Technician" <support@cyberglobe.net>
Subject: Help... How do I Install Perl 5 for NT and MIIS?
Message-Id: <01bc5639$66e8f900$87da6bcf@hxdaemon>

Hello,

I need help to install Perl 5 on Windows NT and MIIS.  I have tried and
still does not work.  How do I make it work?  If someone is experienced in
this field, Please contact me voice (Collect) to help me out.  I just do
not have the time to start trying to figure out how to make it run.  
If you can type it out... I would greatly appreciate it.  I thought it
would be easy but I guess Not.

Thank you in advance.

Rudy Komsic
514-342-3883
e-Mail: rudyk@cyberglobe.net


------------------------------

Date: 1 May 1997 11:30:29 GMT
From: spitzerm@ws14.ug.cs.sunysb.edu (marc spitzer)
Subject: Re: How to join 2 different files togheter
Message-Id: <5k9usl$b7r$1@abel.ic.sunysb.edu>


In article <33665392.17332CBD@tecnogi.mdnet.it>,
Marco Giardini  <marco@tecnogi.mdnet.it> wrote:
>I have 2 differnet files with the same number of rows and I want to
>join them togheter in order to get only one file that will have for each
>row the "sum" of the rows of the single file.
>
>I.E.
>file1
>a
>b
>c
>d
>e
>
>file2
>1
>2
>3
>4
>5
>
>the result i need is something like:
>file RESULT
>a 1
>b 2
>c 3
>d 4
>e 5
>
>How can i get the combined file using Perl?
>What is the right sintax to produce a third file (RESULT) so combined as
>mentioned above?
>Please note that i;m quite new to Perl .....
>Thanks to everybody will give ma an help mailing me to
>marco@tecnogi.com or giardini@telnetwork.it
>
>Thanks again
>
>Marco
>-- 
> http://www.tecnogi.com/marco/

ok here it is:

while(<FILE1>)
{
	chop;
	print FILE3 $_;
	$_ = <FILE2>;
	print  FILE3 " $_";
}

also you need to open all 3 files and FILE3 needs to be opened for 
writting.  It took me most of 2 days to figure that out the first 
time.

marc
    
ps my server will not allow me to post unless the line count in the 
new text is > than the orig message please deleate all the empty lines if you
reply.
marc






































------------------------------

Date: 01 May 1997 10:21:33 -0400
From: Rajappa Iyer <rsi@lucent.com>
Subject: Re: Notice to antispammers
Message-Id: <xnyzpufl1ci.fsf@placebo.hr.lucent.com>

nvp@shore.net (Nathan V. Patwardhan) writes:

> Rajappa Iyer (rsi@lucent.com) wrote:
> 
> : > Fair enough.  Therefore Tom is putting useless content on a webpage, 
> : > and it shouldn't mean anything to you unless someone sends you spam.
> 
> : And what do you suggest I do when that happens? Note that I said when
> : and not if.
> 
> Tolerate.  Don't munge your address ... filter instead.  In fact, I enjoy
> filtering 200x as much as I might enjoy screwing with my mail header.

Not everyone is gifted with the kind of tolerance spam mail would
demand and not everyone has the time or inclination to filter out the
junk. Fighting spam with filtering is a losing battle... they come up
with new domains and tricks all the time. Don't blame people for not
wanting to fight a losing battle.

> : Any particular reason for the admiration or am I to take your disdain
> : as a convincing counter argument?
> 
> Because you seem to be the most vehement (and sometimes downright hostile)
> of the bunch, so you get the dubious honor of my heckling.

I don't know if I've been hostile, but I'll freely admit to being
vehement. In any case I have presented reasons for my opposition that
can be debated. You, on the other hand, have had nothing but sarcasm
to back up your position... I guess I know what value to place on your
opinions.
-- 
Rajappa Iyer <rsi@lucent.com>	   #include <std_disclaimer.h>
	They also surf who only stand on the waves.


------------------------------

Date: Thu, 1 May 1997 13:41:17 GMT
From: Rajappa Iyer <rsi+usenet@earthling.net>
Subject: Re: Notice to antispammers
Message-Id: <E9IB23.L3C@nonexistent.com>

fl_aggie@hotmail.com (I R A Aggie) writes:

> In article <xnyafmggu5t.fsf@placebo.hr.lucent.com>, rsi@lucent.com wrote:
> 
> + use. The moment you do this, you are using my resources. When Tom
> + hands my address on a platter to spambots, he's essentially saying
> + "use this computer's resource." Is it legal? Yes. Is it ethical? No
> + way in hell.
> 
> So, TomC is now responsible for spam? heheheheheh

Not responsible for spam... but responsible for aiding and abetting in 
the cause of spammers out of spite. Childish, really!

> It's no more or less ethical than publishing the "Anarchist Cookbook",
> or selling nitrogen-based fertilizer. How many technological advances
> has Lucent developed that can be abused? should Lucent be held responsible
> for them?

This is a silly analogy. The primary purpose of the technological
advances in Lucent was not so it could be abused.

OTOH, publishing howto's for bombs is irresponsible. It may not be
illegal, but it is irresponsible.
--
<rsi@earthling.net> a.k.a. Rajappa Iyer.	New York, New York.
	They also surf who only stand on the waves.


------------------------------

Date: 1 May 1997 16:08:41 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Notice to antispammers
Message-Id: <5kaf69$q3b@fridge-nf0.shore.net>

Rajappa Iyer (rsi@lucent.com) wrote:

: can be debated. You, on the other hand, have had nothing but sarcasm
: to back up your position... I guess I know what value to place on your
: opinions.

Not true.  I suggested that more people should filter unwanted mail
and provided some reasons.  I think that there's no reason to munge
e-mail addresses because there are many mail clients which filter,
so I'm not willing to argue about the ethics of munging because I
consider the point to be moot.  Like I said, when I get my website
back up, I'll be providing as much information I can about installing/
configuring various clients for filtering mail (on various platforms).

Since I perceived your arguments to stem from your feelings, without
any clear suggestions to improve the situation, and your tone was not 
very pleasant (argumentative, aggressive), I responded accordingly,
hence the sarcasm.

As for your argument about "so many spammers so little time... it's
impossible to filter, etc", I can't possibly fathom how much spam
mail you must be getting?  I highly doubt that your time will be
improperly expended if you add two lines to your procmail (or
whatever) filter file each time a new spam host appears.  I highly
doubt that your filter file will ever grow so large that it will
over-run your filesystem.

As I've always stood: filter.  Since you don't have the time to
start your own filter, I'm going to include my .procmailrc for
you to use.  I'm not going to debate this anymore, because as
peaved as people are getting, my suggestion will always be the same,
and I'm sure you're sick to death of reading it by now.  I'll let
everyone know when the mail filtering pages are done.

MAILDIR=/home1/n/nvp/Mail
LOGFILE=/home1/n/nvp/Mail/procmail.log
META=$1

:0:
* ? test $META = "syn"
syn

:0:
* ? test $META = "test"
lennon-test

### BEGIN SPAM FILTERS

# simple way to filter some domains and users into the trash,
# without passing go or collecting $200

#DOMAINS
:0:
* ^FROM.*@savetrees.com
/dev/null

:0:
* ^FROM.*you-are-approved!.com
/dev/null

:0:
* ^FROM.*@moneyspider.com
/dev/null

:0:
* ^FROM.*@answerme.com
/dev/null

:0:
* ^FROM.*@CurrencyFlaw.com
/dev/null

:0:
* ^FROM.*@lotsmorehits.com
/dev/null

#USERS
:0:
* ^FROM.Windansea@mail1.access.digex.net
/dev/null

:0:
* ^FROM.CandyMan@mail3.access.digex.net
/dev/null

##if the spam fest ever needs to be escalated, a simple way to
## generate an autoreply, filtered by domain
##the man page for procmailex has some more full-on
## approaches which might be useful at some point
#:0:
#* ^FROM.*@ag.com*
#{
#:0 h
#* !^FROM_DAEMON
#* !^X-Loop: chamer@nfic.com
#| (formail -r -A"X-Loop: chamer@nfic.com" ; echo "bad spam") | $SENDMAIL -t
#}

###END SPAM FILTERS

# Normal e-mail delivery
:0:
/home1/n/nvp/.mail



--
Nathan V. Patwardhan
nvp@shore.net


--
Nathan V. Patwardhan
nvp@shore.net


--
Nathan V. Patwardhan
nvp@shore.net



------------------------------

Date: Thu, 01 May 1997 12:15:13 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Notice to antispammers
Message-Id: <fl_aggie-ya02408000R0105971215130001@news.fsu.edu>

In article <xnyzpufl1ci.fsf@placebo.hr.lucent.com>, rsi@lucent.com wrote:

+ Fighting spam with filtering is a losing battle... 

Sez you. There are people who are quite succesful at it.

+ they come up
+ with new domains and tricks all the time. Don't blame people for not
+ wanting to fight a losing battle.

So I should fight it for them? Thanks, but that's as bad as the
spammers. You're shifting your cost to *ME*, just like the spammers.

Here's a suggestion: go get a free, web-based email drop box, and
set your newsreader to report that address. Check every couple of
day, and trash anything that you don't recognize.

If you can create a submailbox 
<url:http://www.netusa.net/~eli/faqs/addressing.html>, then you can
filter according to the To: line and segregate Usenet-related stuff
out. If email is not addressed to you (or CC'd to you), then it is
likely spam. If email does not contain some sort of followup tag in
the Subject: line, then it is likely spam. If the From line doesn't
contain a valid group (.com, .net, .edu, .?? [state or country codes]),
then it's likely spam.

Someone in one of the abuse newsgroups came up with a perl program
to score incoming email in an attempt to distinguish between real
email and spam based on the usage of various phrases, use of all CAPS,
and the like. Seemed to work pretty well...

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: 01 May 1997 09:37:18 -0500
From: Chris Halverson <cdh@CompleteIS.com>
Subject: Re: perfunc mkdir question
Message-Id: <wpiv13qmw1.fsf@CompleteIS.com>

Paul Lussier <plussier@synnet.com> writes:

> Is there mkdir -p foo/bar/whatever functionality?
> 
> The mkdir blurb in the perlfunc manpage doesn't mention it, so I assume
> the functionality doesn't exist.
> 
> Obviously I can write a sub using File::Basename and a for loop, but I'm
> lazy and I don't want to re-invent the wheel :)

The easier way would be to use File::Path and mkpath(), it does
exactly what you want. Check out the docs.

Chris

-- 
Chris D. Halverson                         Complete Internet Solutions
PGP mail accepted, finger for public key   http://www.CompleteIS.com/~cdh/


------------------------------

Date: 1 May 1997 14:59:29 GMT
From: quentin@remington.amd.com (Quentin Fennessy)
Subject: Re: Perl 5.003 bug???
Message-Id: <5kab4h$b9j$1@amdint2.amd.com>

In article <5k4toh$p1@cri.ens-lyon.fr>,
Vincent Lefevre  <vlefevre@ens-lyon.fr> wrote:
>I've just found the problem with my script. // seems to recall the last
>regular expression. But
>_ where is it written in the doc?
>_ can one avoid this?
>In fact, I have /$d/ in my real script, and I could add a
>$d = '.' if ($d eq '');
>here, but is there a general method (that also works with empty strings)?

Vincent- 

This was tough to find (I am being serious), but here is
the paragraph in perlop(1):

             If the PATTERN evaluates to a null string, the last
             successfully executed regular expression is used
             instead.
 
I don't know how to avoid it -- this is how it works.  You could skip
the matching operation if $d was empty.


-- 
Quentin Fennessy			AMD, Austin Texas


------------------------------

Date: Thu, 1 May 1997 14:21:02 GMT
From: joel@wmi0.wmi.com (Joel Coltoff)
Subject: Re: Perl auto-replier
Message-Id: <5ka8rn$3ap@netaxs.com>

In article <Pine.A41.3.95a.970501135148.30388F-100000@sp061>,
Alan J. Flavell <flavell@mail.cern.ch> wrote:
>On 1 May 1997, Chipmunk wrote:
>
>> (And while I'm being self-righteous, why do some people have a bug up
>> their ass about people who request e-mail replies?)
>
>There's a big difference between demanding a private consultation
>from which no-one else will be allowed to benefit, and requesting
>the courtesy of an email _copy_ of the reply that will, of course, be
>_posted_ so as to leverage the answer to the wider audience.

Then there are the people who say please email me because I don't
read this group very often. You don't need to read very often only
for 3 - 5 days following the posting of your question. A few years
back I begged, borrowed and stole my way to a uucp connection for
news. I only got a few groups and if I posted to one I didn't get
would ask for an email response. That is an acceptable reason. But
don't tell me that you only look at c.l.p.m. when the moon is blue.
If that's the case then the answer is (I forget who I'm quoting)
"Ask it here, get it answered here."

As for the high signal-to-noise ratio I'll be the first to admit
that at times it's intolerable. What keeps going through my mind
is that while I'm a circuit designer at times I have a need or
desire to do a certain task in software. I usually have the skills
to do it myself and the motivation to learn it when I can't. Sometimes
I don't have the time or resources to do so. Sometimes it's something
I'm doing for fun and if I can't write a program to do it I'll just
have to thrive without it. It's nice when there are people who will
share their knowledge. Sometimes people just need to see something
explained a different way or with a more complete example. I've read
a little bit about chess. I know how all the pieces move but I still
can't play chess.

Private email responses graciously accepted. Some restrictions
may apply. Void where prohibited by law.

-- 
Joel Coltoff

I'd explain it, but there's a lot of math. -- Calvin


------------------------------

Date: Thu, 01 May 1997 15:01:25 GMT
From: TechSupport@Greenwood.net (Jeremy T. Elston)
Subject: PRINTF irregularities?
Message-Id: <5kab7p$brm$1@bigdog.ais-gwd.com>

Greetings...

        A little confused by some output.  I am a beginning Perl programmer.  
I am using Perl 5.003 on a BSDI 2.1 box.

        The confusion lies in the output from a printf statement.  I have used 
perl -w and also checked the FAQs.  The man pages for printf do not explain 
this behavior, but perhaps I am just unaware of "how things work".

The relevant section of code:
----------------
foreach (sort @user_hist) {
        ($date,$time,$pmname,$minutes) = split(/#/);
        printf("%10s  %8s   %-10s    %6.2f   %3.2f\n",
                $date, $time, $pmname, $minutes, $minutes/60);
----------------

Output:
----------------
  Login       Time     Portmaster    Time(min)    Time(hrs)
05/01/1997  07:10:07   pm2e-3        1204.77   20.08
---------------

        Although, depending on your fonts, this may not mean anything.  The 
point is that the time(min) column does not right align.  The 4 spaces after 
(%-10s) pushes to the edge of the T in Time.  I presumed that the %6.2f would 
left pad the number, so columns would align along the decimal.  Is this a 
glitch in Perl, a misunderstanding (by me) of printf???  Any suggestions are 
welcome.

        Thanks!  :-)




------------------------------

Date: 01 May 1997 06:59:15 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: brannon@bufo.usc.edu (Terrence M. Brannon)
Subject: Re: question: how to trim a string passed via hard reference?
Message-Id: <8c7mhjcmz0.fsf@gadget.cscaper.com>


>>>>> "Terrence" == Terrence M Brannon <brannon@bufo.usc.edu> writes:

Terrence> sub trim {
Terrence>     chomp($$_[0]);
Terrence>     $$_[0] =~ s/^\s+//;
Terrence>     $$_[0] =~ s/\s+$//;
Terrence> }

Terrence> trim(\$x)

Terrence> does not trim away leading and trailing whitespace. why?

Because you are dereferencing $_, which has nothing in it.  Had you
turned on "use strict", you would have caught this.  "use strict"
is your friend.  Use "use strict".

In other words, $$_[0] parses as ${$_}[0], meaning "take $_ as a
listref, deref it, and take the 0'th element of that".  You want
${$_[0]}, which means "take $_[0] as a scalar ref, deref it".

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 488 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


------------------------------

Date: Tue, 29 Apr 1997 16:44:22 -0400
From: Ying Chen <yingchen@fir.fbc.com>
Subject: Question: regexp reduction?
Message-Id: <33665DA6.41C67EA6@fir.fbc.com>

Hi all..

I have been working with regexp (a perl necessity)
As some long (almost unreadable) regexp emerges..
made me wonder about something..

let say if one has a arbiturary regexp - 
is there a way (maybe algorithm) to tell if
the regexp can be reduced/simplified?? 

Just curious - 
any ideas/suggestions/opinions/topic-point-to would be great! 
Thanks for just reading ^_^;

Ying

ps. - much thanks to people who reply to my previous posts..


------------------------------

Date: Thu, 01 May 1997 09:46:55 -0500
From: mallela reddy <rkm@cs.wayne.edu>
Subject: request for help
Message-Id: <3368ACDF.23C9@cs.wayne.edu>

Respected Sir/Madam,

 	I am a student of Wayne State university 
presently working on a perl project(grad course) namely 
"pizza online delivery"(address is 
www.cs.wayne.edu/~rkm). In the project I have given a 
variable $discount (which is 95% or 90% or 75% 
depending upon the total amount you order)of the total 
dollars. In this calculation some times it is giving 
for example as $45.5625 or some times as $45 if I tried 
to give a chop to the $discount twice it is truncating 
but in this process i am loosing $1 or it is giving $45 
as above. please suggest me how to tackle the problem. 
I need something which might  convert the variable 
$discount in to a standard datatype in the form of 
money i.e, $00.00(two digits to the right of decimal 
pointer. Please mail the suggestion to rkm@cs.wayne.edu

Thanking you Sir,
Sincerely,
MALLELA REDDY
--


------------------------------

Date: 1 May 1997 15:07:59 GMT
From: felix@chance.em.nytimes.com (felix k sheng)
Subject: Re: tarring files in memory
Message-Id: <slrn5mhcq9.fso.felix@chance.em.nytimes.com>

On Thu, 01 May 1997 07:41:16 -0600, dellis@frycomm.com <dellis@frycomm.com> 
wrote:
>I am trying to set something up so that every hour, a program launches
>that extracts all files from a directory hierarchy that have been changed
>since the last backup and copy them off to an NFS mounted disk across the
>room.  It would have been easy enough to do this in the Csh:
>
>tar -cf - `find . ! -name . -newer .last_backup -print` | (cd newdir; tar
>-xf -)

what if you did this?
find . ! -name . -newer .last_backup -print > /tmp/mylist.txt
tar -cf- -L /tmp/mylist.txt | (cd newdir; tar -xf-)

that way you're taking off all the command line expansion.

'lx

--- felix sheng                                       pager     800 979 2171
 programmer                                           tel       212 597 8069
 the new york times electronic media company          e    felix@nytimes.com


------------------------------

Date: Thu, 01 May 1997 11:13:24 -0700
From: Cristo <cristo@consotech.se>
Subject: Time Question...
Message-Id: <3368DD44.322E@consotech.se>


Hi!

Question:
How do I print the DATE and the TIME?

Example :-)
Print DATE
Print TIME

Please email me the answer to:
cristo@consotech.se


------------------------------

Date: Thu, 1 May 1997 10:13:26 -0400
From: Steve Cole <coles@kos.net>
To: FABBRETTI Roberto <Roberto.Fabbretti@dim.hcuge.ch>
Subject: Re: URGENT: Building perl 5.003 on Solaris 2.5.1
Message-Id: <Pine.GSO.3.95.970501101234.15258E-100000@mercury.kosone.com>

On Wed, 30 Apr 1997, FABBRETTI Roberto wrote:

> Using a precompiled perl available on the net is not an option because
> it is statically linked and I need to add some modules.

The PERL library at http://smc.vnet.net/ does not appear to be statically
linked.  It's almost identical in size to the one I compiled dynamically
(in fact there is even a little note about they tweaking the dynamic
loader).

Cheers,
Steve      |President & Systems Administrator,  Kingston Online Services
           |(e pluribus unix)    Multiple-T1    URL: http://www.kos.net/
           |Business and Education partners in SouthEastern Ontario
           |
           |"Through the firewall, out the router, down the T1, across the
           |backbone, bounced from satellite, it's nothing but net."
	   |(forgive me if I'm terse, I answer hundreds of e-mails a day)



------------------------------

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 405
*************************************

home help back first fref pref prev next nref lref last post