[8617] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2234 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 2 14:07:36 1998

Date: Thu, 2 Apr 98 11:00:44 -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           Thu, 2 Apr 1998     Volume: 8 Number: 2234

Today's topics:
    Re: Anon Scalar Expression (was: Evaluate expression in (Bart Lateur)
        eval with text files <soccerweb@iotp.demon.co.uk>
    Re: File locking (Andrew M. Langmead)
    Re: foreach loop & current element index (Ken Fox)
    Re: How can I replace from a list? <rootbeer@teleport.com>
    Re: how to count a list of comma sep. items (Greg Bacon)
    Re: how to count a list of comma sep. items <egwong@netcom.com>
    Re: how to count a list of comma sep. items (Greg Bacon)
    Re: how to count a list of comma sep. items spamfree@yahoo.com
    Re: how to count a list of comma sep. items (Abigail)
        How to tell if a script was executed directly (Andrew Brown)
        How to upload multiple graphic files at once ? krzysztofj@usa.net
    Re: Is there a "Newsgroup" for Newbies to Perl? (Chris Russo)
    Re: Is there a "Newsgroup" for Newbies to Perl? smitty77@pacbell.net
    Re: Is there a "Newsgroup" for Newbies to Perl? smitty77@pacbell.net
        Multidimensional hashes webmaster@dataplusnet.com
    Re: Number of Perl Users/Instalitations. <rootbeer@teleport.com>
        Perl applications <jayantg@bellatlantic.net>
    Re: Position in Toronto & Question <egwong@netcom.com>
        printing in windows <fergal@clubi.ie>
        redirecting with frames (Dico Reyers)
    Re: Someone put my munged e-mail address on a spam list (John Stanley)
    Re: Someone put my munged e-mail address on a spam list (John Stanley)
    Re: Someone put my munged e-mail address on a spam list (John Stanley)
    Re: Someone put my munged e-mail address on a spam list (Bart Lateur)
        unpack vs. substr (was Re: Data Structure for Input Fil <Clinton.Bodine@mci.com>
    Re: unpack vs. substr (was Re: Data Structure for Input (Jason Gloudon)
    Re: verifying email address -- how? (John Stanley)
    Re: What to do about "regexp *+ operand could be empty" (Jonathan Stowe)
    Re: WindowsNT remote access (Jeffrey R. Drumm)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 02 Apr 1998 17:12:36 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Anon Scalar Expression (was: Evaluate expression inside print "")
Message-Id: <3526c45e.5508208@news.tornado.be>

David A. Black wrote:

>Hmmmm....  somewhere in all this, though not very lucidly, I think I'm
>beginning to understand why it makes sense for \($x,$y,$z) to evaluate
>to a list of refs....

I've tried this:

	$b = \(10,20,30);

and printing $b show it's a ref to a SCALAR. I check the value, and it's
30.

Same result when I repalce the numbers with variables.

What do you mean, \($x,$y,$z) evaluates to a list of refs? Or do you
mean that that is what you think it ought to do?

	Bart.


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

Date: Thu, 2 Apr 1998 18:09:28 +0100
From: Soccerweb <soccerweb@iotp.demon.co.uk>
Subject: eval with text files
Message-Id: <wb7opEAIZ8I1EwKx@iotp.demon.co.uk>

Hello, I'm writing a Perl CGI script that enables the webmaster to
automatically send various e-mails for administration purposes. All the
e-mail content are stored as text files, however the e-mail content
states thing like "as researcher for $country" or "Hello $name,". I want
to be able to convert the variables in the text file and then attach the
headers etc. to the e-mail and post. But, I can't manage to change
$country to Spain when $country eq "Spain". So the posted e-mail's still
state "as researcher for $country", I've tried eval but it doesn't work,
any suggestions?

Thanx.
-- 
SoccerWeb - the soccer squad information providers

e-mail: soccerweb@iotp.demon.co.uk              http://www.soccerweb.co.uk




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

Date: Thu, 2 Apr 1998 18:30:25 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: File locking
Message-Id: <Eqsu2p.Lpn@world.std.com>

rob@frii.com (Rob Greenbank) writes:

>I suspect what happened was the unlock hadn't flushed the output
>buffer, so the waiting process grabbed the old one.  Does anyone know
>if using unbuffered I/O would have fixed the problem?  I've written
>programs in other languages where a shared file was kept open and
>periodically locked/updated/unlocked.  

Either using unbuffered I/O (syswrite()), turning on autoflushing and
using the buffered I/O routines, performing a flush before unlocking,
or depending on the implicit flush of perl5.004 would all work.

With the unbuffered I/O, you may have to deal with issues that are
otherwise handled for you by stdio (partial writes, etc.)

Autoflushing removes the problems with unbuffered I/O, but adds the
inefficiencies of both buffered I/O (the exessive copying) and
unbuffered I/O (the writing of suboptimial block sizes)

Depending on the implicit flushing of recent perl's may be a problem
if your script ever gets run on an older version.

I've also claimed before that depending on the implicit flushing is
bad because if the close() fails you still have the lock, but I do
admit that for most data, if close() fails you have worse problems.


-- 
Andrew Langmead


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

Date: 2 Apr 1998 17:41:37 GMT
From: kfox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: foreach loop & current element index
Message-Id: <6g0ikh$d2a3@eccws1.dearborn.ford.com>

Alexandra Stehman <afs101@psu.edu> writes:
> The question was:  "When in a foreach loop, is there a special variable
> or perl function that can be used to determine the index of the current
> array element?"

If you don't care about performance, you can take advantage of loop
variable equivalance to find where the element is in an array.  Here's
a bit of code that does it:

sub index_of_element ($\@) {
    my $i = 0;
    foreach (@{$_[1]}) {
        return $i if (\$_[0] eq \$_);
        ++$i;
    }
}

my @ary = qw(a b c d e);

foreach my $elt (@ary) {
    print "$elt is at index ", index_of_element($elt, @ary), "\n";
}

Both of these work too:

  log(unpack("L", pack('B*', substr('0'x32 .
        join('', reverse map { \$elt eq \$_ || 0 } @ary), -32))))/log(2)

  do { $_  = join('', map { \$elt eq \$_ || 0 } @ary); /1/g; pos() - 1 }

The first one doesn't work on arrays of more than 32 elements though.
Oh, and they both fail if the element isn't in the array. ;)

- Ken

-- 
Ken Fox (kfox@ford.com)                  | My opinions or statements do
                                         | not represent those of, nor are
Ford Motor Company, Powertrain           | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section             | "Is this some sort of trick
                                         |  question or what?" -- Calvin


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

Date: Thu, 2 Apr 1998 08:54:17 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: delegz <delegz@NOSPAM.rpi.edu>
Subject: Re: How can I replace from a list?
Message-Id: <Pine.GSO.3.96.980402085108.6466H-100000@user2.teleport.com>

On 1 Apr 1998, delegz wrote:

> 	open SEARCH, "Text Document #1";
> 	open REPLACE, "Text Document #2";
> 	open OUT, ">#2 Modified";

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.

> 	while (<SEARCH>) {
>   		s/^X$/<REPLACE>/e and chop;

Coulda use this:

		s/^X\n$/<REPLACE>/e;

> The problem is, #2 Modified was created, but it looks 
> _exactly_ like Text Document #1. I replaced "X" with 
> 
> From: G Rideout <rideout@\panix.com>

I think you want the backslash before the @ sign. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 2 Apr 1998 16:50:47 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: how to count a list of comma sep. items
Message-Id: <6g0fl7$l7u$4@info.uah.edu>

In article <6g0a87$plr@hacgate2.hac.com>,
	"Tony Reeves" <areeves1@csc.com> writes:
: I have a list of items that looks like this:
: 
: item, item1, item2, item3, item4
: 
: I know I can use split to put them into separate variables, but how do I
: know how may I got?  is there a easy way to count the number of items then
: store them in a assoc array?

Oi!  Why are you putting them in a hash?  That's beside the point,
however.  An array in scalar context yields the number of elements
in the array.  A list in scalar context yields the number of elements
in the list, so....

    $_ = 'item, item1, item2, item3, item4';
    my @item = split /\s*,\s*/;
    my $count = @item;

    print "I have ", $count, "item", ($count == 1 ? "" : "s"), "\n";

If you want to count the number of items in a hash, use one of

    $count = scalar keys %hash;
    $count = scalar values %hash;

since both keys and values return lists of a hash's keys and a hash's
values, respectively.  I do know that there is an optimization for
keys in a scalar context to simply perform the count instead of
actually returning a list (but I don't know about values).
C<scalar keys HASH> seems to be the idiom anyway, so it'd probably be
better to just use that.

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: Thu, 2 Apr 1998 17:01:01 GMT
From: Eric Wong <egwong@netcom.com>
Subject: Re: how to count a list of comma sep. items
Message-Id: <egwongEqspxp.H6n@netcom.com>

Tony Reeves <areeves1@csc.com> wrote:
: I have a list of items that looks like this:

: item, item1, item2, item3, item4

: The list can be from one to 10.

: I know I can use split to put them into separate variables, but how do I
: know how may I got?  is there a easy way to count the number of items then
: store them in a assoc array?
[ cut ]

I'm not quite sure what you're asking for, but it sounds like it
might be something like:

  $a = "1, 2, 3, 4, 5, 6";              # input list
  @b = split(", ", $a);                 # split $a into array @b
  for ($i=0; $i <= $#b; $i++) {         # loop for every element in @b
    $hash{$i} = $b[$i];                 # fill %hash
  }
 
The "$#b" gives you the number of items in array @b (actually, it's
the last index of @b, so the real number of items in array @b would
be "$#b + 1 - $[".  But since "$[" is usually zero . . ..)   See
the perldata manpage.

[ cc'd ]


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

Date: 2 Apr 1998 17:51:55 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: how to count a list of comma sep. items
Message-Id: <6g0j7r$l7u$6@info.uah.edu>

Sorry to followup to my own article, but...

In article <6g0fl7$l7u$4@info.uah.edu>,
	gbacon@cs.uah.edu (Greg Bacon) writes:
: A list in scalar context yields the number of elements
: in the list, so....

Yes, I realize the absence of the GENERAL RULE, but I meant list as
in

    print "I have ", scalar (1, 2, 3), " things.\n";

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: Thu, 02 Apr 1998 12:09:57 -0600
From: spamfree@yahoo.com
To: areeves1@csc.com
Subject: Re: how to count a list of comma sep. items
Message-Id: <6g0k76$7tp$1@nnrp1.dejanews.com>

In article <6g0a87$plr@hacgate2.hac.com>,
  "Tony Reeves" <areeves1@csc.com> wrote:
>
> I have a list of items that looks like this:
>
> item, item1, item2, item3, item4
>
> The list can be from one to 10.
>
> I know I can use split to put them into separate variables, but how do I
> know how may I got?  is there a easy way to count the number of items then

If you just want to count them, and you can trust that they are
comma-separated, do this:

$count = 1 + tr /,//;

Error checking is left as an exercise for the reader.

Dave


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 2 Apr 1998 18:38:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: how to count a list of comma sep. items
Message-Id: <6g0lue$3jg$1@client3.news.psi.net>

Eric Wong (egwong@netcom.com) wrote on MDCLXXV September MCMXCIII in
<URL: news:egwongEqspxp.H6n@netcom.com>:
++ Tony Reeves <areeves1@csc.com> wrote:
++ : I have a list of items that looks like this:
++ 
++ : item, item1, item2, item3, item4
++ 
++ : The list can be from one to 10.
++ 
++ : I know I can use split to put them into separate variables, but how do I
++ : know how may I got?  is there a easy way to count the number of items then
++ : store them in a assoc array?
++ [ cut ]
++ 
++ I'm not quite sure what you're asking for, but it sounds like it
++ might be something like:

If you just want to count them:

$count = 1 + $str =~ y/,//;



Abigail
-- 
perl  -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9;
          ${qq$\x5F$} = q 97265646f9; s/../qq e\x63\x68\x72\x20\x30\x78$&e/gee;
          {eval if $a =~ s/../qq qprint chr 0x$& and \x71\x20\x71\x71q/excess}'


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

Date: 2 Apr 1998 17:42:49 GMT
From: atbrown@halcyon.com (Andrew Brown)
Subject: How to tell if a script was executed directly
Message-Id: <6g0imp$elo$1@brokaw.wa.com>

I have a Perl script which is intended to either be executed directly
(perl myscript.pl), or invoked indirectly from another Perl script, via a
"do" statement (do "myscript.pl";).

My question is this:  is there any way for "myscript.pl" to detect whether
it has been executed directly or via a "do"?  I could check $0 and compare
it to the name of the script, but I don't wish to hardcode the script
name...

Thanks,
Andrew

// ----------------------------------------------------------------------
// andrew todd brown           "obfuscated e-mail addresses hurt usenet!"
// mailto:andrewbrown@acm.org
// ----------------------------------------------------------------------



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

Date: Thu, 02 Apr 1998 11:48:02 -0600
From: krzysztofj@usa.net
Subject: How to upload multiple graphic files at once ?
Message-Id: <6g0ire$6ci$1@nnrp1.dejanews.com>

Does anybody know how to upload many graphic files at the push of a button?
100 pictures or so? Can I do it in Perl?

Chris

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Thu, 02 Apr 1998 09:00:52 -0800
From: news@russo.org (Chris Russo)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <news-0204980900530001@buzz.alink.net>

In article <6fu9op$43l@co-op.newsguy.com>, smitty77 wrote:

>I've hardly 'broadsided' you, Randal.  I simply pointed out an observation.  I
>will explain myself, but isn't it ironic that you get so defensive right off
>the bat - somewhat like an inexperienced perl programmer who has been flamed
>in this newsgroup by someone who 'broadsides' them.

You're a very small man, basking in the limelight of your attempt to "take
down" a celebrity.

I hope others recognize this and ignore you accordingly.

Regards,

Chris Russo

-- 
Chris Russo                          A-Link Network Services, Inc.
news@russo.org                       Bolo me
http://www.alink.net/~crusso


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

Date: 2 Apr 1998 08:28:34 -0800
From: smitty77@pacbell.net
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6g0ebi$1up@co-op.newsguy.com>

In article <lud8f04c1e.fsf@asfast.com>, Lloyd says...
>
>Tom Phoenix <rootbeer@teleport.com> writes:
>
>> On Tue, 31 Mar 1998, Howard Davies wrote:
>> > Has anyone thought of setting up a "comp.lang.perl.help" newsgroup?
>> 
>> If this newsgroup doesn't work for you, why would one with that name
>> succeed? :-)
>
>If in this hypothetical ".help" or ".novices" newsgroup, an arrogant
>twit discourteously and condescendingly dismissed a question posed by
>a novice without suggesting anything more useful than to read the FAQ
>(if even that), the novice might feel a lot more justified in telling
>the arrogant twit something like this:
>
>  This is a newsgroup where people who are not well versed in
>  Perl can come to share information and to receive useful and
>  meaningful help.  Therefore we are not impressed by your clever,
>  but low-in-actual-information pronouncements.  Learn some courtesy
>  or else shut up and go back to comp.lang.perl.misc.

*L* Classic.  Once again, well done, Lloyd.

Dave

>I believe that this is one reason why many people believe that such a
>".help" or ".novices" newsgroup would be a distinct benefit.  :)
>
>-- 
> Lloyd Zusman
> ljz@asfast.com


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

Date: 2 Apr 1998 08:37:16 -0800
From: smitty77@pacbell.net
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6g0ers$3b9@co-op.newsguy.com>

In article <fl_aggie-0204980929220001@aggie.coaps.fsu.edu>,
fl_aggie@thepentagon.com says...
>
>In article <lud8f04c1e.fsf@asfast.com>, Lloyd Zusman <ljz@asfast.com> wrote:
>
>+ If in this hypothetical ".help" or ".novices" newsgroup, an arrogant
>+ twit discourteously and condescendingly dismissed a question posed by
>+ a novice without suggesting anything more useful than to read the FAQ
>+ (if even that), the novice might feel a lot more justified in telling
>+ the arrogant twit something like this:
>
>+   This is a newsgroup where people who are not well versed in
>+   Perl can come to share information and to receive useful and
>+   meaningful help.  Therefore we are not impressed by your clever,
>+   but low-in-actual-information pronouncements.  Learn some courtesy
>+   or else shut up and go back to comp.lang.perl.misc.
>
>A couple of points:
>
>1. 'read the FAQ (4.12)' is high in information content
>2. the people likely to do such a thing will also likely not
>   going to read .help or .novices.
>
>In fact, a .novices newsgroup is likely to be _unused_ by the
>very people you seek to help! "Wow, this is a tough question.
>I want the right answer. Better ask a Wizard!"

Believe it or not, James, there are some non-pompous people out there who are
more than willing to help out novices and others who are just looking for a
quick bit of help without having to pour through the immense FAQ which may or
may not answer the question thoroughly. I know you wouldn't put yourself into
that category, and believe me, the novices would welcome your absense from the
group nearly as much as you would welcome their absense from this group.  People
who are knowledgable in perl will go to this other newsgroup to both help and
ask questions.  What are you afraid of?  That you'll get bored without all these
people to pick on?

>They're gonna go looking for the wizards, and not people like
>themselves. I can see a situation that will lead to massive
>xposting, and possibly meta-flame wars.

Wizards?  James, you are an arrogant little guy.  What could be the harm of
having this other newsgroup?  You will be rid of us wizard-wannabes and we will
be rid of you pompous asses.  It's a win-win.

Dave

>James
>
>-- 
>Consulting Minister for Consultants, DNRC
>The Bill of Rights is paid in Responsibilities - Jean McGuire
>To cure your perl CGI problems, please look at:
><url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: Thu, 02 Apr 1998 12:10:48 -0600
From: webmaster@dataplusnet.com
Subject: Multidimensional hashes
Message-Id: <3523D4A8.1E2CAF7C@dataplusnet.com>

I'm using perl5.002 and need to know how to handle a multidimensional
associative array.
I'm using:
$hash{$foo}{$bar} = $answer;
and the error occurs:
syntax error in file ./stats.cgi at line 253, next 2 tokens "}{"
Can anyone tell me what I'm doing wrong?

Thanks in advance
Dan Barrett
webmaster@dataplusnet.com



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

Date: Thu, 2 Apr 1998 10:01:08 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "John C. Quillan" <quillan@doitnow.com>
Subject: Re: Number of Perl Users/Instalitations.
Message-Id: <Pine.GSO.3.96.980402095736.6466M-100000@user2.teleport.com>

On Wed, 1 Apr 1998, John C. Quillan wrote:

> Subject: Re: Number of Perl Users/Instalitations.

> Actually I am just trying to get a ball park range.  

There are 8,302,973 Perl programmers in the world, and Perl is installed
on 173,290 machines. Wait, there's another one... :-)

You can make numbers which are more accurate than mine, I'm sure, but how
could you prove it? Oh, well! :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 02 Apr 1998 13:15:34 -0500
From: "Jayant V. Gokhale" <jayantg@bellatlantic.net>
To: "Suchita J. Gokhale" <skumari@command.com>
Subject: Perl applications
Message-Id: <3523D5C6.2DF12F44@bellatlantic.net>

Hi Everyone

I would appriciate if you could provide me information on reasanobly
sized customer using PERL based commercial software.

Thanks in advance

Jayant

--
***********************************************************************
Jayant Gokhale/Suchita Gokhale     Phone : (973)751 3083(Res)
Jayant V. Gokhale                  Phone : (201)896 6200 Ext.2349 (Off)
                                   Email : jayantg@bellatlantic.net
                                           jayantvg@hotmail.com
Suchita J. Gokhale                 Phone : (212)719 9696 Ext.239 (Off)
                                   Email : skumari@command.com
                                           sjgokhale@hotmail.com




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

Date: Thu, 2 Apr 1998 17:08:44 GMT
From: Eric Wong <egwong@netcom.com>
Subject: Re: Position in Toronto & Question
Message-Id: <egwongEqsqAK.HHD@netcom.com>

nwilson <nwilson@globalserve.net> wrote:
: My question is how long has Perl been around? What is the most experience
: in years a person can have?
[ cut ]

According the perlfaq1, perl 1 was released in January 1988.  I
suppose that means that anyone who says that they've been working
with perl for more than ten years is either lying or is Larry
Wall.

[ cc'd ]


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

Date: Thu, 02 Apr 1998 18:42:09 +0100
From: Fergal Daly <fergal@clubi.ie>
Subject: printing in windows
Message-Id: <3523CDF1.31416328@clubi.ie>

Is it possible to do proper printing in windows using perl? If not, is
it possible to talk directly to the printer and send epson codes
(assumig it understands them)? Thanks,

Fergal

P.S. I'd appreciate if you could cc answers to fergal@clubi.ie as I
don't get a chance to read news that often.



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

Date: Thu, 02 Apr 1998 17:09:05 GMT
From: dico@peionline.com (Dico Reyers)
Subject: redirecting with frames
Message-Id: <3523c628.11132893@news1.pei.sympatico.ca>

Hello there,

I have a web page with frames.  in one frame people are able to choose
an option and it should load up a new page in a separate window.  How
is this possible?

The person clicks on the section they want to go to and than clicks on
"GO" and it loads up a perl script which more or less says...


$whereto = $FORM{'options'};

print "Location: http://www.blablabla.com/$whereto\n\n";

But obviously this opens the page in the intial window, and not a
separate window.

ANy help/suggestions? Please email them to dico@peionline.com

Thanks,

Dico


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

Date: 2 Apr 1998 17:29:37 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Someone put my munged e-mail address on a spam list
Message-Id: <6g0hu1$l56$1@news.orst.edu>

In article <6g09q4$js02@eccws1.dearborn.ford.com>,
Ken Fox <kfox@pt0204.pto.ford.com> wrote:
>stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
>> Bart Lateur <bart.mediamind@tornado.be> wrote:
>> > It wastes a lot of OUR bandwidth though.
>> 
>> I have yet to have a munged address waste any of my bandwidth. The only
>> time YOU waste bandwidth is 1) when you decide to send mail, which is
>
>I think Bart was thinking of bandwidth in terms of how much a person
>can say per unit time.  

Then he would still be wrong. I can say the same amount per unit time to
someone who mungs an address as to one who does not. In fact, the
address is irrelevant. My news system doesn't care. My editor doesn't
care. Sometimes I notice the address is munged, but I don't really care,
so it doesn't slow me down, either.

>I always forget to check whether a poster is
>using some munged address -- a day or an hour later I get a bounce and
>then I have to try to figure out what the hell happened.  

You have an unusual news system that bounces news when you followup to
someone else's article when they use a munged address. Please tell me
which one this is so I can avoid it like the plague. If you are
referring to a mail system, then you made the choice to switch media to
one that requires a valid email address and should accept the costs. 

>Most of the
>time the original message with the de-munging instructions are gone
>and I'm left with guessing at the real address.  If it's annoying for
>me, just imagine what a pain it is for the Tom [CP]s of the world.

If the original message contained demunging instructions, and you didn't
read them, then why should I assume you read any of the message you are
replying to? Is it your habit to respond to messages without reading
them?

>Basically, a person who uses a munged address cares more about her
>time than about the time of the person trying to answer the post.

That is incorrect. It is not an issue of time, it is an issue of cost.
In case you didn't know this, spam can cost people money. As for people
answering the post, only those who have news systems that bounce
followups to articles with munged addresses have any problem answering
a post.

>Munged addresses aren't evil, but the people using them are a bit
>selfish.

Nonsense.

>P.S. I always de-munge an address in a follow up.  Otherwise the
>     attributions get messed up 

Oh, please. The attributions do not get messed up. If your newsreader
can't generate an attribution correctly for an article with a munged
address, get one that isn't broken.

>     and I think it's more important to
>     have an accurate record of who said what than it is to protect
>     people from spammers.

Don't be silly. If USENET were supposed to be an "accurate record", then
PGP would be mandatory and addresses would be validated. Neither is
true. 

Not only that, but there are people who claim that one's USENET identity
is their From: address. Aren't you CHANGING the identity of the person
you are quoting by changing this address for them? Why do you claim the
right to change what someone wants to call themselves? Would you be
happy were I to start calling you Billy Fix instead of the name you use
on your postings? 



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

Date: 2 Apr 1998 17:38:38 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Someone put my munged e-mail address on a spam list
Message-Id: <6g0ieu$pkb$1@news.orst.edu>

In article <3523AC0A.590A@min.net>, John Porter  <jdporter@min.net> wrote:
>John Stanley wrote:
>> 
>> In article <3522e7fd.3383874@news.tornado.be>,
>> Bart Lateur <bart.mediamind@tornado.be> wrote:
>> >
>> >It hardly costs any time to the spammer, since it's a fully automated
>> >process.
>> 
>> Yes, it is automated, and if the automaton is busy trying to send mail
>> to a bogus address it is 1) not sending it to a real address, perhaps
>> yours, and 2) wasting time. Since the automaton belongs to the spammer,
>> the waste belongs to the spammer, too.
>
>Bogus argument, John.  Any program which sends spam can send it to
>thousands (o.k, hundreds) of addresses per second, 

I didn't say it was a HUGE waste of time, but even .01 second is a
waste. Then consider if just 1000 addresses were munged. That's 10
seconds. The real numbers are much greater, so the time is much
greater.

>and it does not
>know the difference between a good address and a bad one.  In fact

I didn't say it did, nor does the argument depend on it. It is a waste
of the automaton's time whether it knows the address is invalid or not.

>In case you haven't noticed, spammers never respond to any message
>sent to the address they send from.  

So what? The fact they don't respond means it wasn't a waste of time to
send mail to a munged address?

>So no, bad (munged) addresses don't cause the spammer to incur any
>cost.  

Except the cost of electricity to run a computer that is wasting its
time sending mail to bogus addresses, the cost of disk to store the
bogus addresses, the cost of the connection that is being used to send
the mail to bogus addresses, the cost of the person who is supervising
the computer sending mail to bogus addresses, the cost of not sending
mail to a valid address when it was busy sending mail to a bogus
address...

Yes, if you ignore the costs, then there is no cost to a spammer.

>> Did I really need to specify that the spammer himself wasn't wasting
>> his time but his system was?
>
>No, but the fact undermines your argument.  CPU cycles are cheap.

But not free. Were they free, there would be no purpose in encrypting
anything. 

>If spammers had to manually deal with every bounced message, 

Bounced messages are not the issue.

>then
>address-munging would be effective.  But they don't, so it's not.

If the spam does not cause a cost to the recipient, then address
munging is effective. The fact that it also increases the costs to the
spammer is an incidental benefit.



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

Date: 2 Apr 1998 17:43:39 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Someone put my munged e-mail address on a spam list
Message-Id: <6g0iob$s7s$1@news.orst.edu>

In article <EqsAsJ.37q@cre.canon.co.uk>,
Andy Wardley <abw@cre.canon.co.uk> wrote:
>Tom Christiansen  <tchrist@mox.perl.com> wrote:
>>Usenet is a public forum.  
>
>John Stanley <stanley@skyking.OCE.ORST.EDU> wrote:
>>USENET is not mail.
>
>But the replies that Tom is trying to make are in response to questions
>posted in USENET, which *is* public forum.  

USENET is not mail. USENET is not the telephone system. Please explain
why being pissed that someone does not tell you how to send mail to them
in a USENET post is any more relevant than them not including their
phone number so you can call them. Or include their snail mail address
so you can write them a letter. Both of the latter are much more
conducive to "community" than email -- they are much more personal and
show a greater committment to the exchange than dashing off an email.

>If you ask for help publicly, 
>I think it's rude to make it difficult for people to help you.

Since munging does not make it difficult to respond, I see no relevance
to your statement here.



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

Date: Thu, 02 Apr 1998 17:12:33 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Someone put my munged e-mail address on a spam list
Message-Id: <3527c6bb.6112987@news.tornado.be>

John Stanley wrote:

>I have yet to have a munged address waste any of my bandwidth.

YOUR bandwidth?

I've heard estimates that over half of Internet's total bandwidth is
wasted on transferring spam emails. Which is EVERBODY's bandwidth.

BTW this has nothing to do with arguments pro or con address munging.
It's just to show that just not receiving spam isn't the solution. The
spam getting sent is the real problem.

	Bart.


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

Date: Thu, 02 Apr 1998 18:00:37 GMT
From: Clinton Bodine <Clinton.Bodine@mci.com>
To: jgloudon@bbn.com
Subject: unpack vs. substr (was Re: Data Structure for Input File)
Message-Id: <3523D223.B0B0D903@mci.com>

I have been happily using substr to parse my fixed-length/fixed-field
files.  When I saw this post, I decided to check out the unpack command. 

Here's my test script and my results:
-------------------------------------
#!/usr/local/bin/perl

use Benchmark;
$m="";
$TEMPLATE="a10a6a6a2a10a3a2a10a6a1a1a4a3a6a7a2a2a3a3a1a1a1a1a20a2a6a3a10a10a2a10a2a2a1a4a4a10a8a3a3a2a2a10a
1a3a3a5a1a2a2a2a2a2a2a2a2a3a5a3a9a9a4a1a6a6a3a5a4a4a4a1a1a1a5a5a1a1a1a5a1a1a1a2a30a6a6a9a9a9a9a9a138";

open FILE, shift;
read(FILE,$m,550) ;
close FILE;

timethis(10000000, '$detail = substr($m, 0, 10)');
timethis(100000, '@arr = unpack($TEMPLATE, $m)');
-----------------------------------------------------

/csbtemp> newtest.p input_file
timethis 10000000: 22 secs (21.45 usr  0.00 sys = 21.45 cpu)
timethis 100000: 32 secs (32.33 usr  0.02 sys = 32.35 cpu)

Or 466,200 substrs/sec vs 3,093 unpacks/sec.

These results seem a little skewed and I tried 100000 and 1000000
iterations for the substring part and found the time to be linear (    .2
seconds and 2 seconds, respectively).

I also implemented the unpack in my actual application and found a huge
performance decrease.

One important note:  for my applications, I don't need access to each
field, only maybe 10 out of the 100 or more in my records.

Jason Gloudon wrote:

> 
> Please Read the FAQ.
> www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html
> #How_can_I_manipulate_fixed_recor
> 
> --
> Jason Gloudon

-- 
Clinton Bodine
Email: Clinton.Bodine@mci.com


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

Date: Thu, 02 Apr 1998 18:30:34 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: unpack vs. substr (was Re: Data Structure for Input File)
Message-Id: <slrn6i7m5a.4dn.jgloudon@manitoba.bbn.com>

Clinton Bodine <Clinton.Bodine@mci.com> wrote:
 .
 . long template removed
 .
>timethis(10000000, '$detail = substr($m, 0, 10)');
>timethis(100000, '@arr = unpack($TEMPLATE, $m)');
>-----------------------------------------------------
>
>/csbtemp> newtest.p input_file
>timethis 10000000: 22 secs (21.45 usr  0.00 sys = 21.45 cpu)
>timethis 100000: 32 secs (32.33 usr  0.02 sys = 32.35 cpu)

You didn't ask unpack and substr to do the same amount of work, so why should it
take the same amount of time?

You asked unpack to extract the entire record, and copy it into an array.
You asked substr to copy the first ten bytes from one scalar to another. 
Hardly a fair comparison, Try unpack ("a10", $m).

-- 
Jason Gloudon


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

Date: 2 Apr 1998 17:10:10 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: verifying email address -- how?
Message-Id: <6g0gpi$c9p$1@news.orst.edu>

In article <352352CE.2706ABFB@spider.herston.uq.edu.au>,
Jaime Metcher  <metcher@spider.herston.uq.edu.au> wrote:
>> Nope, you get one of two results: "obviously bogus" and "who knows".
>
>In more detail, my three results are (in order): got an OK result from a
>EXPN or RCPT (after necessary MX lookups), 

Then you aren't really trying to verify the email address, you are
doing something I can't even really figure out a name for.  An OK from
a RCPT can mean simply "I will accept it for delivery", which is NOT
verification of the address.

>couldn't find the hostname at all and/or the address looks weird, 

Again, not the same as verifying the address. Please do an MX lookup on
a .UUCP address. You can't. As for "looks weird", you better stay away
from X.400 addresses.

>I can't get my SMTP host to accept mail for that address. InterNIC says
>the domain doesn't exist.  

Yep, I tried dyslexia.com. This one is bogus. But how about
dyslexia.UUCP?

>words/names.  You assumed I'd made a typo in the domain name - I'd

Please don't try to guess what I assumed. You are wrong.




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

Date: Thu, 02 Apr 1998 12:01:58 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: What to do about "regexp *+ operand could be empty"?
Message-Id: <3521845e.106791391@news.btinternet.com>

On Tue, 31 Mar 1998 23:28:51 +0200, schuerig@acm.org (Michael
Schuerig) wrote:

>
>I'm using a snippet from Tom Christiansen's striphtml to (rough and
>ready) replace HTML markup with whitespace.
>
>    $text =~ s{ <
>        (?:
>            [^>'"] *
>                |
>            ".*?"
>                |
>            '.*?'
>        ) +
>        >
>    }{ }ogsx;
>

You might try this which is only slightly different:

s/(?:<[^>'"]*|".*?"|'.*?')+>//gs;


/J\


Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm


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

Date: Thu, 02 Apr 1998 16:59:13 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: WindowsNT remote access
Message-Id: <3523b8ef.84383657@news.mmc.org>

On Thu, 2 Apr 1998 14:06:35 +0200, "Curdin Vital" <curdin.vital@swisscom.com>
wrote:

>How I can write a perl-script(Build 316), where I can connect from a
>Client to another Server with TCP/IP. And how I send the username
>and password in a secure way?
>
>Thank you for your help
>
>Curdin

You'll need to rely on NT's facilities for security (assuming you're talking
about NT networking and not NFS or FTP). I know the snippet below works fine on
an NT workstation connecting to an NT server, using Win32::Netresource on the
GSAR port of Perl v5.004_02 . . . with Win95, YMMV.

#!perl -w

use strict;

my ($error,%resource);

use Win32::NetResource;

# Change Provider's value in the hash below to 'NetWare Services' (or
# whatever shows in the 'Network' column in a NET USE command to that
# server) . . .

%resource = ( Scope => RESOURCE_CONNECTED,
	      Type => RESOURCETYPE_DISK,
	      DisplayType => RESOURCEDISPLAYTYPE_SERVER,
	      Usage => RESOURCEUSAGE_CONNECTABLE,
	      LocalName => 'R:',
	      RemoteName => '\\\\COMPUTER\\SHARENAME',
	      Comment => 'Hot Diggity Damn!',
	      Provider => 'Microsoft Windows Network'
	    );

unless (Win32::NetResource::AddConnection(\%resource, 'password','user',0))
{
	Win32::NetResource::GetError($error);
	die "Couldn\'t connect to $resource{RemoteName}. Error # $error\n"
}

The rest is up to you . . .

-- 
                               Jeffrey R. Drumm, Systems Integration Specialist
                       Maine Medical Center - Medical Information Systems Group
                                                            drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me


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

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

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