[7980] in Perl-Users-Digest
Perl-Users Digest, Issue: 1605 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 9 03:07:23 1998
Date: Fri, 9 Jan 98 00:00:49 -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 Fri, 9 Jan 1998 Volume: 8 Number: 1605
Today's topics:
C type file #include (Reception)
Re: C type file #include (J. Bacon)
Re: C type file #include <ajohnson@gpu.srv.ualberta.ca>
Re: Complex Data Stucture <rhodri@wildebst.demon.co.uk>
Re: Complex Data Stucture (Martien Verbruggen)
Conversion of Floating Point Literal Values <clarked@hunterdon.csnet.net>
Re: CRYPT() (Nathan V. Patwardhan)
Re: CRYPT() <anonymous@whatever.com>
Re: Find two strings in a file <merlyn@stonehenge.com>
gethostby??? on Solaris 2.4 dumps core <akira@discover-net.net>
Re: HELP ME How I can to compare two date 01/12/1997>=0 (Jim Britain)
Looking for a WEb Page Counter (text style) nonSSI. (Chris)
Re: match weirdness - $_++ vs. $_ + 1 (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Re: Perl editor needed <shimpei+nospam+nospam+caltech.edu@socrates.caltech.edu>
Perl for Engineering purposes (J. Bacon)
Re: Perl programming with NT4.0: sendmail problem (Troy Denkinger)
Re: Perl Question (Martien Verbruggen)
Perl to Binary? <imo@vision.net.au>
Re: Perl to EXE <jmscott@ainet.com>
pod2html for a bunch of files (Ray Zimmerman)
Re: sending email (Net::SMTP).. problem <cs@zip.com.au>
strange behaviour <dennis@claritech.com>
Re: strange behaviour (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Re: Trimming blanks (Jeremy Brinkley)
Win32 Perl ignores #! perl -s switch <gcb@slip.net>
Re: Win32 Perl ignores #! perl -s switch (J. Bacon)
Re: Win32 Perl ignores #! perl -s switch <gcb@slip.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 09 Jan 1998 01:57:17 GMT
From: farber@f-tech.net (Reception)
Subject: C type file #include
Message-Id: <34b5832d.16627943@news.f-tech.net>
There seems to be no quick answer to this.. so I'm asking the 'group.
I have a main perl program that will display a menu and run a
subroutine that is called for by the menu selection. So, being
familiar with C i decided to put all the subs in different files to
make editing eaiser (for me). I try to require
"/full/path/to/script"; but I get "fails to return a true value"
errors on the require line.....
Do I have to put all the code into one honk'n file??
Please help!
Paul
------------------------------
Date: 9 Jan 1998 03:20:29 GMT
From: jwbacon@ix.netcom.com (J. Bacon)
Subject: Re: C type file #include
Message-Id: <69451t$dut@dfw-ixnews5.ix.netcom.com>
Did you put '1' as the last line of the "include" script?
In article <34b5832d.16627943@news.f-tech.net>, farber@f-tech.net says...
>
>There seems to be no quick answer to this.. so I'm asking the 'group.
>
>I have a main perl program that will display a menu and run a
>subroutine that is called for by the menu selection. So, being
>familiar with C i decided to put all the subs in different files to
>make editing eaiser (for me). I try to require
>"/full/path/to/script"; but I get "fails to return a true value"
>errors on the require line.....
>
>Do I have to put all the code into one honk'n file??
>
>Please help!
>
>Paul
------------------------------
Date: Thu, 08 Jan 1998 21:00:13 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: C type file #include
Message-Id: <34B592BD.2D06C169@gpu.srv.ualberta.ca>
Reception wrote:
>
> There seems to be no quick answer to this.. so I'm asking the 'group.
>
> I have a main perl program that will display a menu and run a
> subroutine that is called for by the menu selection. So, being
> familiar with C i decided to put all the subs in different files to
> make editing eaiser (for me). I try to require
> "/full/path/to/script"; but I get "fails to return a true value"
> errors on the require line.....
did you read the docs concerning require?
perldoc -f require
gives quite a bit of useful information, including the
following paragraph:
Note that the file will not be included twice under the same
specified name. The file must return TRUE as the last statement to
indicate successful execution of any initialization code, so it's
customary to end such a file with "1;" unless you're sure it'll
return TRUE otherwise. But it's better just to put the "`1;'", in
case you add more statements.
hope it helps
regards
andrew
------------------------------
Date: Thu, 08 Jan 1998 23:10:16 +0000 (GMT)
From: Rhodri James <rhodri@wildebst.demon.co.uk>
Subject: Re: Complex Data Stucture
Message-Id: <480571aeb0rhodri@wildebst.demon.co.uk>
In article <34B4F90C.7DE1@meta3.com>,
Ken Holm <rets@meta3.com> wrote:
> %Hash = ("Ken" => [ "Holm", "Jackson", "MS", 27, "Web Weenie" ],
> "Jo" => [ "Smiff", "Juneau", "AK", 25, "Belly Dancer" ] );
> If I want Jo's age, I can say:
> $Age = $Hash{Jo}[3];
> How do I get a list of all of those attributes associated with Jo?
@List = @{$Hash{Jo}};
--
Rhodri James *-* Wildebeeste herder to the masses
If you don't know who I work for, you can't misattribute my words to them
... TANSTAAFL
------------------------------
Date: 9 Jan 1998 01:06:49 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Complex Data Stucture
Message-Id: <693t79$q3t$2@comdyn.comdyn.com.au>
In article <34B4F90C.7DE1@meta3.com>,
Ken Holm <rets@meta3.com> writes:
> %Hash = ("Ken" => [ "Holm", "Jackson", "MS", 27, "Web Weenie" ],
> "Jo" => [ "Smiff", "Juneau", "AK", 25, "Belly Dancer" ] );
>
> If I want Jo's age, I can say:
>
> $Age = $Hash{Jo}[3];
Since $Hash{Jo} is a reference to an array, more proper would probably
be:
$Age = $Hash{Jo}->[3];
> How do I get a list of all of those attributes associated with Jo?
@list = @{$Hash{Jo}};
You might want to read the perlref, perldsc, and perllol man pages if
you haven't done so yet:
perldoc perldsc
perldoc perlref
perldoc perllol
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: 9 Jan 1998 02:50:44 GMT
From: "David Clarke" <clarked@hunterdon.csnet.net>
Subject: Conversion of Floating Point Literal Values
Message-Id: <01bd1caa$4cbcc6a0$352914d0@clarke>
I am using PERL as an interpreter for another language (similar to
Assembler).
This language differentiates data types (floating point, integer). Is there
any way to
know from within a subroutine if the argument passed is a floating point
number which
is also a whole number? e.g.
sub interpreter {
$_ = shift;
print "Floating Point\n" if m/\./;
}
&interpreter (5.0); # Doesn't work, PERL passes 5, not 5.0
&interpreter (5.1); # Works OK
&interpreter ("5.0"); # Also works, but is awkward to use a string for my
APP
Any help would be appreciated. One of the few hurdles left on the project.
------------------------------
Date: 9 Jan 1998 04:41:34 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: CRYPT()
Message-Id: <6949pu$sat@fridge.shore.net>
Shawn M. Nelson (snelson2@home.com) wrote:
: I want to create my own CRYPT() function in Visual FoxPro that returns the
: exact same results and the NCSA CRYPT() function.
It's crypt(), not CRYPT(). You're kidding about the VFoxPro thing,
right? I mean, especially since this group deals with Perl.
--
Nathan V. Patwardhan
No, I'm not domreg@cyberpromo.com
------------------------------
Date: Thu, 8 Jan 1998 22:57:42 -0800
From: "Shawn M. Nelson" <anonymous@whatever.com>
Subject: Re: CRYPT()
Message-Id: <694i34$i7f$1@ha2.rdc1.sdca.home.com>
>It's crypt(), not CRYPT(). You're kidding about the VFoxPro thing,
>right? I mean, especially since this group deals with Perl.
No, I am not. What group would you post to if you were trying to update an
.htpasswd file by first creating the file in VFP and the FTPing the file to
an NCSA server?
Would I get the answers I need from a FoxPro group?
I, being silly, thought that I could get the answer from PERL experts faster
than FoxPro.
I don't know any FoxPro user who could tell me the algorithim used in the
crypt() function, do you? If you do know, please tell me who and I will
write them.
Thank you,
Shawn
------------------------------
Date: 09 Jan 1998 00:31:12 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: jdporter@min.net
Subject: Re: Find two strings in a file
Message-Id: <8ciuru9k8v.fsf@gadget.cscaper.com>
>>>>> "John" == John Porter <jdporter@min.net> writes:
John> Joseph N. Hall wrote:
>>
>> while (<>) {
>> exit if ($s1 ||= /string 1/) & ($s2 ||= /string 2/);
>> }
>> print "not found\n";
>>
>> No, that single & isn't a typo.
John> Ok, but could the ||= be?
no. :-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 235 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: Fri, 09 Jan 1998 01:27:46 -0600
From: Akira <akira@discover-net.net>
Subject: gethostby??? on Solaris 2.4 dumps core
Message-Id: <34B5D172.E8F23854@discover-net.net>
Hi all,
I'm running perl5.004_04 on Solaris 2.4, and everytime I call the
methods (functions?): gethostby???, as in:
@hostinfo = gethostbyname $myhost; or
@hostinfo = gethostbyaddr $host_ip;
perl dumps the core.
I examined the core, and found that a lot of lines seem to refer to NIS,
like:
/etc/nsswitch.conf
libc: bad lookup policy for %s in %s, using defaults..
yp_get_default_domain
(snip)
I'm not running NIS or NIS+, and in the /etc/nsswitch.conf, only "hosts"
is set to use dns, and all the other use files.
Any help would be much appreciated.
Thank you.
--
Akira Hangai
------------------------------
Date: Fri, 09 Jan 1998 06:43:40 GMT
From: jbritain@home.com (Jim Britain)
Subject: Re: HELP ME How I can to compare two date 01/12/1997>=01/01/1997
Message-Id: <34b5c4e9.1205474@news>
On 5 Jan 1998 08:00:03 -0500, clay@panix.com (Clay Irving) wrote:
>In <68p9r8$q4i$1@talia.mad.ibernet.es> "Jose Carrasco Clemente" <jcc@sodefesa.es> writes:
>
>>Help me i can not to compare two date.
>
>Perl Modules are your friend.
>
>Date::Manip is a friend in this case (untested):
>
Knowing how important date calculations are to business, and also
knowing how non-trivial they are to program, I thought I'd check the
package -- I envisioned near immediate application.
However, I came up with a few too many problems..
Failed Test Status Wstat Total Fail Failed List of failed
------------------------------------------------------------------------------
t/date.t 213 14 6.57% 14, 24-26, 28, 31-33,
35, 38-40,
t/date_french.t 89 3 3.37% 6, 8, 21
Failed 2/22 test scripts, 90.91% okay. 17/517 subtests failed, 96.71%
okay.
*** Error code 2 (bu21)
make: fatal error.
/sbin/make test -- NOT OK
cpan> i /Date::Manip/
Module id = Date::Manip
DESCRIPTION Manipulate/parse international dates/times
CPAN_USERID SBECK (Sullivan Beck)
CPAN_VERSION undef
CPAN_FILE SBECK/DateManip-5.20.tar.gz
DSLI_STATUS Rdpf (released,developer,perl,functions)
INST_FILE (not installed)
cpan> q
Lockfile removed.
newsmaster 3# perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 1) configuration:
Platform:
osname=irix, osvers=5, archname=IP22-irix
uname='irix newsmaster 5.2 02282016 ip22 mips '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=y useperlio= d_sfio=
Compiler:
cc='cc', optimize='-O', gccversion=
cppflags='-D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -DLANGUAGE_C'
ccflags ='-D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -Olimit 3000 -DLANGUAGE_C'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=1, d_casti32=define, d_castneg=
intsize=4, alignbytes=8, usemymalloc=n, randbits=15
Linker and Libraries:
ld='ld', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib /lib
libs=-lmalloc -lsun -lm -lc -lcrypt -lbsd -lPW
libc=/usr/lib/libc.so, so=so
useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
cccdlflags='-KPIC', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Built under irix
Compiled at Sep 9 1997 11:45:35
@INC:
/usr/local/lib/perl5/IP22-irix/5.00401
/usr/local/lib/perl5
/usr/local/lib/perl5/site_perl/IP22-irix
/usr/local/lib/perl5/site_perl
.
------------------------------
Date: Fri, 09 Jan 1998 03:11:28 GMT
From: cverr@nospam.total.net (Chris)
Subject: Looking for a WEb Page Counter (text style) nonSSI.
Message-Id: <34b69536.15817746@news.total.net>
I need a couter for my web pages but i do not want to use Server Side
Included CGI scripts because i would have to rename my page with the
.shtml extension and this would screws-up my auto update tag line used
to refresh the date of the last time i updated my page..
So if someone could tell me where i could find such a couter that
does'nt require SSI i would appreciate it very much.
If not possible, if someone could tell me why is this that when i
rename my page .shtml this auto update tag line is'nt working anymore
and how to fix it i would appreciate also.
Anyway i realy wonder why all these damn counters all require this sun
of ?%?$&& SSI to work and not just use plain .html page
Chris
*************************************************************
Please note that in order to get rid of unsolicited junk mail
my E-Mail address is a fake one so if you realy need to get in
touch with take off the word "nospam" of my email address or do
as follow; cverr at Total dot net
*************************************************************
------------------------------
Date: Thu, 08 Jan 98 21:15:30 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: match weirdness - $_++ vs. $_ + 1
Message-Id: <34b58963$4$ofn$mr2ice@speaker>
In <693og7$c98$1@news.iastate.edu>, on 01/08/98 at 11:46 PM,
kortbein@iastate.edu (Josh Kortbein) said:
+-----
| @b = map ($_++, @a);
+--->8
$_ is the actual list item, not a copy of it; the ++ and -- operators change
what they're operating on. Thus, you're incrementing every element of @a and
storing the old value (since you're using post-increment) in @b.
In general, it's a very bad idea to apply operations that have side effects to
the iteration variable of map(), grep(), or foreach(){}.
--
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)
------------------------------
Date: 9 Jan 1998 06:29:48 GMT
From: Shimpei Yamashita <shimpei+nospam+nospam+caltech.edu@socrates.caltech.edu>
Subject: Re: Perl editor needed
Message-Id: <694g4s$26o@gap.cco.caltech.edu>
Matthew Cravit <mcravit@best.com> writes:
>
>In article <1d2dgnb.19ax3jx1jym91uN@slip166-72-108-220.ny.us.ibm.net>,
>Kevin Reid <kpreid@ibm.net> wrote:
>
>>Okay, so (most) everybody on this thread is saying Emacs is great, but
>>is there a Macintosh version?
>
>Yes, there is. However, it's a port of Emacs 18.something, and I'm not
>sure whether either perl-mode.el or cperl-mode.el will work with it
>(I've not yet tried them). But, if you want it, it's available at
>ftp://ftp.cs.cornell.edu/pub/parmet/
>
>I'm still trying to find out if there's a port of Emacs 19 to the Mac,
>though.
There isn't, as far as I know (and I've looked pretty hard). The
shareware editor Alpha <http://www.cs.umd.edu/~keleher/alpha.html> is
probably the closest thing there is to emacs on the Mac; it uses Tcl
rather than Lisp (or perl :-)) as the extension language, but it has
color syntax coloring, modes, external hooks, completely modifiable
key bindings and menus, the works. I've never tried to write perl
with it, but I remember its C and C++ modes being very good.
--
Shimpei Yamashita <http://www.patnet.caltech.edu/%7Eshimpei/>
The address I have listed in the headers is a working address. It just
looks like it's an invalid address in order to fool spammers collecting
addresses from newsgroups.
------------------------------
Date: 9 Jan 1998 03:30:34 GMT
From: jwbacon@ix.netcom.com (J. Bacon)
Subject: Perl for Engineering purposes
Message-Id: <6945kq$dut@dfw-ixnews5.ix.netcom.com>
Is anybody out there using Perl for 'engineering' purposes? I just finished
up a script which communicates with GPIB instruments -- I intend to write most
all of my product test/calibration routines in Perl in the future (I am tired
of C compilers obsoleting themselves, and re-inventing the wheel).
If anybody is interested, I put the script on my web page:
http://www.netcom.com/~jwbacon/Index.html
(If you visit the site, click the Camel Icon in the left frame)
I have not seen any targeted groups for this use of Perl, but would sure be
willing to participate in one if such a group exists, or maybe if there are
other oddballs out there like myself who want to concentrate on this
particular Perl fetish, we can get something going.
------------------------------
Date: Fri, 09 Jan 1998 04:55:01 GMT
From: troy@whadda.com (Troy Denkinger)
Subject: Re: Perl programming with NT4.0: sendmail problem
Message-Id: <694b2h$fjg$1@nntp3.interaccess.com>
Also emailed...
In article <6923p6$fu8$1@ocsgw2.klm.nl>, "John Goor" <splyc2@klm.nl>
wrote:
[snip]
>Windows NT 4.0 platform.
>Now I want to invoke a 'feedback' option, however: In Unix I use 'sendmail',
>being invoked from a Perl script.
Look at Net::SMTP in the standard distribution. This works great for
a script I just wrote today. Try the sample code in the docs for the
module to get a very good idea of how this all works.
You will have to have access to an SMTP server to connect to.
Regards,
Troy Denkinger
------------------------------
Date: 8 Jan 1998 22:29:19 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl Question
Message-Id: <693jvv$p89$1@comdyn.comdyn.com.au>
> Subject: Re: Perl Question
Please check this information on how to choose a good subject for a post:
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
In article <34B4D0B5.25F1@boat.bt.com>,
Muhammad Siddiqui <SIDDIQM2@boat.bt.com> writes:
> How do I create a process on some remote machine, that will sleep for
> most of the time (but checks for the arrival of a file - via ftp). On
> seeing that the file has arrived, wakes up, does some processing or
> execute some commands and then going back to sleep before deleting the
> newly arrived file.
You can do this by writing a process as a daemon, and running that on
the remote machine, or running it as a service. You will have to do
some sockets communication etc. Implementation depends on the
platform.
Alternatively, you can have a process running which periodically
checks a certain directory for new arrivals and does something. Of
course, you'll have to make sure that it doesn't do that certain
something while transfer is still in progress.
As an other alternative: you could hack the code of the ftp server,
and change it.
In retrospect: Your question has nothing at all to do with perl, even
though your subject line suggests that. The task could be done in any
language.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: Fri, 9 Jan 1998 14:57:07 +1100
From: "Imo" <imo@vision.net.au>
Subject: Perl to Binary?
Message-Id: <69472d$qlq@pandora.vision.net.au>
Hello All,
I was wondering if it was possible to compile perl? Can it be done like C,
gcc file.c -o file or something like that?
Thanks,
John
------------------------------
Date: Thu, 08 Jan 1998 16:47:08 -0800
From: "Joseph M. Scott" <jmscott@ainet.com>
To: Greg Zevin <greg@turing.une.edu.au>
Subject: Re: Perl to EXE
Message-Id: <34B5738C.41EC@ainet.com>
No I haven't actually tried to make that work, but I've thought about
it :-) Anyone have pointers this direction?
Joseph Scott
jmscott@ainet.com
Greg Zevin wrote:
>
> blair@mdb.net writes:
>
> >I don't know what program from demobuilder you saw but I got
> >perl2exe.exe and it works GREAT for me. Don't know what "TAR" file
> >your talking about either??
>
> Well, perl2exe is nothing more than something like tar+perl run-time system.
> It does the job, though, if you need to supply to the client an 'executable'
> (non-batch) file.
>
> Actually, we use it a lot, but it doesn't pick up 'required' files,
> so I had to write a script which does it.
>
> Has anyone experienced this problem?
> E-mail replies will be appreciated.
>
> Greg
------------------------------
Date: Thu, 08 Jan 1998 10:58:31 -0500
From: rz10@cornell.edu (Ray Zimmerman)
Subject: pod2html for a bunch of files
Message-Id: <rz10-ya02408000R0801981058310001@newsstand.cit.cornell.edu>
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.
I know pod2html can do the conversion, I just haven't been able to figure
out the syntax to get it to do a whole tree at pop.
Please reply via e-mail ... TIA,
Ray Zimmerman ::: e-mail: rz10@cornell.edu ::: 428-B Phillips Hall
::: phone: (607) 255-9645 ::: Cornell University
::: FAX: (607) 254-4565 ::: Ithaca, NY 14853
------------------------------
Date: 9 Jan 1998 06:01:18 GMT
From: Cameron Simpson <cs@zip.com.au>
To: Graham Barr <gbarr@ti.com>
Subject: Re: sending email (Net::SMTP).. problem
Message-Id: <19980109173827-cameron-1-18281@sid.research.canon.com.au>
[ Posted and emailed - I don't get into the group as often as I'd like
and out news spool has a high expiry rate. - Cameron
]
Graham Barr <gbarr@ti.com> writes:
| > why do you think
| > discarding non-relayed mail will reduce your spam?
| Experience. I have spent a lot of time reading headers of
| unsolicited mail. Over the last few years I have written my
| own filters which prevent over 90% of junk mail getting into my
| mailbox. During this time I do not think I have lost any more
| that about 10 "real" mails.
Might I suggest a better method? Yours, like many, relies on author info
(which of course is routinely forged by spammers).
We've been using the following technique for some months now with good effect:
How it works: most spam is broadcast (contact SMTP service, give message to
service, tell it to deliver to thousands of people). As a consequence,
it does not have my (your) address in the To: or CC: line, nor the address of
any of the mailing lists you read.
So, you make a list of rules, saying
if To/CC has "cs@zip.com.au", it's personnally to me
if To/CC has "safety@magpie", it's to the safety list
etc etc
anything not matching a rule is spam, and filed in a folder I
glance at maybe once a week (for that odd list I forgot
to make a rule for or recently joined, etc)
This effectively removes the interruptive effect of spam.
It does take a few days to get the ruleset complete, but you then only
have to edit the rules when _you_ join a new list, not whenever some
new spammer springs up from the slime.
| Originality is the ability to conceal your source.
Hmm, a maxim spammers seem to think applies to them.
--
Cameron Simpson, DoD#743 cs@zip.com.au http://www.zip.com.au/~cs/
Yeah, though I walk through the valley of the shadow of death, I shall feel
no evil, for I am the meanest motherfucker in the valley.
- Dan Sorenson, DoD 1066, Cereal Killer, <z1dan@exnet.iastate.edu>
------------------------------
Date: Thu, 8 Jan 1998 20:30:40 -0500
From: "Dennis Grinberg" <dennis@claritech.com>
Subject: strange behaviour
Message-Id: <693upg$6m5$1@firma.jprc.com>
Maybe I'm missing something obvious here but the following seems to be a
discrepancy:
DB<19> p ${$$ref{0}}[0][0]
140
DB<20> @arf = ${$$ref{0}}[0]
DB<21> p $arf[0]
ARRAY(0x108174c)
DB<22> p $arf[0][0]
140
$ref is a ref to hash whose elements are arrays of arrays.
Why isn't $arf[0] == 140?
------------------------------
Date: Thu, 08 Jan 98 21:52:47 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: strange behaviour
Message-Id: <34b593cb$5$ofn$mr2ice@speaker>
In <693upg$6m5$1@firma.jprc.com>, on 01/08/98 at 08:30 PM,
"Dennis Grinberg" <dennis@claritech.com> said:
+-----
| Maybe I'm missing something obvious here but the following seems to be a
| discrepancy:
| DB<20> @arf = ${$$ref{0}}[0]
+--->8
You've just assigned to @a a list with a single element, that being the value
you specified (which is not an array, but a scalar which is a reference to an
array). If you want to assign the entire array, you need to do an extra
dereference:
@arf = @{${$$ref{0}}[0]}
This extra deference was implicit when you accessed the value directly, since
Perl often allows you to omit the dereference operator in that case (a "->"
operator between the two "subscripts").
--
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)
------------------------------
Date: 9 Jan 1998 04:59:41 GMT
From: jeremy@wishbone.stanford.edu (Jeremy Brinkley)
Subject: Re: Trimming blanks
Message-Id: <694art$bd3$1@nntp.Stanford.EDU>
On Wed, 07 Jan 1998 17:38:03 +0100, Peter J. Acklam (jacklam@ulrik.uio.no) put forth:
> canugi Yorugua wrote:
> >
> > I used to "trim" strings (get rid of surrounding blanks) by using
> >
> > $str =~ s/^\s*(.*?)\s*$/$1/; # Get rid of surrounding blanks
> >
> > in our Sequent box.
> > Now we have ported to a HP box and the @#!?&#&!! is not
1. Check not only perl versions but configuration--are you using HP-UX
libraries for stuff that Perl includes and if so, are they patched?
--
Jeremy Brinkley jeremy@wishbone.stanford.edu
System Administrator finger for PGP key (2.6.2) or
Stanford Blood Center http://wishbone.stanford.edu/~jeremy
------------------------------
Date: Thu, 08 Jan 1998 19:33:38 -0600
From: Gary Bartlett <gcb@slip.net>
Subject: Win32 Perl ignores #! perl -s switch
Message-Id: <884307314.267321348@dejanews.com>
The -s in the following Perl script is ignored when run from Win95 as:
C:\> perl script.pl -xyz
script.pl
---------
#! perl -s
print "-xyz\n" if $xyz;
Anyone know of a fix? Invoking as perl -x script.pl -xyz works but this
forces you to use the #! syntax.
(the -i.bak switch does work as expected though - hmmm!)
Thanks,
Gary
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 9 Jan 1998 03:25:02 GMT
From: jwbacon@ix.netcom.com (J. Bacon)
Subject: Re: Win32 Perl ignores #! perl -s switch
Message-Id: <6945ae$dut@dfw-ixnews5.ix.netcom.com>
The "#!" is ignored by Perl -- it is a comment. If it was being run from some
flavor of Unix (Linux), the "#!" would invoke Perl. Try getting batwrap or
pl2bat, which adds a 'header' and turns the perl script into a batch file.
You will have to slightly modify either one for Windows 95, because they both
add the "-S" switch, which doesn't seem to work under Win95. Hope that
helps...
In article <884307314.267321348@dejanews.com>, gcb@slip.net says...
>
>The -s in the following Perl script is ignored when run from Win95 as:
>
>C:\> perl script.pl -xyz
>
>script.pl
>---------
>#! perl -s
>print "-xyz\n" if $xyz;
>
>Anyone know of a fix? Invoking as perl -x script.pl -xyz works but this
>forces you to use the #! syntax.
>
>(the -i.bak switch does work as expected though - hmmm!)
>
>Thanks,
>Gary
>
>-------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Thu, 8 Jan 1998 19:35:32 -0800
From: "Gary Bartlett" <gcb@slip.net>
Subject: Re: Win32 Perl ignores #! perl -s switch
Message-Id: <6949cm$3pg$1@owl.slip.net>
J. Bacon wrote in message <6945ae$dut@dfw-ixnews5.ix.netcom.com>...
>The "#!" is ignored by Perl -- it is a comment. If it was being run from
some
>flavor of Unix (Linux), the "#!" would invoke Perl. Try getting batwrap or
>pl2bat, which adds a 'header' and turns the perl script into a batch file.
>You will have to slightly modify either one for Windows 95, because they
both
>add the "-S" switch, which doesn't seem to work under Win95. Hope that
>helps...
Not according to the Perl Run manual page:
"As of Perl 5, the #! line is always examined for switches as the line is
being parsed. Thus, if you're on a machine that only allows one argument
with the #! line, or worse, doesn't even recognize the #! line, you still
can get consistent switch behavior regardless of how Perl was invoked, even
if -x was used to find the beginning of the script."
I realize that #! is a Unix feature not present in Win32, but the following
#! switch does work in Win32:
#! perl -i.bak
...
So why does Perl for Win32 find the -i switch OK, but not the -s?
Gary
>In article <884307314.267321348@dejanews.com>, gcb@slip.net says...
>>
>>The -s in the following Perl script is ignored when run from Win95 as:
>>
>>C:\> perl script.pl -xyz
>>
>>script.pl
>>---------
>>#! perl -s
>>print "-xyz\n" if $xyz;
>>
>>Anyone know of a fix? Invoking as perl -x script.pl -xyz works but this
>>forces you to use the #! syntax.
>>
>>(the -i.bak switch does work as expected though - hmmm!)
>>
>>Thanks,
>>Gary
------------------------------
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 1605
**************************************