[23941] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6142 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 16 14:05:54 2004

Date: Mon, 16 Feb 2004 11:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 16 Feb 2004     Volume: 10 Number: 6142

Today's topics:
    Re: [MIME] How to attach eMails? <Guru03@despammed.com>
    Re: configure problem <alansecker@globalnet.co.uk>
    Re: configure problem <usenet@morrow.me.uk>
    Re: configure problem <alansecker@globalnet.co.uk>
    Re: DBD::mysqlPP  v DBD::mysql <jwillmore@remove.adelphia.net>
        Dynamic Ref names <news.wfitzgerald@crtman.com>
        extract parts of file - newbie jason@cyberpine.com
    Re: extract parts of file - newbie <noreply@gunnar.cc>
    Re: greedy v. non-greedy matching <matthew.garrish@sympatico.ca>
    Re: if for... (Aaron Sherman)
    Re: if for... (Aaron Sherman)
        Perl memory allocation <ian.cass@mblox.com>
    Re: Perl memory allocation <ebohlman@earthlink.net>
    Re: Perl memory allocation <ian.cass@mblox.com>
    Re: Perl memory allocation <ebohlman@earthlink.net>
    Re: RDBMS to hold Perl objects? (Aaron Sherman)
    Re: Reading html into a source file (Chris)
        Recommended mail module for plaintext sending? <ian@WINDOZEdigiserv.net>
    Re: Recommended mail module for plaintext sending? <notpublic@notpublic.not>
    Re: Recommended mail module for plaintext sending? <ian@WINDOZEdigiserv.net>
    Re: Regular Expresions & pattern matching (mis)understa <tadmc@augustmail.com>
    Re: Regular Expresions & pattern matching (mis)understa <uri@stemsystems.com>
    Re: Regular Expresions & pattern matching (mis)understa <noreply@gunnar.cc>
    Re: Regular Expresions & pattern matching (mis)understa <uri@stemsystems.com>
    Re: Replacing unicode characters <flavell@ph.gla.ac.uk>
    Re: Sending HASH over TCP (Anno Siegel)
    Re: Sending HASH over TCP <ceo@nospan.on.net>
    Re: Term::Prompt broken? Or am I misreading documentati (Daniel M. Drucker)
    Re: Trent Curry, wsanford@wallysanford.com, and falsely (Wally Sanford)
    Re: Why is Perl losing ground? <cwilbur@mithril.chromatico.net>
    Re: Why is Perl losing ground? (Aaron Sherman)
    Re: Why is Perl losing ground? (Aaron Sherman)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 16 Feb 2004 16:33:15 +0000 (UTC)
From: Guru03 <Guru03@despammed.com>
Subject: Re: [MIME] How to attach eMails?
Message-Id: <Xns9491B2A5B5F52Guru03despammedcom@193.43.96.1>

James Willmore <jwillmore@remove.adelphia.net> wrote in 
news:pan.2004.02.16.13.53.13.924363@remove.adelphia.net:

> I personally use MIME::Lite

Ok, but I must return a MIME::Entity object...


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

Date: Mon, 16 Feb 2004 15:40:48 +0000
From: Alan Secker <alansecker@globalnet.co.uk>
Subject: Re: configure problem
Message-Id: <4030E480.6020304@globalnet.co.uk>

Ben Morrow wrote:
> Alan secker <alan@asandco.co.uk> wrote:
> 

<SNIP>
> You do, or at least you have it partly installed. You have
> /usr/lib/libndbm.so, which is the NDBM shared library.
<ENDSNIP>

Quite right, I do.

<SNIP>
> 
> The ndbm header files :). Specifically, either /usr/include/ndbm.h or
> /usr/include/gdbm/ndbm.h (according to Configure).

<ENDSNIP>

> 1. Do you have either of these files?

      No, I definitely do not have those files.
> 
> 2. If you do, is it a symlink to somewhere else? Where?
> 
> 3. Is /usr/lib/libndbm.so a symlink? Where to?

      Yes, it points to libdb.so which in turn points to libdb.so.2.0.0
> 
> 4. I take it you're using glibc... what do you get if you run
>     /lib/libc.so.6
>    (yes, I do mean execute the shared library as an executable)?

     GNU C Library stable release version 2.3.2, by Roland McGrath et al.
     Copyright (C) 2003 Free Software Foundation, Inc.
     This is free software; see the source for copying conditions.
     There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
     PARTICULAR PURPOSE.
     Compiled by GNU CC version 3.3.1 (Mandrake Linux 9.2 3.3.1-1mdk).
     Compiled on a Linux 2.4.22 system on 2003-08-29.
     Available extensions:
     GNU libio by Per Bothner
     crypt add-on version 2.1 by Michael Glad and others
     linuxthreads-0.10 by Xavier Leroy
     BIND-8.2.3-T5B
     libthread_db work sponsored by Alpha Processor Inc
     NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
     Report bugs using the `glibcbug' script to <bugs@gnu.org>.
> 
> 5. What do you get from
>     nm -D /usr/lib/libndbm.so | grep errno
>    ?
       U errno
       w __errno_location
> 
> 6. If you know how, enquire of your package-management system whether
>    you have ndbm installed... rpm -q ndbm springs to mind, but it's
>    (thankfully) a long time since I last had to use rpm.

      package ndbm is not installed

Is the above helping?
TIA

Alan



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

Date: Mon, 16 Feb 2004 17:15:11 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: configure problem
Message-Id: <c0qtqv$fhe$1@wisteria.csv.warwick.ac.uk>


alan@asandco.co.uk wrote:
> Ben Morrow wrote:
> > Alan secker <alan@asandco.co.uk> wrote:
> >
> > You do, or at least you have it partly installed. You have
> > /usr/lib/libndbm.so, which is the NDBM shared library.
> 
> Quite right, I do.
> 
> > The ndbm header files :). Specifically, either /usr/include/ndbm.h or
> > /usr/include/gdbm/ndbm.h (according to Configure).
> 
> > 1. Do you have either of these files?
> 
>       No, I definitely do not have those files.
>
> > 2. If you do, is it a symlink to somewhere else? Where?
> > 
> > 3. Is /usr/lib/libndbm.so a symlink? Where to?
> 
>       Yes, it points to libdb.so which in turn points to libdb.so.2.0.0
>
> > 4. I take it you're using glibc... what do you get if you run
> >     /lib/libc.so.6
> >    (yes, I do mean execute the shared library as an executable)?
> 
>      GNU C Library stable release version 2.3.2, by Roland McGrath et al.
<snip>
>      linuxthreads-0.10 by Xavier Leroy
<snip>
>
> > 
> > 5. What do you get from
> >     nm -D /usr/lib/libndbm.so | grep errno
> >    ?
>        U errno
>        w __errno_location

Right... at least on my system, which has the same version of glibc
(with threads) and has ndbm a symlink to db the same, ndbm.so *doesn't*
have the symbol errno but does have __errno_location... this is as it
were the threadsafe version of errno.

> > 6. If you know how, enquire of your package-management system whether
> >    you have ndbm installed... rpm -q ndbm springs to mind, but it's
> >    (thankfully) a long time since I last had to use rpm.
> 
>       package ndbm is not installed

I think the answer is to reinstall the 'db' or 'berkeley-db' or 'db2'
package along with the corresponding '-dev' package. Sorry I can't be
more specific: I'm not familiar with how Mdk names things.

Ben

-- 
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk


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

Date: Mon, 16 Feb 2004 17:32:40 +0000
From: Alan Secker <alansecker@globalnet.co.uk>
Subject: Re: configure problem
Message-Id: <4030FEB8.1060708@globalnet.co.uk>

Ben Morrow wrote:
> alan@asandco.co.uk wrote:
> 
<SNIP>
> Right... at least on my system, which has the same version of glibc
> (with threads) and has ndbm a symlink to db the same, ndbm.so *doesn't*
> have the symbol errno but does have __errno_location... this is as it
> were the threadsafe version of errno.
> 

> 
> I think the answer is to reinstall the 'db' or 'berkeley-db' or 'db2'
> package along with the corresponding '-dev' package. Sorry I can't be
> more specific: I'm not familiar with how Mdk names things.
> 
> Ben
> 
<SNIP\>

Ben

Thank you. I think you've cracked it for me. I found:
http://rpm.pbone.net/index.php3/stat/15/limit/9/dl/40/pakman/2375/com/Olivier%20Thauvin%20%3Cthauvin_aerov_jussieu_fr%3E.html
thank provides, what looks like the answer. I'll check it out later.
Anyway, I'm very grateful.

Regards

Alan





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

Date: Mon, 16 Feb 2004 09:07:33 -0500
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: DBD::mysqlPP  v DBD::mysql
Message-Id: <pan.2004.02.16.14.07.31.386716@remove.adelphia.net>

On Mon, 16 Feb 2004 05:38:27 -0800, Mike Solomon wrote:

> At present I am using DBD:mysqlPP to connect to MySql
> 
> is there any advantages or disadvantages to using mysqlPP compared with mysql ?

Without looking over the modules, I can say this with some certainty -
one is pure Perl (the one with "pp" at the end [snicker :-)]) and the
other uses the MySQL headers and libraries.

The advantage with using the straight mysql module, IMHO, is you are
using the MySQL native functionality.  This *may* be better, depending
upon what you're doing.

However, the pure Perl version *may* be better because it does *not* rely
upon anything else except Perl.

My suggestion is to run some benchmarks against the two modules and see
what you come up with.

Just my $0.02

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
So far as I can remember, there is not one word in the Gospels in
praise of intelligence.   -- Bertrand Russell 



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

Date: Mon, 16 Feb 2004 17:52:46 GMT
From: Warrick FitzGerald <news.wfitzgerald@crtman.com>
Subject: Dynamic Ref names
Message-Id: <pan.2004.02.16.17.53.48.345460@crtman.com>

Hi All,

I'm trying to dynamically create worksheets using Spreadsheet::WriteExcel.

I'm looking through a log file and would like to create a worksheet for
each date.

In all example I can find you simply do:
$mySheet = $workbook->addworksheet("somename");

then to add data to that you simply do:
$mySheet->write(....);

That works great until I try to dynamically create $mySheet. 

--------------
This is what I tried. 

$date = $Fields[0]; <--- Get the date from the Logfile

${$date} = $workbook->addworksheet($date); <-- This created the workbook
for each date. date is of course formatted to be excel friendly name.

My problem come when trying to call the write method on my dynamic name.

${$date}->write(...) does not work ?
%{$date}->write(...) does not work ?

I have tried everything I can think of. Can someone please tel me how I
can call the write method on a dynamically named worksheet?

Thanks
Warrick FitzGerald














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

Date: 16 Feb 2004 07:59:26 -0800
From: jason@cyberpine.com
Subject: extract parts of file - newbie
Message-Id: <ef0a04d7.0402160759.25e406df@posting.google.com>

Hello. New to Perl and trying to figure out if beter way to do the
following (in Active State Perl under Windows 2000):

I have this DOS text file with about 20,000 lines. In the simple
example below I can extract lines that contain a particular string.

$db = "work.txt"; 
open (FILE,"$db"); 
@LINES=<FILE>; 
close(FILE); 
$SIZE=@LINES; 
print $SIZE,"\n";
for ($i=0;$i<=$SIZE;$i++) 
{ 
   $_=$LINES[$i]; 
   if (/motion/i)
   {print "$_";}
} 


How can I extract:

1. 5 lines before and after the string
2. Columns positions 5-15 (for all selected)
3. Limit selection to rows 5000-7000
4. The last 5 lines of the entire file

Many Thanks for any help or information!!


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

Date: Mon, 16 Feb 2004 17:02:10 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: extract parts of file - newbie
Message-Id: <c0qq2e$1a9dfo$1@ID-184292.news.uni-berlin.de>

jason@cyberpine.com wrote:
> In the simple example below I can extract lines that contain a
> particular string.
> 
> $db = "work.txt"; 
> open (FILE,"$db"); 
> @LINES=<FILE>; 
> close(FILE); 
> $SIZE=@LINES; 
> print $SIZE,"\n";
> for ($i=0;$i<=$SIZE;$i++) 
> { 
>    $_=$LINES[$i]; 
>    if (/motion/i)
>    {print "$_";}
> } 
> 
> How can I extract:
> 
> 1. 5 lines before and after the string
> 2. Columns positions 5-15 (for all selected)
> 3. Limit selection to rows 5000-7000
> 4. The last 5 lines of the entire file

By using your fantasy and possibly learning a little more Perl.

What have you tried so far? What difficulties did you encounter that
you weren't able to solve by help of the documentation and the FAQ?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Mon, 16 Feb 2004 10:25:47 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: greedy v. non-greedy matching
Message-Id: <Wh5Yb.2471$d34.403680@news20.bellglobal.com>


"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:c0qgod$for$2@mamenchi.zrz.TU-Berlin.DE...
> Matt Garrish <matthew.garrish@sympatico.ca> wrote in comp.lang.perl.misc:
> > Would anynoe care to enlighten me as to why the (.*?) pattern matches
> > greedily in the following example:
> >
> > my $text =<<TEXT;
> > I wouldn't expect the following text to match
>
> [...]
>
> Greedy vs. non-greedy never decides *if* a pattern matches, it can only
> modify *what* it matches.  So your expectation is unjustified.
>

Yeah, it was too early in the morning to be thinking about regexes. I was
thinking that the outer grouping would limit the match to multiple instance
of "xyz...abc" to the end of the string, instead of still finding the first
"xyz" to the last "abc".

Matt




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

Date: 16 Feb 2004 06:32:36 -0800
From: ajs@ajs.com (Aaron Sherman)
Subject: Re: if for...
Message-Id: <eaa2c627.0402160632.3d2dba1@posting.google.com>

Brian McCauley <nobull@mail.com> wrote

> > So, you have to restrict for to a single instance,
> 
> No you don't.
> 
> > and that seems non-intuitive to many users
> 
> So don't do it.

So, what this really comes down to is this: people have stated their
reasons for disagreeing with this idea (as I have) and you disagree
back. That's fine, but don't discount such disagreement. I don't think
you've added anything new to the debate, and honestly, it's just
syntatic sugar that can be re-stated trivially. I think postfix loops
were a mistake. Postfix logic was a lesser mistake, but one I can live
with, but postfix loops just force too many people to think about a
statement in a way that Perl doesn't on the whole.

And for the record, the p6l discussion is wide open to the public in
the archives. It raged on for a month or more, so I don't think you'll
have any trouble finding it. I feel such footnotes to well archived
information are better than re-posting several megabytes of heated
conversation.... You can find it by searching for "elsunless" ...
postfix operations, continue blocks, scoping and switch-like uses of
if/elsif/else were discussed ad nauseum.


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

Date: 16 Feb 2004 06:43:32 -0800
From: ajs@ajs.com (Aaron Sherman)
Subject: Re: if for...
Message-Id: <eaa2c627.0402160643.46ea70ef@posting.google.com>

Robert Wallace <robw@sofw.org> wrote

> > So, you have to restrict for to a single instance, and that seems
> > non-intuitive to many users, so you really haven't gained much clarity
> > in the language.
> 
> wow, you guys paint such a dark picture.

It's not really that dark, it's just that Perl has at its core a way
of expressing programms a bit more like the way humans think than
other languages. To tweak the language you must first think about the
impact on that relationship.

I think that chaining postfix operations would "sound" a bit better,
but ultimatey because of the complicated scope issues an difficulty
editing any such chain it would lead to a less "thinkable" statement.

Here's an example:

  print if /\d/ for @{$_} for keys %{$_} for @_;

Ok, now just make a small change... make the innermost conditional
match if $_ is a reference and is equal to the outermost reference....

I'd write it as:

  for my $hashref (@_) {
    for my $arrref (grep {(ref($_) && $_ eq $hashref) || /\d/} keys
%{$hsahref}) {
      print;
    }
  }

But you can't use that grep very effectively inside the chained
postfix operations.

And is the above so hard to write?


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

Date: Mon, 16 Feb 2004 14:20:42 GMT
From: "Ian Cass" <ian.cass@mblox.com>
Subject: Perl memory allocation
Message-Id: <_k4Yb.153$eu.2466007@news-text.cableinet.net>

Guys, why doesn't this program release its memory?

use strict;
my $t = "test";
for (my $i = 0; $i < 25; $i++) {
        $t .= $t;
}
$t = '';
print "Allocated and freed memory\n";
<>;

When I do a 'ps' to see the memory in use, I see the following

ian.cass 10724  6.4 12.8 136496 132592 pts/0 S    13:44   0:00 perl t.pl

Why isn't $t = '' freeing the memory that was allocated in the previous for
loop?

Tested on Debian Linux 2.6.2 kernel with Perl 5.8.3 and on Redhat Linux
2.4.20 kernel with Perl 5.8.0

--
Ian Cass





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

Date: 16 Feb 2004 14:31:22 GMT
From: Eric Bohlman <ebohlman@earthlink.net>
Subject: Re: Perl memory allocation
Message-Id: <Xns9491572366717ebohlmanomsdevcom@130.133.1.4>

"Ian Cass" <ian.cass@mblox.com> wrote in
news:_k4Yb.153$eu.2466007@news-text.cableinet.net: 

> Guys, why doesn't this program release its memory?

perldoc -q free

(the second entry displayed is the one you want)


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

Date: Mon, 16 Feb 2004 14:41:41 GMT
From: "Ian Cass" <ian.cass@mblox.com>
Subject: Re: Perl memory allocation
Message-Id: <FE4Yb.164$_P.2707686@news-text.cableinet.net>

Eric Bohlman wrote:
> "Ian Cass" <ian.cass@mblox.com> wrote in
> news:_k4Yb.153$eu.2466007@news-text.cableinet.net:
>
>> Guys, why doesn't this program release its memory?
>
> perldoc -q free
>
> (the second entry displayed is the one you want)

My Perl is compiled with the OS's malloc rather than Perls.

My variable is a global, so it will never go out of scope, but I've tried
"$var = undef;" without any success.

I'll put some code in to re-exec it every 24hrs if I can't find another way
around this issue.

Thanks.

--
Ian Cass





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

Date: 16 Feb 2004 17:58:41 GMT
From: Eric Bohlman <ebohlman@earthlink.net>
Subject: Re: Perl memory allocation
Message-Id: <Xns94917A493E3CBebohlmanomsdevcom@130.133.1.4>

"Ian Cass" <ian.cass@mblox.com> wrote in
news:FE4Yb.164$_P.2707686@news-text.cableinet.net: 

> Eric Bohlman wrote:
>> "Ian Cass" <ian.cass@mblox.com> wrote in
>> news:_k4Yb.153$eu.2466007@news-text.cableinet.net:
>>
>>> Guys, why doesn't this program release its memory?
>>
>> perldoc -q free
>>
>> (the second entry displayed is the one you want)
> 
> My Perl is compiled with the OS's malloc rather than Perls.

How is that relevant?

> My variable is a global, so it will never go out of scope, but I've
> tried "$var = undef;" without any success.

The entry I was talking about said that the space for out-of-scope and 
undefined variables becomes reusable by perl for use in other parts of the 
program, not by the OS.


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

Date: 16 Feb 2004 06:58:19 -0800
From: ajs@ajs.com (Aaron Sherman)
Subject: Re: RDBMS to hold Perl objects?
Message-Id: <eaa2c627.0402160658.6b2e9b34@posting.google.com>

Robert <bobx@linuxmail.org> wrote in message news:<EPGdnc6NrZvyeb_d4p2dnA@adelphia.com>...
> Randal L. Schwartz wrote:
> > If you want a free RDBMS, there's plenty.  I recommend DBD::SQLite as
> > a serverless solution, or DBD::Pg and PostgreSQL as a proper database.
> > Stay away from MySQL for new installations, no point in it anymore.
> > 
> Simply wrong! Now once PG goes native on Windows THEN I see no point. 
> Until then MySQL it is. Firebird is looking really good as well. ;-)

Using google groups, so please understand I would have set a
followup-to if I could :-(

MySQL is the easiest database to maintain that I've ever used. It fits
in with the UNIX Tao quite nicely and manages tables the way a UNIX
admin would expect.

This is in stark contrast to just about every other DB I've used, so I
use MySQL pretty much exclusively (especially after having to install
PostgreSQL once and having admined Oracle for a few years).

PostgreSQL is a nice database, and I'm glad MySQL has competition that
keeps it moving forward (as the PostgreSQL folks have had the same),
but as soon as sub-selects appear in a stable release my last reason
for considering anything else will evaporate (though if you need
sub-selects, you probably have a serious problem with your data
architecture in most cases).

Back to Perl: you should be designing your code so that it will work
with any back-end and carefully isolating database-specific features
using your choice of abstraction model. MySQL is great for rapid
prototyping, but in a produciton environment, you may find that you
need certain performance tuning features more readily available in
Oracle. Or you may find that you have to talk to an existing DB2
back-end. Always best to modularize the back-end.


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

Date: 16 Feb 2004 09:44:59 -0800
From: chris.tunnecliff@markelintl.com (Chris)
Subject: Re: Reading html into a source file
Message-Id: <b8146f1.0402160944.3a39ef69@posting.google.com>

Thanks all for the input Bill, your script works great!  Thanks again.


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

Date: Mon, 16 Feb 2004 14:21:22 GMT
From: "Ian.H" <ian@WINDOZEdigiserv.net>
Subject: Recommended mail module for plaintext sending?
Message-Id: <pan.2004.02.16.14.21.21.945603@hybris.digiserv.net>

Hi all,

I'm currently coding a Perl/Tk app which has (or will have) the ability to
send LARTs to abuse@ addresses in regards to spam etc etc as a feature.

I installed the Mail::SendEasy module as I need this feature to be able to
use a 3rd-party (ie: ISP) mailserver. The perldoc page was great and I had
a working example coded in no time.. but have fallen across one hurdle.

My mailserver outright dropped the mail as the HELO data that was sent was
just 'main'. I had a look at the source for the Mail::SendEasy module and
I don't see any reference there to HELO commands.

There are many mail modules on CPAN.. but are any recommended over others
for sending mails? This only needs to be simple and send plaintext mails
only. The lighter the module the better. I could do this direct with
IO::Socket but a light-weight module would be nicer =)


TIA for any info.



Regards,

  Ian

-- 
Ian.H
digiServ Network
London, UK
http://digiserv.net/



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

Date: Mon, 16 Feb 2004 16:01:15 +0100
From: "kz" <notpublic@notpublic.not>
Subject: Re: Recommended mail module for plaintext sending?
Message-Id: <k05Yb.12$Qq4.19772@news.uswest.net>

"Ian.H" <ian@WINDOZEdigiserv.net> wrote in message
news:pan.2004.02.16.14.21.21.945603@hybris.digiserv.net...
> Hi all,
>
> I'm currently coding a Perl/Tk app which has (or will have) the ability to
> send LARTs to abuse@ addresses in regards to spam etc etc as a feature.
>
> I installed the Mail::SendEasy module as I need this feature to be able to
> use a 3rd-party (ie: ISP) mailserver. The perldoc page was great and I had
> a working example coded in no time.. but have fallen across one hurdle.
>
> My mailserver outright dropped the mail as the HELO data that was sent was
> just 'main'. I had a look at the source for the Mail::SendEasy module and
> I don't see any reference there to HELO commands.
>
> There are many mail modules on CPAN.. but are any recommended over others
> for sending mails? This only needs to be simple and send plaintext mails
> only. The lighter the module the better. I could do this direct with
> IO::Socket but a light-weight module would be nicer =)
>
>
> TIA for any info.
>
>
>
> Regards,
>
>   Ian
>
> -- 
> Ian.H
> digiServ Network
> London, UK
> http://digiserv.net/
>
I'm using Mail::Sender written by Jenda Krynicky.

HTH,

Zoltan




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

Date: Mon, 16 Feb 2004 16:31:14 GMT
From: "Ian.H" <ian@WINDOZEdigiserv.net>
Subject: Re: Recommended mail module for plaintext sending?
Message-Id: <pan.2004.02.16.16.31.13.711585@hybris.digiserv.net>

On Mon, 16 Feb 2004 16:01:15 +0100, kz wrote:

> "Ian.H" <ian@WINDOZEdigiserv.net> wrote in message
> news:pan.2004.02.16.14.21.21.945603@hybris.digiserv.net...
>> Hi all,
>>
>> I'm currently coding a Perl/Tk app which has (or will have) the ability
>> to send LARTs to abuse@ addresses in regards to spam etc etc as a
>> feature.


[ snip ]


>> There are many mail modules on CPAN.. but are any recommended over
>> others for sending mails? This only needs to be simple and send
>> plaintext mails only. The lighter the module the better. I could do this
>> direct with IO::Socket but a light-weight module would be nicer =)


[ snip ]


> I'm using Mail::Sender written by Jenda Krynicky.
> 
> HTH,
> 
> Zoltan


Thanks for this.. I did see it on CPAN duing my 'Mail::' search.. I must
have skimmed over reading the info too much.

Will check this module out today.

Many thanks =)



Regards,

  Ian

-- 
Ian.H
digiServ Network
London, UK
http://digiserv.net/



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

Date: Mon, 16 Feb 2004 08:38:27 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Regular Expresions & pattern matching (mis)understanding
Message-Id: <slrnc31lf3.42b.tadmc@magna.augustmail.com>

Nils Petter Vaskinn <no@spam.for.me.invalid> wrote:

> and probably wrong

> /^(.*)<page>([0-9]+)</page>(.*)/;
> $page = $2;
> $rest = $1 . $3;


Using the dollar-digit variables without first ensuring that
the match succeeded is indeed wrong.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 16 Feb 2004 17:22:10 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Regular Expresions & pattern matching (mis)understanding
Message-Id: <x74qtr548t.fsf@mail.sysarch.com>

>>>>> "GH" == Gunnar Hjalmarsson <noreply@gunnar.cc> writes:
  GH> Robert Stelmack wrote:
  >> #!/usr/bin/perl
  >> $_= "He had come to pass his experience along to me -
  >> if <page>10</page>I cared to have it.";
  >> $PAGE =~ /[<page>][0-9][<\/page>]/;


  GH> Several mistakes in that line.

  GH> - You need parentheses around $PAGE to enforce list context.

why is list context needed?

  GH> This is what I suppose you mean:

  GH>      ($PAGE) = /<page>([0-9]+)<\/page>/;

and why do you have list context there? you never use the grabbed
results in that line.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Mon, 16 Feb 2004 18:35:53 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Regular Expresions & pattern matching (mis)understanding
Message-Id: <c0qvid$1atr7f$1@ID-184292.news.uni-berlin.de>

Uri Guttman wrote:
>>>>>>"GH" == Gunnar Hjalmarsson <noreply@gunnar.cc> writes:
>   GH> Robert Stelmack wrote:
>   >> #!/usr/bin/perl
>   >> $_= "He had come to pass his experience along to me -
>   >> if <page>10</page>I cared to have it.";
>   >> $PAGE =~ /[<page>][0-9][<\/page>]/;
> 
>   GH> Several mistakes in that line.
> 
>   GH> - You need parentheses around $PAGE to enforce list context.
> 
> why is list context needed?
> 
>   GH> This is what I suppose you mean:
> 
>   GH>      ($PAGE) = /<page>([0-9]+)<\/page>/;
> 
> and why do you have list context there? you never use the grabbed
> results in that line.

No, but two lines further down, OP's code presupposes that $PAGE 
contains the page number. After having suggested a minimum of changes 
to OP's code, I also mentioned that the whole line is redundant, and 
that the page number well can be captured in the s/// operator.

What's your message, Uri?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Mon, 16 Feb 2004 17:55:02 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Regular Expresions & pattern matching (mis)understanding
Message-Id: <x7isi652q1.fsf@mail.sysarch.com>

>>>>> "GH" == Gunnar Hjalmarsson <noreply@gunnar.cc> writes:

  GH> Uri Guttman wrote:
  >>>>>>> "GH" == Gunnar Hjalmarsson <noreply@gunnar.cc> writes:

  >> >> $PAGE =~ /[<page>][0-9][<\/page>]/;

  GH> - You need parentheses around $PAGE to enforce list context.

  >> why is list context needed?

well, without any grabs nor assignment, list context is meaningless
there. the line has =~.

  GH> This is what I suppose you mean:
  GH> ($PAGE) = /<page>([0-9]+)<\/page>/;

  >> and why do you have list context there? you never use the grabbed
  >> results in that line.

  GH> What's your message, Uri?

i didn't see the change from =~ to = in that line. so it was more than
just your previous comment about list context being needed.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Mon, 16 Feb 2004 15:36:28 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Replacing unicode characters
Message-Id: <Pine.LNX.4.53.0402161520230.26716@ppepc56.ph.gla.ac.uk>

On Mon, 16 Feb 2004, Tulan W. Hu wrote:

> Is 'iso-8859-1' the same as 'latin1'?

Strictly speaking, "Latin1" denotes a character repertoire, not a
specific encoding.  The Latin 1 repertoire can be encoded with
CP850 (sometimes called "DOS Latin 1"), CP-1047 (EBCDIC Latin 1),
iso-8859-1, or indeed with a subset of utf-8 etc. or some other
encoding which covers the repertoire.  That's the theoretical
position.

But in practice, when anyone refers to Latin 1 in relation to
a character encoding, they surely mean the appropriate ISO encoding,
namely iso-8859-1.

By the way, don't forget that not all ISO repertoires are Latin. So,
although they both start at 1, after a while, the numbering gets out
of step: the encoding iso-8859-7 is for the Greek repertoire, not
Latin-anything, and there are encodings for Cyrillic, Arabic,
Hebrew; the iso encoding for the latin 9 repertoire is iso-8859-15,
for example.


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

Date: 16 Feb 2004 14:57:09 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Sending HASH over TCP
Message-Id: <c0qlo5$j2n$1@mamenchi.zrz.TU-Berlin.DE>

Mina Naguib  <spam@thecouch.homeip.net> wrote in comp.lang.perl.misc:
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> Chris wrote:
> > Aside from Ben Morrow's solution (which I wish I had the time to try), 
> > if you are stuck on a "Dumper()" solution, you might get more mileage 
> > out of the XML::Dumper::pl2xml() and xml2pl() routines.  Write yourself 
> > a psuedo-web service that passes XML structures back and forth. pl2xml() 
> > and xml2pl() will handle this rightly.
> 
> Another solution is Net::EasyTCP written by yours truly.

 ...and a very fine little module it is.  It hides what you don't want to be
bothered with and exposes what you want to decide.  It's intuitive, so you
can use it immediately.  It deserves its name.

Anno


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

Date: Mon, 16 Feb 2004 15:51:59 GMT
From: Chris <ceo@nospan.on.net>
Subject: Re: Sending HASH over TCP
Message-Id: <zG5Yb.36736$ck1.29280@newssvr33.news.prodigy.com>

Mina Naguib wrote:
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> Chris wrote:
> 
>> Aside from Ben Morrow's solution (which I wish I had the time to try), 
>> if you are stuck on a "Dumper()" solution, you might get more mileage 
>> out of the XML::Dumper::pl2xml() and xml2pl() routines.  Write 
>> yourself a psuedo-web service that passes XML structures back and 
>> forth. pl2xml() and xml2pl() will handle this rightly.
> 
> 
> Another solution is Net::EasyTCP written by yours truly.

Dude...  Very nice.  I'll definitely keep this in mind in the future.

Chris
-----
Chris Olive
chris -at- --spammer-speed-bump-- technologEase -dot- com
http://www.technologEase.com
(pronounced "technologies")


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

Date: 16 Feb 2004 09:52:49 -0800
From: dmd@3e.org (Daniel M. Drucker)
Subject: Re: Term::Prompt broken? Or am I misreading documentation?
Message-Id: <b804d06d.0402160952.124f6415@posting.google.com>

> Not sure, as I got Term::Prompt version 0.12 (in the process of being
> posted to CPAN - there's been a change of package ownership that's

Term::Prompt 0.12 is now available on CPAN, and solves the problem I was having.

Daniel


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

Date: 16 Feb 2004 08:24:14 -0800
From: wally@wallysanford.com (Wally Sanford)
Subject: Re: Trent Curry, wsanford@wallysanford.com, and falsely using existing email addresses
Message-Id: <9415ae90.0402160824.51634307@posting.google.com>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in message news:<c0pq75$1ab952
> The first thing I would do is trying to figure out which ISP he is
> using to access Internet, and asking them to take actions. The 
> "NNTP-Posting-Host:" header seems to contain that info.

Thanks, Gunnar.


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

Date: Mon, 16 Feb 2004 15:29:42 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: Why is Perl losing ground?
Message-Id: <87isi7uk98.fsf@mithril.chromatico.net>

>>>>> "BM" == Ben Morrow <usenet@morrow.me.uk> writes:

    BM> use63net@yahoo.com (Unknown Poster) wrote:

    >> The large software projects that will be developed through a
    >> complete OO process can't be done 20% the way Bob likes it, 25%
    >> Ann likes it, 15% Raoul likes it, and 40% the only way the
    >> project manager knows how to do it.

    BM> Right... so for such a project, you write a set of coding
    BM> guidelines that standardises how it's going to be done. And
    BM> everyone follows them. Where's the problem?

In theory, this works.  In practice, the project manager won't write
code, and hasn't written more than 3 lines of code at a time since his
COBOL days, and will dig in his heels about writing coding guidelines
because he doesn't see the point.  Bob is more interested in reading
Slashdot, and so will adhere to any coding guidelines to the letter in
order to have more Slashdot time, but his code is unreadable even
though technically correct.  Ann would rather be working in Java
anyway, and is trying to write Java in Perl.  Raoul considers himself
the best coder in the world, and refuses to allow coding guidelines to
hamper his self-expression, and since the project manager doesn't
really see the point in coding guidelines in the first place, he gets
away with it.  

Coding guidelines are only as good as the people who produce them and
the people who enforce them.  The Perl approach allows well-managed
and good programmers to get a great deal of work done, whether working
alone or in groups; the bondage-and-discipline approach allows a
poorly-managed team of mediocre programmers to get any work done at
all -- and even then it's a crapshoot.

(My own preference, having worked with both, is for the well-managed
team of good programmers; but that's not the way the statistics fall
out in most companies.)

Charlton


-- 
cwilbur at chromatico dot net
cwilbur at mac dot com


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

Date: 16 Feb 2004 09:37:49 -0800
From: ajs@ajs.com (Aaron Sherman)
Subject: Re: Why is Perl losing ground?
Message-Id: <eaa2c627.0402160937.334ddfc9@posting.google.com>

Eric Bohlman <ebohlman@earthlink.net> wrote in message news:<Xns94913B8228361ebohlmanomsdevcom@130.133.1.17>...

> Yep.  Larry, AFAICT, didn't intend Perl to be an "undisciplined" language.  
> He intended it to be a "bring your own discipline (BYOD)" language.  And I 
> think that's because he realized that:

I'm not convinced that that much thought went into it. I think Perl is
the result of "oh crap, someone's actually using it!" Mind you, Larry
makes it look much easier than it is, so sometimes it can seem like
there's a plan....

With Perl 6 there is clearly a plan and several goals, but that's Perl
6.

> 1) Despite all the religious wars over which style of programming 
> discipline is the Right One, what really matters in the real world of 
> writing correct, scalable and maintainable programs is that you pick one 
> and stick to it.

True to an extent. That statement can, of course, be twisted into a
justification for some VERY poor choices.

> 2) (This one is probably going to raise some hackles) Many problems are not 
> technical problems and therefore one should not attempt to solve them by 
> technological means.  In particular, programming discipline or the lack 
> thereof is a social problem, not a technical one, and therefore requires a 
> social solution rather than a technical solution.

I agree to a point. The key difference between you and I here is that
I think the language should have a set of tools for casting some of
those social conventions into code. The strict module is a simple
example of this. In Perl 6 there will likely be many more such
features for telling perl what constraints you wish to place on the
code. This can be quite beneficial too, as certain constraints will
make certain optimizations possible (one of the reasons that I
disagree slightly with some of Parrot's design goals).


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

Date: 16 Feb 2004 09:44:37 -0800
From: ajs@ajs.com (Aaron Sherman)
Subject: Re: Why is Perl losing ground?
Message-Id: <eaa2c627.0402160944.233e04b2@posting.google.com>

David Dyer-Bennet <dd-b@dd-b.net> wrote in message news:<m2ekt3anok.fsf@gw.dd-b.net>...

> PHP out-performs Perl by a tremendous margin in a shared hosting
> environment, which is where most sites are implemented.  mod_perl
> doesn't isolate the various users enough to be very safe in a shared
> hosting environment, and you need mod_perl to get performance.

Many have replied, but I just want to point out one side point:
comparing PHP to mod_perl is like comparing Tomcat to Python. You
really need to look at equivalent tools. Mason, The Template Toolkit
or bricolage would be appropriate tools to compare to PHP as they
provide the template substitution and (to various degrees) the other
content services that one expects out of the box with PHP. mod_perl is
really just an interface to the Apache API.

THAT is why so many people go to PHP: it's easier to use than
mod_perl, and they don't understand that there are better (or at least
more abstract) Perl based tools available to them.


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V10 Issue 6142
***************************************


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