[10829] in Perl-Users-Digest
Perl-Users Digest, Issue: 4430 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 15 16:07:22 1998
Date: Tue, 15 Dec 98 13:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 15 Dec 1998 Volume: 8 Number: 4430
Today's topics:
'pipe' an 8-bit file <childers@acns.fsu.edu>
Re: C structure to perl <tchrist@mox.perl.com>
Re: Can standard Perl functions be overloaded ? (Ilya Zakharevich)
Re: Complicated sorting problem <uri@sysarch.com>
Re: Complicated sorting problem (Bruce Z. Lysik)
Re: Complicated sorting problem (Andrew M. Langmead)
Re: Complicated sorting problem (Bruce Z. Lysik)
Re: Complicated sorting problem (Bart Lateur)
Re: Complicated sorting problem <uri@sysarch.com>
Re: Complicated sorting problem <uri@sysarch.com>
Help needed - Dynamic loading configuration <greeng@nospam.young.epc.lmms.lmco.com>
Re: How can I compare files? <upsetter@ziplink.net>
Re: How to extract emails from HTML page <philip.class@popcorn-studio.ch>
Re: How to extract emails from HTML page <philip.class@popcorn-studio.ch>
Re: How to extract emails from HTML page <philip.class@popcorn-studio.ch>
Re: How to extract emails from HTML page <philip.class@popcorn-studio.ch>
hyperlinked tree script??? webboss@tcat.ac.uk
More stupid select questions hutchiss@my-dejanews.com
Need some speed tips on this script.. <cbeatson@mail.ci.lubbock.tx.us>
Re: perl + email + winnt = help? (Martin Vorlaender)
Re: perl - ipc_sysv - semaphore problems <jhi@alpha.hut.fi>
Re: Perl newbie question.. <uri@sysarch.com>
Re: Perl newbie question.. (Tad McClellan)
Re: Perl/Java cgi script with pws <rliu2@ford.com>
Re: uuencoded data in scripts failing to decode / unpac <jbattikha@highsynth.com>
Re: Works in debuger, not in interpreter <r28629@email.sps.mot.com>
Re: Works in debuger, not in interpreter <penniman@cats.ucsc.edu>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 15 Dec 1998 14:33:09 -0500
From: "Earl Childers" <childers@acns.fsu.edu>
Subject: 'pipe' an 8-bit file
Message-Id: <756e49$d6i$1@news.fsu.edu>
I asked around locally about the following:
Using PERL, how can I 'pipe' a binary (8-bit) file to standard out?
********
Here's the answer I got:
open(FILE, "location/of/file");
while($line = <FILE>) {
print $line;
}
The only thing you would change in that example is the location of the file
(leave in the " ").
**********
I'd like to know if that's how I'd do it with a plain text file and is it
also a good way to do it for a
binary (8-bit) file that may not have any end-of-line (CRLF) markers?
Thanks.
--Earl
------------------------------
Date: 15 Dec 1998 13:46:07 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: C structure to perl
Message-Id: <755p6v$g03$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Kozo <kozo@pobox.sk> writes:
:how to convert C structure to perl ?
:is any tool ? struct2perl ?
:
: struct whod {
: char wd_vers
: char wd_type
: char wd_fill[2]
: int wd_sendtime
: int wd_recvtime
: char wd_hostname[32]
: int wd_loadav[3]
: int wd_boottime
: struct whoent {
: struct outmp we_utmp
: int we_idle
: } wd_we[1024 / sizeof (struct whoent)]
: } ^M
Here's the old c2ph output. It's still in perl4-speak.
I never updated it to perl5 objects and classes.
% c2ph -swhod,whoent,outmp /usr/include/protocols/rwhod.h
sub outmp'out_line { 0; }
sub outmp'out_name { 1; }
sub outmp'out_time { 2; }
sub outmp'struct { 3; }
sub outmp'typedef {
local($outmp'index) = shift;
defined $outmp'index
? $outmp'typedef[$outmp'index]
: $outmp'typedef;
}
sub outmp'sizeof {
local($outmp'index) = shift;
defined $outmp'index
? $outmp'sizeof[$outmp'index]
: $outmp'sizeof;
}
sub outmp'offsetof {
local($outmp'index) = shift;
defined $outmpindex
? $outmp'offsetof[$outmp'index]
: $outmp'sizeof;
}
sub outmp'typeof {
local($outmp'index) = shift;
defined $outmpindex
? $outmp'typeof[$outmp'index]
: 'outmp';
}
sub outmp'fieldnames {
@outmp'fieldnames;
}
sub outmp'isastruct {
's';
}
$outmp'typedef = 'A8 A8 i';
$outmp'sizeof = 84;
@outmp'indices = (0..2);
@outmp'typedef[@outmp'indices] = (
'A8', # out_line
'A8', # out_name
'i', # out_time
);
@outmp'sizeof[@outmp'indices] = (
8, # out_line
8, # out_name
4, # out_time
);
@outmp'offsetof[@outmp'indices] = (
0, # out_line
8, # out_name
16, # out_time
);
@outmp'typeof[@outmp'indices] = (
'char', # out_line
'char', # out_name
'int', # out_time
);
@outmp'fieldnames[@outmp'indices] = (
'out_line',
'out_name',
'out_time',
);
sub whod'wd_vers { 0; }
sub whod'wd_type { 1; }
sub whod'wd_pad { 2; }
sub whod'wd_sendtime { 3; }
sub whod'wd_recvtime { 4; }
sub whod'wd_hostname { 5; }
sub whod'wd_loadav { 6; }
sub whod'wd_boottime { 9; }
sub whod'wd_we { 10; }
sub whod'struct { 178; }
sub whod'typedef {
local($whod'index) = shift;
defined $whod'index
? $whod'typedef[$whod'index]
: $whod'typedef;
}
sub whod'sizeof {
local($whod'index) = shift;
defined $whod'index
? $whod'sizeof[$whod'index]
: $whod'sizeof;
}
sub whod'offsetof {
local($whod'index) = shift;
defined $whodindex
? $whod'offsetof[$whod'index]
: $whod'sizeof;
}
sub whod'typeof {
local($whod'index) = shift;
defined $whodindex
? $whod'typeof[$whod'index]
: 'whod';
}
sub whod'fieldnames {
@whod'fieldnames;
}
sub whod'isastruct {
's';
}
$whod'typedef = 'c2 A2 i2 A32 i4 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2';
$whod'sizeof = 84;
@whod'indices = (0..6,9..10);
@whod'typedef[@whod'indices] = (
'c', # wd_vers
'c', # wd_type
'A2', # wd_pad
'i', # wd_sendtime
'i', # wd_recvtime
'A32', # wd_hostname
'i3', # wd_loadav
'i', # wd_boottime
'A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2 A8 A8 i2', # wd_we
);
@whod'sizeof[@whod'indices] = (
1, # wd_vers
1, # wd_type
2, # wd_pad
4, # wd_sendtime
4, # wd_recvtime
32, # wd_hostname
12, # wd_loadav
4, # wd_boottime
1008, # wd_we
);
@whod'offsetof[@whod'indices] = (
0, # wd_vers
1, # wd_type
2, # wd_pad
4, # wd_sendtime
8, # wd_recvtime
12, # wd_hostname
44, # wd_loadav
56, # wd_boottime
60, # wd_we
);
@whod'typeof[@whod'indices] = (
'char', # wd_vers
'char', # wd_type
'char', # wd_pad
'int', # wd_sendtime
'int', # wd_recvtime
'char', # wd_hostname
'int[3]', # wd_loadav
'int', # wd_boottime
'whoent[42]', # wd_we
);
@whod'fieldnames[@whod'indices] = (
'wd_vers',
'wd_type',
'wd_pad',
'wd_sendtime',
'wd_recvtime',
'wd_hostname',
'wd_loadav',
'wd_boottime',
'wd_we',
);
sub whoent'we_utmp { 0; }
sub whoent'we_idle { 3; }
sub whoent'struct { 4; }
sub whoent'typedef {
local($whoent'index) = shift;
defined $whoent'index
? $whoent'typedef[$whoent'index]
: $whoent'typedef;
}
sub whoent'sizeof {
local($whoent'index) = shift;
defined $whoent'index
? $whoent'sizeof[$whoent'index]
: $whoent'sizeof;
}
sub whoent'offsetof {
local($whoent'index) = shift;
defined $whoentindex
? $whoent'offsetof[$whoent'index]
: $whoent'sizeof;
}
sub whoent'typeof {
local($whoent'index) = shift;
defined $whoentindex
? $whoent'typeof[$whoent'index]
: 'whoent';
}
sub whoent'fieldnames {
@whoent'fieldnames;
}
sub whoent'isastruct {
's';
}
$whoent'typedef = 'A8 A8 i2';
$whoent'sizeof = 84;
@whoent'indices = (0,3);
@whoent'typedef[@whoent'indices] = (
'A8 A8 i', # we_utmp
'i', # we_idle
);
@whoent'sizeof[@whoent'indices] = (
20, # we_utmp
4, # we_idle
);
@whoent'offsetof[@whoent'indices] = (
0, # we_utmp
20, # we_idle
);
@whoent'typeof[@whoent'indices] = (
'outmp', # we_utmp
'int', # we_idle
);
@whoent'fieldnames[@whoent'indices] = (
'we_utmp',
'we_idle',
);
1;
--
"Lisp has all the visual appeal of oatmeal with fingernail clippings mixed in."
--Larry Wall in <1994Jul21.173737.16853@netlabs.com>
------------------------------
Date: 15 Dec 1998 20:59:46 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Can standard Perl functions be overloaded ?
Message-Id: <756ik2$pjn$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Sean McAfee
<mcafee@pacman.rs.itd.umich.edu>],
who wrote in article <3Gsd2.1530$4w2.6694116@news.itd.umich.edu>:
> > use subs 'open(*$)';
> > sub open (*$) { ... }
>
> It's nice that this works, but how the heck *does* it work?
>
> use subs 'open(*$)';
>
> should be essentially equivalent to
>
> BEGIN {
> my $import = 'open(*$)';
> *{"main::$import"} = \&{"main::$import"};
> }
This at least explains why there is no mismatched prototype error. ;-)
Ilya
P.S. >perl -wle "use subs 'a($)'; print prototype 'a'"
Use of uninitialized value at -e line 1.
P.P.S. I remember putting some black magic into Fatal.pm to implement
the things the way they should be.
------------------------------
Date: 15 Dec 1998 14:08:23 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Complicated sorting problem
Message-Id: <x7yao9p6jc.fsf@sysarch.com>
>>>>> "BZL" == Bruce Z Lysik <eldrik@localhost.localdomain> writes:
BZL> esub06,some text,some more text,misc text
BZL> gsun23,some text,some more text,misc text
BZL> gsun102,some text,some more text,misc text
BZL> gsun55,some text,some more text,misc text
BZL> esub04,some text,some more text,misc text
BZL> etc...
BZL> list, just alphabetical. (I actually used the unix
BZL> 'sort' command to simplify this.)
BZL> Unfortunately, now I have a picky person wanting them
BZL> grouped alphabetically and /then/ in nice ascending
BZL> numerical order. Does anyone have an idea on how to
why is this being asked in a perl group? you don't mention perl anywhere
in your post. sort can handle that fine. RTFM for more on sort fields
and subsorting. if it doesn't do what you want, then try some perl code
(look up schwartzian transform on dejanews) and post again if you need
more help.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 15 Dec 1998 14:35:31 -0500
From: eldrik@localhost.localdomain (Bruce Z. Lysik)
Subject: Re: Complicated sorting problem
Message-Id: <m3u2yx42rg.fsf@localhost.localdomain>
Uri Guttman <uri@sysarch.com> writes:
> why is this being asked in a perl group? you don't mention perl anywhere
> in your post. sort can handle that fine. RTFM for more on sort fields
> and subsorting. if it doesn't do what you want, then try some perl code
> (look up schwartzian transform on dejanews) and post again if you need
> more help.
>
> uri
I guess I wasn't being very clear. This is part of a larger perl program,
and the only reason I'm using unix 'sort' is that, frankly, it's the
simplest way to sort an array of references to arrays by an arbitrary field
(http://www.perl.com/CPAN-local/doc/FMTEYEWTK/sort.html, Tom Christiansen)
Unfortunately, 'sort' doesn't "handle that fine". gsun102 will come before
gsun45, and that's not what I want.
And I've read this documentation pretty thoroughly, thanks. (Getting what
I want out of it is another matter.)
Just because you seem to want to see some perl code, I'll paste in the
line which currently does the sort:
# I'm using the $sort variable because the I want to sort on an arbitrary
# field. I guess you can just ignore that part for this example.
my $tmpfile = "sorte";
open (TMP, ">$tmpfile") || die "can't open $tmpfile for writing: $!";
(print TMP @fileinfo) || die "can't write to $tmpfile: $!";
close(TMP) || die "can't write to $tmpfile: $!";
@fileinfo = `sort -t , -k $sort,$sort $tmpfile`;
if ($?) {
die "sort exited with a $?";
}
unlink($tmpfile) || die "can't unlink $tmpfile: $!";
Basically code snippet 8.2 from Mr. Christiansen's excellent bit of docs
concerning sorting.
If someone can point me in the right direction better than "RTFM", I'd
appreciate it, thanks. :)
--
Bruce Z. Lysik <eldrik@logrus.com>
------------------------------
Date: Tue, 15 Dec 1998 20:15:40 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Complicated sorting problem
Message-Id: <F40wA4.2Co@world.std.com>
eldrik@localhost.localdomain (Bruce Z. Lysik) writes:
>Basically I have an array of data looking like so:
>esub06,some text,some more text,misc text
There is some information in the FAQ about "How to sort an array by
(anything)" that covers most of what you need. You can separate the
parts that you want to sort into easily comparable values, and then
use how those items sort to get the original array in that order.
<URL:http://www.perl.com/CPAN/doc/manual/html/pod/
perlfaq4/How_do_I_sort_an_aray_by_anyth.html>
The only part the FAQ doesn't cover is how to separate your particular
sort fields. Unfortunately, you didn't clearly specify how you want
them sorted but by example I'll take a guess: The section before the
first comma contains characters followed by numbers. You want it
sorted first by characters, then numerically.
#!/usr/bin/perl -w
@array = split /\n/, <<LIST;
esub06,some text,some more text,misc text
gsun23,some text,some more text,misc text
gsun102,some text,some more text,misc text
gsun55,some text,some more text,misc text
esub04,some text,some more text,misc text
LIST
for (@array) {
($letters, $numbers) = /(\D+)(\d+)/;
push @letters, $letters;
push @numbers, $numbers;
}
@order = sort { $letters[$a] cmp $letters[$b] or
$numbers[$a] <=> $numbers[$b] } 0 .. $#array;
@sorted = @array[ @order ];
for $line (@sorted) {
print "$line\n";
}
A lot of time you see the spliting and sorting combined into this mess
of map functions and references called a "Schwartzian Transform",
named for (and developed by) a well known Perl obfusciator.
@sorted = map { $_->[0] }
sort { $a->[1] cmp $b->[1] or $a->[2] <=> $b->[2] }
map { [ $_, /(\D+)(\d+)/ ] } @array;
--
Andrew Langmead
------------------------------
Date: 15 Dec 1998 15:22:34 -0500
From: eldrik@localhost.localdomain (Bruce Z. Lysik)
Subject: Re: Complicated sorting problem
Message-Id: <m31zm1gnp1.fsf@localhost.localdomain>
aml@world.std.com (Andrew M. Langmead) writes:
> A lot of time you see the spliting and sorting combined into this mess
> of map functions and references called a "Schwartzian Transform",
> named for (and developed by) a well known Perl obfusciator.
>
> @sorted = map { $_->[0] }
> sort { $a->[1] cmp $b->[1] or $a->[2] <=> $b->[2] }
> map { [ $_, /(\D+)(\d+)/ ] } @array;
>
> --
> Andrew Langmead
Without quoting that whole solution, that's exactly what I was getting at.
Thanks! I'll try to be more clear next time. Glad there're some psychic
people around who can read my mind.
--
Bruce Z. Lysik <eldrik@logrus.>
------------------------------
Date: Tue, 15 Dec 1998 20:27:16 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Complicated sorting problem
Message-Id: <3677c3d7.1766442@news.skynet.be>
Bruce Z. Lysik wrote:
>I have a sorting problem that's annoying me.
>
>Basically I have an array of data looking like so:
>
>esub06,some text,some more text,misc text
>gsun23,some text,some more text,misc text
>gsun102,some text,some more text,misc text
>gsun55,some text,some more text,misc text
>esub04,some text,some more text,misc text
>etc...
>
>Unfortunately, now I have a picky person wanting them
>grouped alphabetically and /then/ in nice ascending
>numerical order. Does anyone have an idea on how to
>do this? I have no idea how to go about doing it.
Hmm... There's been a very similar question in this newsgroup last week,
where a person wanted to sort alphabetically on the first part
(letters), and numerically on the second (numbers). Look it up on
DejaNews if your server doesn't carry it any more.
Subject: Sorting problem: Is there a better way?
Date: 11 dec 1998
I think the post by Tad McClellan will be the most useful for you.
Basically, you need a sort subroutine or code block, where $a and $b are
each split into three parts. Compare the first parts of $a and $b
aplhabetically, the second parts numerically, and the rest
alphabetically.
But a "Schwartzian transform" may be faster than splitting on each and
every compare.
HTH,
Bart.
------------------------------
Date: 15 Dec 1998 15:48:30 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Complicated sorting problem
Message-Id: <x7vhjdp1wh.fsf@sysarch.com>
>>>>> "BZL" == Bruce Z Lysik <eldrik@localhost.localdomain> writes:
BZL> Without quoting that whole solution, that's exactly what I was
BZL> getting at. Thanks! I'll try to be more clear next time. Glad
BZL> there're some psychic people around who can read my mind.
i did mention searching for ST in dejanews. why didn't you do that? it
is mentioned many times in this group. just searching for sort would
have found many useful hits.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 15 Dec 1998 15:58:05 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Complicated sorting problem
Message-Id: <x7soehp1gi.fsf@sysarch.com>
>>>>> "BZL" == Bruce Z Lysik <eldrik@localhost.localdomain> writes:
BZL> Unfortunately, 'sort' doesn't "handle that fine". gsun102 will
BZL> come before gsun45, and that's not what I want.
yes it does. see below.
BZL> And I've read this documentation pretty thoroughly, thanks.
BZL> (Getting what I want out of it is another matter.)
sort -t , -k 1,1.4 -k 1.5,1n sort.dat
works fine on the data you have. i get this output:
esub04,some text,some more text,misc text
esub06,some text,some more text,misc text
gsun23,some text,some more text,misc text
gsun55,some text,some more text,misc text
gsun102,some text,some more text,misc text
alphabetic and then numeric.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Tue, 15 Dec 1998 10:44:14 -0800
From: Gary Greenberg <greeng@nospam.young.epc.lmms.lmco.com>
Subject: Help needed - Dynamic loading configuration
Message-Id: <3676ADFE.7085D0FE@nospam.young.epc.lmms.lmco.com>
I am trying to install Perl5.005_02 on sun-solaris2.6 platform.
I have answered 'yes' on the question "Do you wish to use dynamic
loading?" while running config.
It presented me the list of available .xs files for various platforms
but sun-solaris wasn't among them.
I have selected ext/DynaLoader/dl_none.xs out of the list and config and
make finished successfully,
but 'make test' failed miserably on dynamic loading.
My question is : what did I do wrong? Where to find '.xs' file for
sun-solaris? If it does not exist, what should I choose?
Please respond via e-mail.
Remove nospam from e-mail address while replying.
Prompt answer will be greatly appreciated.
Thanks.
------------------------------
Date: Tue, 15 Dec 1998 19:22:53 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: How can I compare files?
Message-Id: <hGyd2.716$J4.145112@news.shore.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
: [courtesy cc of this posting sent to cited author via email]
^^^^^^^^
LOL!
: If you were on a real system, you'd just call the cmp program,
: possibly only after checking that the respective st_size fields differ.
: Since you're not, you get to have much more fun.
[snip]
If you don't want to answer his question, is it really necessary to insult
him for the operating system he happens to work on?
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Tue, 15 Dec 1998 21:39:52 +0100
From: Philip Class <philip.class@popcorn-studio.ch>
To: newsposter@cthulhu.demon.nl
Subject: Re: How to extract emails from HTML page
Message-Id: <3676C918.3E42008F@popcorn-studio.ch>
Dear Friends ;-)
To be honest - The main purpose for collecting emails is a commercial one.
Contancting potential customers in a discrete way (inculding our own personal
address data as sender and offering a 'REMOVE ME' feature) is not what I call
usual cheap spam. That's my opinion, ...and that's why I didn't hesitate
posting a usenet message with my real emailaddress appending.
But I realize it's a personal issue where to draw the line between spam and (a
small percentage of) useful mail.
Matt, .....I think you're right ; Instead I should have asked:
SUBJECT: 'Address-Book as X-mas-gift for Grandma: How to collect her
relative's email addresses lost in the WWW .. ?!!
ok... sorry .....
Greetings,
Philip Class
Erik van Roode wrote:
> Matt Schuette wrote:
> >
> > How do you know he's spamming? Maybe he happens to have a lot of
> > friends whose email addresses happen to be randomly spread across the
> ^^^^^^^ Yeah, very often spam starts with 'Dear friend'
>
> > web in various HTML documents. And maybe his email program is not
> > capable of creating an address book, so he needs to create a list of all
> > of them. Then again, he may just be trying to spam them all....
>
> Erik
------------------------------
Date: Tue, 15 Dec 1998 21:40:09 +0100
From: Philip Class <philip.class@popcorn-studio.ch>
To: newsposter@cthulhu.demon.nl
Subject: Re: How to extract emails from HTML page
Message-Id: <3676C929.5EB677F9@popcorn-studio.ch>
Dear Friends ;-)
To be honest - The main purpose for collecting emails is a commercial one.
Contancting potential customers in a discrete way (inculding our own personal
address data as sender and offering a 'REMOVE ME' feature) is not what I call
usual cheap spam. That's my opinion, ...and that's why I didn't hesitate
posting a usenet message with my real emailaddress appending.
But I realize it's a personal issue where to draw the line between spam and (a
small percentage of) useful mail.
Matt, .....I think you're right ; Instead I should have asked:
SUBJECT: 'Address-Book as X-mas-gift for Grandma: How to collect her
relative's email addresses lost in the WWW .. ?!!
ok... sorry .....
Greetings,
Philip Class
Erik van Roode wrote:
> Matt Schuette wrote:
> >
> > How do you know he's spamming? Maybe he happens to have a lot of
> > friends whose email addresses happen to be randomly spread across the
> ^^^^^^^ Yeah, very often spam starts with 'Dear friend'
>
> > web in various HTML documents. And maybe his email program is not
> > capable of creating an address book, so he needs to create a list of all
> > of them. Then again, he may just be trying to spam them all....
>
> Erik
------------------------------
Date: Tue, 15 Dec 1998 21:41:10 +0100
From: Philip Class <philip.class@popcorn-studio.ch>
To: newsposter@cthulhu.demon.nl
Subject: Re: How to extract emails from HTML page
Message-Id: <3676C966.2C3BCCA4@popcorn-studio.ch>
Dear Friends ;-)
To be honest - The main purpose for collecting emails is a commercial one.
Contancting potential customers in a discrete way (inculding our own personal
address data as sender and offering a 'REMOVE ME' feature) is not what I call
usual cheap spam. That's my opinion, ...and that's why I didn't hesitate
posting a usenet message with my real emailaddress appending.
But I realize it's a personal issue where to draw the line between spam and (a
small percentage of) useful mail.
Matt, .....I think you're right ; Instead I should have asked:
SUBJECT: 'Address-Book as X-mas-gift for Grandma: How to collect her
relative's email addresses lost in the WWW .. ?!!
ok... sorry .....
Greetings,
Philip Class
Erik van Roode wrote:
> Matt Schuette wrote:
> >
> > How do you know he's spamming? Maybe he happens to have a lot of
> > friends whose email addresses happen to be randomly spread across the
> ^^^^^^^ Yeah, very often spam starts with 'Dear friend'
>
> > web in various HTML documents. And maybe his email program is not
> > capable of creating an address book, so he needs to create a list of all
> > of them. Then again, he may just be trying to spam them all....
>
> Erik
------------------------------
Date: Tue, 15 Dec 1998 21:41:33 +0100
From: Philip Class <philip.class@popcorn-studio.ch>
To: newsposter@cthulhu.demon.nl
Subject: Re: How to extract emails from HTML page
Message-Id: <3676C97D.49EFDC78@popcorn-studio.ch>
Dear Friends ;-)
To be honest - The main purpose for collecting emails is a commercial one.
Contancting potential customers in a discrete way (inculding our own personal
address data as sender and offering a 'REMOVE ME' feature) is not what I call
usual cheap spam. That's my opinion, ...and that's why I didn't hesitate
posting a usenet message with my real emailaddress appending.
But I realize it's a personal issue where to draw the line between spam and (a
small percentage of) useful mail.
Matt, .....I think you're right ; Instead I should have asked:
SUBJECT: 'Address-Book as X-mas-gift for Grandma: How to collect her
relative's email addresses lost in the WWW .. ?!!
ok... sorry .....
Greetings,
Philip Class
Erik van Roode wrote:
> Matt Schuette wrote:
> >
> > How do you know he's spamming? Maybe he happens to have a lot of
> > friends whose email addresses happen to be randomly spread across the
> ^^^^^^^ Yeah, very often spam starts with 'Dear friend'
>
> > web in various HTML documents. And maybe his email program is not
> > capable of creating an address book, so he needs to create a list of all
> > of them. Then again, he may just be trying to spam them all....
>
> Erik
------------------------------
Date: Tue, 15 Dec 1998 20:32:08 GMT
From: webboss@tcat.ac.uk
Subject: hyperlinked tree script???
Message-Id: <3676c747.15897187@news1.usenetserver.com>
Hi...
A while ago I came accross a useful script that produced a nice HTML
formated page showing a directory tree representation of all dirs
below a point passed to it on the command line.The filenames were
embedded as clickable fully pathed hyperlinked hrefs.
Yep - you guessed it, now Ive a use for it I cant find the damn thing!
Ive just spent a couple of hours trying to re-invent the wheel, but my
results are errrr.... suspect, to say the least!
Did you write this script??? No, then can anyone point me in the
direction of the script, or suggest some suitable starting point...???
Cheers...
--
Chris Williams - Internet Admin - TCAT
webboss@tcat.ac.uk
------------------------------
Date: Tue, 15 Dec 1998 20:00:44 GMT
From: hutchiss@my-dejanews.com
Subject: More stupid select questions
Message-Id: <756f5b$pmh$1@nnrp1.dejanews.com>
I'm yet another person trying to use IO::Select for something not
quite what it may have been intended for.
I have a number of filehandles. One of these is a socket to a server
program, the others are either opened files or an opened serial port.
Attempts to read and write the socket work, using the 'cheat' that the
sockets are in autoflush mode.
Attempts to read and write the commport work, as well.
My goal is to provide a communication between the socket and the comm
port such that input from the comm port goes out the socket, and input
from the socket goes out the comm port.
So far so good, but I used IO::Select to create a list of filehandles
on which I want to be able to test for input. I don't care if the select
call blocks waiting as long as it eventually reports a readable state on
the first opportunity to read from one or the other.
Unfortunately, the filehandle for the serial port seems to screw up this
rosy scenario. If I only add the socket, it works correctly and as expected.
If I add the serial port filehandle, whether or not the socket is in the
list of testable handles, the select hangs.
The code is the standard looking stuff:
$comm = new IO::File;
open($comm, "+>COM1") or die "Cannot open serial port COM1\n";
$sock = IO::Socket::INET->new( PeerAddr = "localhost:5000");
die "Cannot open socket localhost:5000\n") unless $sock;
$readable = IO::Select->new;
$readable->add($sock);
$readable->add($comm);
while (1) {
($ready) = IO::Select($readable,undef,undef,undef); #HANGS HERE
foreach $s (@$ready) { # process the stuff on $s }
}
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 15 Dec 1998 14:14:08 -0600
From: "Chris Beatson" <cbeatson@mail.ci.lubbock.tx.us>
Subject: Need some speed tips on this script..
Message-Id: <756g7i$gei$1@spider.ci.lubbock.tx.us>
This script works fine, but it runs a bit slow. Any advice to speed it up
would be appreciated. Please explain any suggestions.
Thx
Chris Beatson
## script to pull unique IP's from a log file
print "what's the log file name?\n";
chomp($logfile=<stdin>);
$count=0;
$ips[0]="0"; ## array to store ip's in
open (file, "<$logfile") || die "can't open the logfile: $logfile\n";
OUTER: while (<file>) {
chomp;
if ($_=~ /(^\d+?\.\d+?\.\d+?\.\d+?)\,.*$/) {
foreach $i (@ips)
{
if ($1 eq $i)
{
next OUTER;
}
}
$ips[$count]="$1";
$count++;
}
}
open (results, ">ips");
foreach $i (sort(@ips))
{
$ipcount++;
print results "$i\n";
}
close (results);
close (file);
print "there were $ipcount different ips\n";
------------------------------
Date: Tue, 15 Dec 1998 21:01:47 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: perl + email + winnt = help?
Message-Id: <3676c02b.524144494f47414741@radiogaga.harz.de>
Adam Stoller (ghoti@telerama.lm.com) wrote:
: So, I'm looking for a way to use perl - if possible, to connect to the
: Outlook objects in much the same way as VB
Never seen a module that does this. MAPI seems to be heavily under-
documented on u$oft's side...
: - though I'm open to other
: suggestions as long as they don't involve having to bring in additional
: software packages (I'll listen to those ideas, but they're less likely to
: fly in my place of business).
Like Net::SMTP (part of the libnet package)?
: Failing that - I'm willing to go through telnet'ing to the SMTP port on the
: server - if someone could (a) point me to modules, routines, or bare code to
: do the telnet'ing, and (b) remind me how to hold up my end of the
: conversation once I connect to the SMTP port :-)
This is easily done using Net::SMTP :
#!/usr/local/bin/perl -w
use Net::SMTP;
$smtp = Net::SMTP->new('mailhost');
$smtp->mail($ENV{USER});
$smtp->to('postmaster');
$smtp->data();
$smtp->datasend("To: postmaster\n");
$smtp->datasend("\n");
$smtp->datasend("A simple test message\n");
$smtp->dataend();
$smtp->quit;
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
VMS is today what | work: mv@pdv-systeme.de
Microsoft wants | http://www.pdv-systeme.de/users/martinv/
Windows NT 8.0 to be! | home: martin@radiogaga.harz.de
------------------------------
Date: 15 Dec 1998 21:46:34 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: perl - ipc_sysv - semaphore problems
Message-Id: <oeeg1ahp4rp.fsf@alpha.hut.fi>
I have no problems in IRIX 6.5 with Perl 5.005_02, built with IRIX cc.
Maybe it's something in your SysV IPC setup?
...
All tests successful.
u=0.39 s=0.69 cu=15.02 cs=8.9 scripts=183 tests=6506
18.188u 13.369s 1:24.51 37.3% 0+0k 98+56io 4pf+0w
tcsh cedar:/tmp/jhi/perl5.005_02 ; uname -a
IRIX64 cedar 6.5 07271714 IP27
tcsh cedar:/tmp/jhi/perl5.005_02 ; cc -version
MIPSpro Compilers: Version 7.2.1.2m
tcsh cedar:/tmp/jhi/perl5.005_02 ;
--
$jhi++; # http://www.iki.fi/~jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
------------------------------
Date: 15 Dec 1998 14:04:55 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl newbie question..
Message-Id: <x71zm1ql9k.fsf@sysarch.com>
>>>>> "GW" == Garth Webb <gwebbQ@Qreedtech.com> writes:
GW> $phrase = "This is really cool";
GW> $phrase =~ s/really cool//g;
sorry but you don't win a prize this time. care to spend another dollar
and try your luck again?
he wants to delete the entire line if it has a given phrase. your code
only deletes the string from the phrase.
first off, what did he mean by a line? i feel he may mean a sentence and
if so, he is asking for lotsa trouble! secondly, if he just wants to
delete a true line then good ol' grep -v would be enough (unless he is a
POB).
in perl you could do it with this 1 liner:
perl -ne 'print unless /really cool/' files....
or you can do it inline with the -i option but i will leave that as an
exercise to the newbie.
GW> bryanb@walls-media.com wrote:
>> Is there a way to delete an entire line in a text file if perl finds a
>> specific string?
>>
>> Say I have a phrase "This is really cool" and anytime I find the phrase
>> "really cool" I want that line deleted from the file.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Tue, 15 Dec 1998 13:09:58 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl newbie question..
Message-Id: <66c657.7tc.ln@magna.metronet.com>
bryanb@walls-media.com wrote:
: Is there a way to delete an entire line in a text file if perl finds a
: specific string?
Perl FAQ, part 5:
"How do I change one line in a file/
delete a line in a file/
insert a line in the middle of a file/
append to the beginning of a file?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 15 Dec 1998 14:34:59 -0500
From: Roger Liu <rliu2@ford.com>
To: Paul Chapin <pdchapin@unix.amherst.edu>
Subject: Re: Perl/Java cgi script with pws
Message-Id: <3676B9DE.A2D1A633@ford.com>
>
> I've been wondering if it's having problem with the CLASSPATH variable
>
I did not set CLASSPATH at all. (Actually, I disabled the old class path in my
autoexec.bat).
>
> BTW, is having the server throw up a DOS window when trying to execute the
> script an expected behavior? Seems pretty kludgy to me.
Yes. Once finished, the dos window went away.
Roger
------------------------------
Date: Tue, 15 Dec 1998 15:42:46 -0500
From: Jihad Battikha <jbattikha@highsynth.com>
Subject: Re: uuencoded data in scripts failing to decode / unpack ?
Message-Id: <3676C9C6.4AB461B6@highsynth.com>
Uri Guttman wrote:
> hi jihad,
Hi, Uri!
> never seen you post here!
A couple times... mostly I lurk :o)
> no need for the (), @gifuue provides a list context.
Just a style thing. Shouldn't affect the result, right? Regardless, I
followed your suggestion.
> just assign it using a here doc
Tried that before - same result.
> $/ = undef ;
> $gifuue = <DATA>
Didn't try that. Just tried it, same results... :-(
> it helps if you use the correct variable names!
Doh! That was a typo in my post, my actual script was referencing the
right variables...
Anyway, with all the suggestions you made, it's still not working. From
what I can tell, I'm pretty much doing everything "by the book". There
are no implicit "errors" occuring, I'm just not getting the expected
result. Perhaps my expectations are wrong? The UUE data is decoding
fine when decoded as a file. Perhaps the question really is:
If one wanted to embed binary data inside a Perl script for later
retrieval (say, in the same context my scripts are in) what's the best
way to do it that actually works? External data files are not an option
- everything must be in the script (or "required" files). And before
someone takes the time to suggest it, the GD module is out of the
question becuase I'd have to generate intricate gifs from scratch which
is impractical. I could use it for post-processing the gif data once I
have it but the gist of my needs is to embed everything in one script.
~jihad
--
<>>>===========================================================<<<>
Jihad Battikha <jbattikha@highsynth.com> http://www.highsynth.com
-=< graphics . 2d/3d animation . illustration . web authoring >=-
<>>>===========================================================<<<>
Before sending me commercial e-mail, the sender must first agree
to my LEGAL NOTICE located at: http://www.highsynth.com/sig.html.
<>>>===========================================================<<<>
------------------------------
Date: Tue, 15 Dec 1998 13:01:34 -0600
From: Tk Soh <r28629@email.sps.mot.com>
To: mjpenniman@aol.com
Subject: Re: Works in debuger, not in interpreter
Message-Id: <3676B20E.2AE66B46@email.sps.mot.com>
[posted to clp.misc]
Mark Penniman wrote:
>
> My personal perl knowledge basis is about 1 month old. My programming
> knowledge basis is about 20 years. The perl code I have written works
> fine in the perl debugger if I just issue the "c" (continue) debug
> command, the code works as expected (only slower than desired). If I run
> the same code in the interpreter,
> it chokes. Any help would be much appreciated. The source is attached.
>
I, for one, didn't have the patience to go thru 100+ lines of codes and
dont know what to look for. It would be easier for others if you posted
what problem you were experiening and pointed (or just post) out the
offending part of the code.
-TK
------------------------------
Date: Tue, 15 Dec 1998 12:45:48 -0800
From: Mark Penniman <penniman@cats.ucsc.edu>
Subject: Re: Works in debuger, not in interpreter
Message-Id: <3676CA7B.472F2F1C@cats.ucsc.edu>
first its debugger not debuger (like debooger). Note the offending code is
marked in the source attached to the original posting. I am sorry for those I
have offended by posting the whole program. I felt context might be important.
But it seems that my time in other languages, not in perl still makes me a
"newbie". Please be forgiving as I venture into your culture for the first
time.
Mark Penniman wrote:
> My personal perl knowledge basis is about 1 month old. My programming
> knowledge basis is about 20 years. The perl code I have written works
> fine in the perl debugger if I just issue the "c" (continue) debug
> command, the code works as expected (only slower than desired). If I run
> the same code in the interpreter,
> it chokes. Any help would be much appreciated. The source is attached.
>
> ------------------------------------------------------------------------
> Name: match1.pl
> match1.pl Type: Perl Program (application/x-perl)
> Encoding: 7bit
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4430
**************************************