[16601] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4013 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 14 18:10:44 2000

Date: Mon, 14 Aug 2000 15:10:25 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <966291025-v9-i4013@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 14 Aug 2000     Volume: 9 Number: 4013

Today's topics:
    Re: Negativity in Newsgroup...Newbie Perspective (BUCK NAKED1)
    Re: Negativity in Newsgroup...Newbie Perspective (Randal L. Schwartz)
    Re: Negativity in Newsgroup...Newbie Perspective <mjcarman@home.com>
    Re: Negativity in Newsgroup (Nobody)
    Re: Negativity in Newsgroup <care227@attglobal.net>
    Re: Negativity in Newsgroup (BUCK NAKED1)
    Re: Negativity in Newsgroup <flavell@mail.cern.ch>
        parsing with HTML::TokeParser. johnvert@my-deja.com
    Re: passing from a korn shell to a perl script (Tony L. Svanstrom)
        Perfect Place to find Perl Jobs <anonymous@cotse.com>
    Re: Perfect Place to find Perl Jobs <mjcarman@home.com>
    Re: Perl and PWS Redux <gellyfish@gellyfish.com>
        perl installation problem on sparc <mikem@ndtel.com>
        Perl/Tk <barbuto@ax.apc.org>
    Re: Perl/Tk (Greg Bacon)
    Re: Perl/Tk <tom.kralidis@ccrs.nrcan.gcDOTca>
    Re: PerlScript (Active Perl) and COM interfaces <gellyfish@gellyfish.com>
        Print formatted output to variable <oliver.bork@comtrue.de>
    Re: Print formatted output to variable (Greg Bacon)
    Re: print problem (Logan Shaw)
    Re: print problem <lr@hpl.hp.com>
    Re: print problem (Abigail)
    Re: Procmail vs Perl. (Tony L. Svanstrom)
    Re: rand() not random at all <lr@hpl.hp.com>
    Re: rand() not random at all <mjcarman@home.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 14 Aug 2000 13:22:30 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Negativity in Newsgroup...Newbie Perspective
Message-Id: <7019-399838E6-49@storefull-245.iap.bryant.webtv.net>


--WebTV-Mail-8626-2508
Content-Type: Text/Plain; Charset=US-ASCII
Content-Transfer-Encoding: 7Bit

I have bit my tongue about this topic all that I can. As a newbie, I
have been made to feel unwanted, guilty and a bother by just posting a
question. Discussion groups ARE help groups. That's what they are for.

I followed all of the rules... to my knowledge... lurking for awhile
first, and reading the perl documentation... but it was still assumed
that I didn't do my homework, and I was still treated with extreme
curtness and rudeness in this group. Yep, I'm familiar with netiquette.
Most posters that have been in ngs for 2 weeks know about that!

IMHO, this is the most negative ng that I have seen, and I've been
posting in ngs for a few years. A friend of mine asked me why I bothered
with all of the BS here. That's a good question?

And how is a CGI question unrelated, if the CGI is written in Perl. OK,
let's say it is a hair off-topic, but it's not like asking about
cascading style sheets in a perl ng. 

The phrase "read the PerlFAQ," read "perl manpage," blah, blah, blah...
has been used so many times here that it's laughable. It reminds me of
many businesses who always use the phrase "we're experiencing high call
volume" even when they are not. A cop-out.

What's wrong with answering a question that has been asked before? I've
answered many questions in other groups that took me hours, yeh days, to
figure out, and didn't want another person to go through what I did.
It's called being nice.

When I posted my counter questions, it took 3 weeks to finally get an
answer. Finally, a nice gentleman posted the code. Throwing "Fish" does
help. That post helped me learn more perl than any other response. Many
of us learn better from seeing how it is done.

The thing that really gets me is oftentimes the answer is just one line
of code, yet the respondent would rather tease, insult, or send the
person on a wild good chase through the thousands of pages of perldocs
rather than quickly post one lousy line to help. Childish arrogance.

The arrogance here is nothing less than amazing and nauseating. I was
about to buy Randall Schwartz' perl book... until I saw his attitude
here about newbie questions.

I'd strongly suggested that some people here get off their high horse,
and stop assuming. The PerlFAQ are over 12,000 pages, and maybe someone
cannot find what they need... for whatever reason. The Perl
documentation is also not that great. It doesn't always give good
examples and/or thorough explanations.

And what if there is a reason someone cannot access the Perl Docs? Oh, I
know, fix your computer. Well, many of the docs are in tar.gz format,
and I've had trouble with WinZip working, and my webtv can't download
that format. Oh, I know, my problem, too bad.

Yes, a ng for newbies needs to be started. I understand why it "may not
work," but then again it's worth a shot because most newbies do not feel
comfortable and welcome in this maze of egos.

NO EMAILS PLEASE.


--WebTV-Mail-8626-2508
Content-Description: signature
Content-Disposition: Inline
Content-Type: Text/HTML; Charset=US-ASCII
Content-Transfer-Encoding: 7Bit

<html>
<body bgcolor="white" text="#000033">
<embed
src="http://lightning.prohosting.com/~discosco/mailrandomplayer.pl"></embed>
<DIV align="right">
<font size="1" color="#550000">
T&nbsp;&nbsp;H&nbsp;&nbsp;E&nbsp;&nbsp;</font><BR>
<font size="2" color="#330000">
<B>BUCK</B>&nbsp;&nbsp;</font><BR>
</DIV>
<BR>
<DIV align="center">
<font size='2' color='#993300'>
<i><b>Share your Perl and CGI knowledge at</b></i></font><BR>
<a href="news:alt.discuss.clubs.public.html.advanced.dennis100"><font
size='3'
color='#004411'><b>news:alt.discuss.clubs.public.html.advanced.dennis100</b></font></a><BR>
<BR>
<embed src="http://lightning.prohosting.com/~discosco/mailcounter.pl">
<a href="http://downtowndisco.hypermart.net/index.html"><img
src="http://downtowndisco.hypermart.net/skybanner.gif" width="100%"
border="0"></a><BR>
<BR>
</DIV>
<embed src="http://downtowndisco.hypermart.net/loadpg.pl"></embed>
</body>
</html>


--WebTV-Mail-8626-2508--


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

Date: 14 Aug 2000 12:29:25 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Negativity in Newsgroup...Newbie Perspective
Message-Id: <m1sns73alm.fsf@halfdome.holdit.com>

>>>>> "BUCK" == BUCK NAKED1 <dennis100@webtv.net> writes:

BUCK> The arrogance here is nothing less than amazing and nauseating. I was
BUCK> about to buy Randall Schwartz' perl book... until I saw his attitude
BUCK> here about newbie questions.

You mean the part where I said "newbies are welcome to post here, and
we expect them to follow the normal Usenet Nettiquette"?

What part of that counts as "attitude"?

Seriously, I'm genuinely curious.  What are you expecting CLPM to be?
And how is that different from what it is?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Mon, 14 Aug 2000 15:12:04 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Negativity in Newsgroup...Newbie Perspective
Message-Id: <39985293.EBDA55E9@home.com>

BUCK NAKED1 wrote:
>
> I followed all of the rules... to my knowledge... [...]
> and I was still treated with extreme curtness and rudeness in 
> this group.

To some extent, this is a problem of interpretation. Joe User asks a
question about something covered in the docs, George Guru fires of a
quick 'perldoc foo' response to point Joe in the right direction and
moves on to the next post. George's response is rather abrupt, though,
and this is perceived as rudeness or arrogance (or both) by Joe, even
though that was not at all George's intent. 

At other times, people take criticism of their code personally.

Usenet is tricky that way -- we have each others' words, but not the way
in which they were said. I generally try to phrase my responses such
that they're less likely to (mis)offend someone, but it requires a
conscious effort to consider how my words might be misconstrued. I
recommend developing a slightly thick skin before posting here, just in
case.

> IMHO, this is the most negative ng that I have seen, and I've been
> posting in ngs for a few years.

Perhaps, but at least we try to stay on-topic. I've run across newgroups
that purport to be about something which interests me, only to discover
after reading them for a little while that they're not much more than
chat rooms.

> And how is a CGI question unrelated, if the CGI is written in Perl.

I tend to agree with you on this one. Often the questions asked aren't
strictly Perl, but if the posters understood the situation well enough
to know that, then they probably wouldn't need to ask their question
either.  Of course, some CGI questions are very off-topic here. How to
test CGI scripts on your home PC in tangentially perl-related at best.

> Throwing "Fish" does help. That post helped me learn more perl 
> than any other response. Many of us learn better from seeing how
> it is done.

You'll get some of both here. Unfortunately, many of the code snippets
are posted by ... well ... not 'gurus' ... and have problems with them.
That's part of the reason old-timers like to point at the docs. Would
you rather have a wrong answer or a pointer to the right one? 

I was writing Perl long before I'd ever heard of perldoc. All those
"RTFM" posts here helped me to find a very useful tool.

> The PerlFAQ are over 12,000 pages, and maybe someone
> cannot find what they need... for whatever reason.

Do you know that you can search perldoc?

perldoc -f <function> -- search for help on <function>
perldoc -q <foo>      -- search the FAQ for help on <foo>

> The Perl documentation is also not that great. It doesn't 
> always give good examples and/or thorough explanations.

Suggestions for improvement are always welcomed, and the documentation
is continually being refined. With the exception of a few parts, though,
it is intended to be a reference, not a tutorial. Perhaps that's what
you're perceiving as a shortcoming?

> And what if there is a reason someone cannot access the Perl Docs? 
> Oh, I know, fix your computer. Well, many of the docs are in
> tar.gz format and I've had trouble with WinZip working, and my
> webtv can't download that format. Oh, I know, my problem, too bad.

Not at all: http://www.perl.com/pub/doc/manual/html/pod/ contains all of
perldoc in HTML format. If you can get here to post a question, you can
get to the documentation. No excuses. :)

-mjc


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

Date: 14 Aug 2000 18:01:49 GMT
From: nobody@contract.East.Sun.COM (Nobody)
Subject: Re: Negativity in Newsgroup
Message-Id: <8n9c6d$je5$1@eastnews1.east.sun.com>

In article <39972922$1_2@goliath2.newsfeeds.com>,
Baris <sumengen@hotelspectra.com> wrote:
>My experience is that perl has a very nice set of documentation, tutorials
>and FAQ's, but no newcomer to perl expects this kind of documentation there.
>People think that the FAQ's and documentation is just another stupid syntax
>details pack. That was my idea of perl. So I end up bying bunch of books
>(same way I did for every other language) and try to learn from them. But
>then I noticed after several months that the FAQ is pretty damn good and
>useful. It has more useful info than bunch of books I read.
>
>Recently a friend of mine learned perl. I was trying to convince him to take
>a look at the FAQ's or perl documentation, but other than function
>references he didn't look at it at all. He insists that he has to buy a new
>perl book everytime he wants to learn something about perl. He s coming from
>C culture.

This is very true.  When I first learned Perl 4, all I knew about it was
that it was an interpreted language.  I had some pre-existing scripts I
wanted to modify, so I went off and bought a perl book (not the O'Reilly
stuff at first -- Barnes & Noble didn't have many of them at the time).
I never knew about the existence of the FAQ or the perldocs until I
lurked around this group for awhile.  None of the other languages I
worked with before had anything similar (C, Ada, Fortran, Pascal, APL, etc...)
In fact, I was suprised to discover that I didn't need to buy anything to
run it.  

I do think that some folks around here are a bit too brusque in their replies,
but I think a pleasant response that directs someone to the FAQ or perldocs
is perfectly fine.  Granted, it is tiresome to see the same questions repeated,
but I believe a gentle shove in the right direction would go further
toward making these newbies eventually become productive participants in
c.l.p.m than a large boot in the a**.  The abrasive types do deserve the boot,
since it's likely all they understand, but most of the clueless newbies are
simply looking for guidance.  If they're new to Perl and find themselves
sitting in front of a system with Perl already installed, then they simply
may not be aware that the Perldocs exist.  They *should* lurk awhile and
search the archives, but, unfortunately,  a lot of people these days seem 
to be unaware of Netiquette or of the existence of the archives.  I often
feel like breaking out the flamethrower mysewlf when they show up asking 
repetetive questions, but I've noticed that bashing them simply makes them 
defensive and starts flamewars.  Polite admonishments and suggestions seem 
to have a better effect (though, not quite as much fun as bashing them with 
a clue-stick :-)  

Just my humble opinion...

Anita

 



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

Date: Mon, 14 Aug 2000 14:28:04 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Negativity in Newsgroup
Message-Id: <39983A34.67D4CDF4@attglobal.net>

Nobody wrote:
> 
> I do think that some folks around here are a bit too brusque in their replies,
> but I think a pleasant response that directs someone to the FAQ or perldocs
> is perfectly fine.  Granted, it is tiresome to see the same questions repeated,
> but I believe a gentle shove in the right direction would go further
> toward making these newbies eventually become productive participants in
> c.l.p.m than a large boot in the a**.  The abrasive types do deserve the boot,
> since it's likely all they understand, but most of the clueless newbies are
> simply looking for guidance. 

The originator of this thread was chastised for posting off topic,
stating within that post that he knew it was off topic, but since
more people posted in this NG than the proper one, the poster felt
justified in posting here.


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

Date: Mon, 14 Aug 2000 13:23:56 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Negativity in Newsgroup
Message-Id: <7019-3998393C-50@storefull-245.iap.bryant.webtv.net>

I think I may have forgot to turn off HTML on that last post. If so, my
apologies.

Dennis



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

Date: Mon, 14 Aug 2000 21:45:03 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Negativity in Newsgroup
Message-Id: <Pine.GHP.4.21.0008142143290.8293-100000@hpplus03.cern.ch>

On Mon, 14 Aug 2000, Drew Simonis wrote:

> The originator of this thread was chastised for posting off topic,
> stating within that post that he knew it was off topic, but since
> more people posted in this NG than the proper one, the poster felt
> justified in posting here.

Yeah, pretty much like searching for the lost dollar under the
streetlamp where the light is better, rather than in the dark alley
where he dropped it.



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

Date: Mon, 14 Aug 2000 18:05:49 GMT
From: johnvert@my-deja.com
Subject: parsing with HTML::TokeParser.
Message-Id: <8n9cdp$9kk$1@nnrp1.deja.com>

 I want to use HTML::TokeParser to parse stuff between tags, i.e.

   <T>Blah</T>

 And retrieve 'Blah'.  I tried the following:

   $p=HTML::TokeParser->new("file");
     while($line=$p->get_token("<T>"))
     {
       my $text=$p->get_trimmed_text;
       print "$text\n";
     }

 Taken from the HTML::TokeParser examples.  The problem is, the stuff
 between <T> and </T> is a set of more tag, not just plain text, and I
 simply want to retrieve these tags -as is-.  Example:

   <T><f>f</f><d c="left"></d></T>

 I want it to return: <f>f</f><d c="left"></d>

 How can I achieve that with HTML::TokeParser?  The above does not work.

 Thanks a lot,
   -- john
P.S. Deja went crazy, if multiple copies are posted of this I apologize.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 14 Aug 2000 22:16:00 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: passing from a korn shell to a perl script
Message-Id: <1efdkd7.1r50ypo14g4fvgN%tony@svanstrom.com>

GI812 <mail@mail.com> wrote:

> --------------5125A1948E31DBE4712D1C57
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit

Ask again without MIME and HTML and maaaaaybe I'll answer. :)


     /Tony
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
 DSS: 0x9363F1DB, Fp: 6EA2 618F 6D21 91D3 2D82  78A6 647F F247 9363 F1DB
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©1999  <http://www.svanstrom.com/?ref=news>  \O/   \O/


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

Date: Mon, 14 Aug 2000 14:44:57 -0400
From: "PerlPrincess" <anonymous@cotse.com>
Subject: Perfect Place to find Perl Jobs
Message-Id: <200008141844.OAA28261@anon.cotse.com>


Check out this IT Jobs site, perfect for finding PERL 
& other programming jobs.

http://jobs.naccbjobs.com

Good Luck!




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

Date: Mon, 14 Aug 2000 15:17:02 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Perfect Place to find Perl Jobs
Message-Id: <399853BE.4CBD3E50@home.com>

PerlPrincess wrote:
> 
> Check out this IT Jobs site, perfect for finding PERL
> & other programming jobs.
> 
[URL snipped]

This is the second time you posted that in the last week. Are you
getting a referral fee or something? Regardless, this is not a jobs
newsgroup and such postings are frowned upon here. Please look for a
more appropriate spot for them.

-mjc


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

Date: 14 Aug 2000 07:46:50 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl and PWS Redux
Message-Id: <8n84kq$oa$1@orpheus.gellyfish.com>

On Wed, 9 Aug 2000 03:16:32 -0400 Jim_Kearman wrote:
> I have been using PWS4 to test ASP with no problems. Tonight I installed
> ActiveState Perl in C:/Perl. PWS was running when I installed it. I selected
> PerlScript when I installed it.
> 
> In HKLM/System/CurrentControlSet/Services/Parameters/ScriptMap I have:
> 
> .cgi c:\perl\bin\perl.exe %s %s (someone suggested this in an earlier post;
> I also tried "perlis.dll")
> 
> And the same for .pl and .plx.
> 
> When I place the HTML below in wwwroot, and try to run:
> http://localhost/helloworld.htm I get no "hello world."
> 
> Why doesn't this run? I've also tried running a .pl installed in cgi-bin via
> an HTML page in root, and I get the HTTP 500 error (problem with page, as if
> it's trying to load the .pl instead of running it). I have cgi-bin
> permissions clicked at Read, Execute and Scripts. I've rebooted after
> editing the Registry and permissions.
> 
> Why doesn't Perl run? Thanks.
> 
> <%@ LANGUAGE = PerlScript %>
> <HTML>
> <HEAD>
> <TITLE>PerlScript Hello World!</TITLE>
> </HEAD>
> <BODY BGCOLOR="#FFFFFF">
> 
> <%
>>$Response->write("Hello world!");
>>%>
> </BODY>
> </HTML>
> 

This is a an ActiveServer Page that uses Perlscript not a Perl program.  It
should be saved with the appropriate extension for ASP and placed in a
directory which has the appropriate permissions - you will want to ask in
the group comp.infosystems.www.servers.ms-windows

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Mon, 14 Aug 2000 15:25:14 -0500
From: "news" <mikem@ndtel.com>
Subject: perl installation problem on sparc
Message-Id: <_yYl5.572$KK1.63451@news.corpcomm.net>

I downloading the precompiled perl package and GNUgdmb package and installed
them but I am getting a:

ld.so.1: perl: fatal: libgdbm.so.2: open failed: no such file or dircectory.

I have the path set to include /usr/local/bin and /usr/local/lib but to no
avail... any ideas?




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

Date: Mon, 14 Aug 2000 20:57:39 GMT
From: Fausto Arinos de A. Barbuto <barbuto@ax.apc.org>
Subject: Perl/Tk
Message-Id: <8n9mg0$i21$1@nnrp1.deja.com>



Hello,

I'm a Red Hat 6.2 user and have been trying to write
my first Perl script/program for the Tk language with
graphical interface. I have had problems, though; the
directive

use Tk;

yields a long error message which begins with "Tk.pm
not found" or something similar to this. I understand
that my system lacks packages that should have been
installed before my trying to run any Perl program
for Tk. Question: which are those packages?

Many TIA for any help given.

---Fausto



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 14 Aug 2000 21:41:06 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Perl/Tk
Message-Id: <spgprijgkn947@corp.supernews.com>

In article <8n9mg0$i21$1@nnrp1.deja.com>,
    Fausto Arinos de A. Barbuto  <barbuto@ax.apc.org> wrote:

: I'm a Red Hat 6.2 user and have been trying to write
: my first Perl script/program for the Tk language with
: graphical interface. I have had problems, though; the
: directive
: 
: use Tk;
: 
: yields a long error message which begins with "Tk.pm
: not found" or something similar to this. I understand
: that my system lacks packages that should have been
: installed before my trying to run any Perl program
: for Tk. Question: which are those packages?

Have you installed the Tk module?  Grab an archive from

    <URL:http://www.perl.com/CPAN/modules/by-module/Tk/>

Follow the usual steps:

    % tar xfz Tk###.###.tar.gz
    % perl Makefile.PL
    % make
    % make test
    % make install

Followups set.

Greg
-- 
OK, I can't play against a program that has four invisible phantom knights
on f4.  No wonder it has a 2050 rating.
    -- mjd


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

Date: Mon, 14 Aug 2000 17:45:26 -0400
From: "Tom Kralidis" <tom.kralidis@ccrs.nrcan.gcDOTca>
Subject: Re: Perl/Tk
Message-Id: <8n9p9m$qf37@nrn2.NRCan.gc.ca>

"Fausto Arinos de A. Barbuto" <barbuto@ax.apc.org> wrote in message
news:8n9mg0$i21$1@nnrp1.deja.com...
>
>
> Hello,
>
> I'm a Red Hat 6.2 user and have been trying to write
> my first Perl script/program for the Tk language with
> graphical interface. I have had problems, though; the
> directive
>
> use Tk;
>
> yields a long error message which begins with "Tk.pm
> not found" or something similar to this. I understand
> that my system lacks packages that should have been
> installed before my trying to run any Perl program
> for Tk. Question: which are those packages?
>
> Many TIA for any help given.
>
> ---Fausto
>

The error message means that the script cannot find the Tk module anywhere
within Perl's libraries on your system, which most likely means you do not have
it installed.

Let your sysadmin know you want this installed.  He can get Tk and tons of other
modules from http://www.cpan.org

Hope this helps.

=================================
Tom Kralidis
Systems Specialist
Canada Centre for Remote Sensing
Tel: (613) 947-1828
http://www.nrcan.gc.ca/~tkralidi/
=================================




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

Date: 14 Aug 2000 08:19:44 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: PerlScript (Active Perl) and COM interfaces
Message-Id: <8n86ig$lu$1@orpheus.gellyfish.com>

On Sat, 12 Aug 2000 18:34:54 -0700 Corey Cole wrote:
> How's this for a poser?

> I'm trying to create a Perl email handler for the Win2K SMTP server.
> If you create a component that implements an interface or two, you
> can handle incoming email before it gets to the file system (think
> procmail...)

> Anyways, there are VB, C++, and VBScript samples, but sadly
> no PerlScript samples ;( So how the heck to I implement
> an interface in PerlScript?  VBScript has a standard syntax
> (<InterfaceName>_<MethodName>) for doing so.  I would assume that
> there's also something like this for Perl.  I've looked through the
> ActiveState documentation, and I can't find anything that seems germane.


There are scriptlet examples with the 6* series Activestate Builds that
should be of some help.  There was also an article in The Perl Journal
on the subject last year - you should be able to get a back issue from
the web site <http://www.tpj.com>


/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Mon, 14 Aug 2000 22:44:17 +0200
From: "Oliver Bork" <oliver.bork@comtrue.de>
Subject: Print formatted output to variable
Message-Id: <8n9ljf$8687m$1@ID-10728.news.cis.dfn.de>

Hi,

how can I print the output delivered by a format to a variable ?

$jap = "This text should land in \$string !";

$string = write;

print $string;

format STDOUT =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$jap
 .

Thanx for every help.


    Oliver






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

Date: Mon, 14 Aug 2000 21:10:18 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Print formatted output to variable
Message-Id: <spgo1qhkn949@corp.supernews.com>

In article <8n9ljf$8687m$1@ID-10728.news.cis.dfn.de>,
    Oliver Bork <oliver.bork@comtrue.de> wrote:

: how can I print the output delivered by a format to a variable ?

The perlform manpage contains an example that does what you want.

Greg
-- 
The magic words are squeamish ossifrage.


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

Date: 14 Aug 2000 13:20:30 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: print problem
Message-Id: <8n9d9e$307$1@provolone.cs.utexas.edu>

In article <slrn8pgcc8.tj3.abigail@alexandra.foad.org>,
Abigail <abigail@foad.org> wrote:
>It *is* opened for reading. But mixing reading and writing a loop is
>a pretty dumb idea. Buffering will trash everything, and with buffering
>turned off, it still is generally a very bad idea.

It can still be useful if you want to update some fixed length data in
place or remove some characters.  Last I remember, inn did the first in
order to update its active file, and here's an example of the second
(it deletes all "x" characters from a file):

	open (FOO, "+</tmp/foo.txt")
		or die "Can't open because $!\n";

	$removeit = "x";

	$writepos = 0;

	while (sysread (FOO, $char, 1))
		{
		next if $char eq $removeit;

		# save the read position, move to the write position.
		$readpos = tell (FOO);
		seek (FOO, $writepos, 0);

		syswrite (FOO, $char, 1);

		# save the write position, move to the read position.
		$writepos = tell (FOO);
		seek (FOO, $readpos, 0);
		}

	close FOO;

Of course, that doesn't truncate the file, which will need to be made
shorter if any characters are removed.  But it gives the general idea.

  - Logan


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

Date: Mon, 14 Aug 2000 12:10:25 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: print problem
Message-Id: <MPG.1401e3ff7539a7c98ac76@nntp.hpl.hp.com>

In article <8n9d9e$307$1@provolone.cs.utexas.edu> on 14 Aug 2000 
13:20:30 -0500, Logan Shaw <logan@cs.utexas.edu> says...
> In article <slrn8pgcc8.tj3.abigail@alexandra.foad.org>,
> Abigail <abigail@foad.org> wrote:
> >It *is* opened for reading. But mixing reading and writing a loop is
> >a pretty dumb idea. Buffering will trash everything, and with buffering
> >turned off, it still is generally a very bad idea.
> 
> It can still be useful if you want to update some fixed length data in
> place or remove some characters.

 ...

> 		# save the read position, move to the write position.
> 		$readpos = tell (FOO);
> 		seek (FOO, $writepos, 0);
> 
> 		syswrite (FOO, $char, 1);
> 
> 		# save the write position, move to the read position.
> 		$writepos = tell (FOO);
> 		seek (FOO, $readpos, 0);

The seeks undo the effects of buffering and facilitate the alternations 
between input and output.  The number of characters written should be 
the same as the number read, or hell is likely to break loose.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 14 Aug 2000 19:24:56 GMT
From: abigail@foad.org (Abigail)
Subject: Re: print problem
Message-Id: <slrn8pghr1.tj3.abigail@alexandra.foad.org>

Logan Shaw (logan@cs.utexas.edu) wrote on MMDXL September MCMXCIII in
<URL:news:8n9d9e$307$1@provolone.cs.utexas.edu>:
-: In article <slrn8pgcc8.tj3.abigail@alexandra.foad.org>,
-: Abigail <abigail@foad.org> wrote:
-: >It *is* opened for reading. But mixing reading and writing a loop is
-: >a pretty dumb idea. Buffering will trash everything, and with buffering
-: >turned off, it still is generally a very bad idea.
-: 
-: It can still be useful if you want to update some fixed length data in
-: place or remove some characters.


Well, yes. I didn't idly write "generally". Furthermore, the example you
give uses sysread (reading one char at the time) and seek, not buffered
IO with <>, as the discussed program.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Tue, 15 Aug 2000 00:00:23 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Procmail vs Perl.
Message-Id: <1efdoez.7o5j3nfazjb8N%tony@svanstrom.com>

Tony L. Svanstrom <tony@svanstrom.com> wrote:

> A simple question: Why would I want to learn how to use procmail when I
> already know Perl, wouldn't it be easier, as well as potentially a lot
> more powerful, to simply use Perl for the mailfiltering?

Thank you all that answered.

I've now started working on a Perl-based solution; so far I've only got
a few lines that split up the headers and separate them from the body,
but I'm getting there. Altough I haven't focused too much on it so far
I'm doing my best to keep it nice to the system.

Next I'll add a set of functions so that you only have to do some if:ing
to get whatever you want done. I'm going for a basic solution that will
allow someone that is used to Perl[*] to set up a procmaillike solution
within minutes.


This is fun, and I'm going to release this work for sure. :)


     /Tony
[*] I guess "used to Perl" means "knows a little about Perl for
CGI-work" in this case.
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
 DSS: 0x9363F1DB, Fp: 6EA2 618F 6D21 91D3 2D82  78A6 647F F247 9363 F1DB
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©1999  <http://www.svanstrom.com/?ref=news>  \O/   \O/


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

Date: Mon, 14 Aug 2000 11:41:14 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: rand() not random at all
Message-Id: <MPG.1401dd276f2d867098ac73@nntp.hpl.hp.com>

[Rearranged for logical flow and snipped, according to Usenet 
practices.]

In article <3997EAA1.7C1DEE4@europem01.nt.com> on Mon, 14 Aug 2000 
14:48:33 +0200, Marr, Lincoln [HOOF:4713:EXCH] 
<lincolnmarr@europem01.nt.com> says...
> Jonne Viljanen wrote:

 ...

> > I'm trying to get a simple random number to specify a filename, but
> > whenever the script is run, I always get the same "random" number
> > (AUG3VRM6) as an output. What could be wrong?

 ...

> See
> http://www.perl.com/pub/doc/manual/html/pod/perlfaq4.html#Why_aren_t_my_random_numbers_ran
> 
> for a description about this and links to other solutions.

It is a sound practice to aim a poster at a FAQ that relates to the 
question asked.  It is even a sounder practice to glance at the FAQ in 
question first.

In this case, the FAQ has nothing to do with the question.  It deals 
with numbers that aren't sufficiently random because of the nature of 
the random-number generator, not with numbers that are the same each 
time the random-number generator is run.

I suspect that Jonne is using an ancient version of Perl (before 5.004) 
that requires explicit seeding of the random-number generator.  I would 
recommend that he read `perldoc srand` or (much better) upgrade to a 
newer version of Perl.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 14 Aug 2000 13:18:44 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: rand() not random at all
Message-Id: <39983804.1C527499@home.com>

Jonne Viljanen wrote:
> 
> I'm trying to get a simple random number to specify a filename, but
> whenever the script is run, I always get the same "random" number
> (AUG3VRM6) as an output. What could be wrong?
> 

What version of Perl are you running? If it's prior to 5.004 you need to
call srand() to set the seed before using rand(). 

-mjc


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 4013
**************************************


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