[22839] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5060 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 29 21:05:36 2003

Date: Thu, 29 May 2003 18:05:09 -0700 (PDT)
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, 29 May 2003     Volume: 10 Number: 5060

Today's topics:
    Re: a Bayesian intelligent e-mail autoresponder? <sardines@purse-seine.net>
        APP: perl script editor <nntp@cannabiscoffeeshops.co.uk.INVALID>
    Re: APP: perl script editor <goedicke@goedsole.com>
    Re: APP: perl script editor <heaney@cablespeed.com>
    Re: APP: perl script editor (Tad McClellan)
    Re: APP: perl script editor <nntp@cannabiscoffeeshops.co.uk.INVALID>
    Re: Filling an array from another array (Tad McClellan)
    Re: Filling an array from another array (Anno Siegel)
    Re: Filling an array from another array <REMOVEsdnCAPS@comcast.net>
    Re: Filling an array from another array <REMOVEsdnCAPS@comcast.net>
    Re: finding "mailto:" strings in html files <bwalton@rochester.rr.com>
    Re: finding "mailto:" strings in html files (Veky)
    Re: Help: Printing Out an Object?/Overloaded Operation  <bwalton@rochester.rr.com>
        How to get current URL from CGI-Perl program? - Apache <analystes@videotron.ca>
    Re: How to get current URL from CGI-Perl program? - Apa <flavell@mail.cern.ch>
    Re: How to get current URL from CGI-Perl program? - Apa <flavell@mail.cern.ch>
    Re: How to get current URL from CGI-Perl program? - Apa (Andres Monroy-Hernandez)
    Re: Nice'ing again.. <goedicke@goedsole.com>
    Re: Nice'ing again.. (Anno Siegel)
    Re: regular expression matches but $1 left undefined <krahnj@acm.org>
    Re: scope of variable (Tad McClellan)
    Re: sends email from the Windows machine <kalinabears@hdc.com.au>
    Re: variable for current line number (of script) <w.koenig@acm.org>
    Re: variable for current line number (of script) <ericw@nospam.ku.edu>
    Re: variable for current line number (of script) <emschwar@pobox.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 29 May 2003 23:14:27 +0100
From: Alan Clifford <sardines@purse-seine.net>
Subject: Re: a Bayesian intelligent e-mail autoresponder?
Message-Id: <Pine.LNX.4.53.0305292247520.1181@mundungus.clifford.ac>

On Wed, 27 May 2003, Western Larch wrote:

WL> How about this: instead of replying to every apparent spam message,
WL> reply only to the ones which look like they might possibly be non-spam.
WL> So if every message is assigned a score, and the scores above a
WL> threshold are thrown out as spam, then messages near but just above
WL> the threshold would merit a reply.
WL>


I have had more thoughts about this and this is essentially what I would
be doing if I switched in the bayesian filter rather than using just my
spam rules.  I do no manual categorizing of mail into spam/non-spam.

1.  Install password autoresponder.  Put your mother in the whitelist.

2.  Install bayesian filter

3.  Mail arrives.

4.  Store a copy of every mail.

5.  Use Bayes filter to check for spam.  At the beginning, there is no
    database to use.

6.  Filter out mailing list mail.

7.  Check whitelist and passthrough addresses.

8.  First mail is from your mum.  Deliver.

9.  Second mail is to a passthrough address.  Sender is put in white list

10.  Third mail causes an autoresponse.  Sender replies with password.
     Sender is put in white list

11.  Third mail causes an autoresponse. As it is a spam, no password will
     be returned.

12.  Every night at 4 am, age the mail store.  Mail older than 7 days is
     split it into spam and non-spam archives, based on mail addresses in
     the white list.  Exception is mailist mail which is stored as
     non-spam.

13.  Every night, recreate the database for the spam filter from the
     spam/non-spam archives.

14.  Go back to step 3.


Alan


( If replying by mail, please note that all "sardines" are canned.
  There is also a password autoresponder but, unless this a very
  old message, a "tuna" will swim right through. )



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

Date: Thu, 29 May 2003 23:09:22 +0100
From: Cannabis Coffee Shops <nntp@cannabiscoffeeshops.co.uk.INVALID>
Subject: APP: perl script editor
Message-Id: <MPG.194093a6e9faf30d98add3@news.newshosting.com>

Beginner level - what editors are worth a look .


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

Date: Thu, 29 May 2003 22:22:58 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: APP: perl script editor
Message-Id: <m3el2hqtor.fsf@mail.goedsole.com>

Dear Cannabis - 

Cannabis Coffee Shops <nntp@cannabiscoffeeshops.co.uk.INVALID> writes:

> Beginner level - what editors are worth a look .

You should probably look in an archive for the answer to this.  This
same question gets tossed around every six months or so.

I suggest http://www.xemacs.org.

     Yours -      Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
                          http://www.goedsole.com:8080      
============================================================

          Lest we forget:

use XML::Simple;
use DBI;
use LWP;
use Graph;

		- William Goedicke


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

Date: 29 May 2003 18:32:47 -0400
From: "Tim Heaney" <heaney@cablespeed.com>
Subject: Re: APP: perl script editor
Message-Id: <87r86h9yeo.fsf@mrbun.watterson>

Cannabis Coffee Shops <nntp@cannabiscoffeeshops.co.uk.INVALID> writes:

> Beginner level - what editors are worth a look .

I like XEmacs, myself, but perhaps you would like to read

  perldoc -q editor

or (the same thing online)

  http://www.perldoc.com/perl5.8.0/pod/perlfaq3.html#Is-there-an-IDE-or-Windows-Perl-Editor-

I hope this helps,

Tim


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

Date: Thu, 29 May 2003 17:34:47 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: APP: perl script editor
Message-Id: <slrnbdd2o7.1u4.tadmc@magna.augustmail.com>

Cannabis Coffee Shops <nntp@cannabiscoffeeshops.co.uk.INVALID> wrote:

> Beginner level - what editors are worth a look .


vi and/or emacs


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


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

Date: Fri, 30 May 2003 00:51:34 +0100
From: Cannabis Coffee Shops <nntp@cannabiscoffeeshops.co.uk.INVALID>
Subject: Re: APP: perl script editor
Message-Id: <MPG.1940a855bd817fb598add8@news.newshosting.com>

<comp.lang.perl.misc , William Goedicke , goedicke@goedsole.com>

> > Beginner level - what editors are worth a look .
> 
> You should probably look in an archive for the answer to this.  This
> same question gets tossed around every six months or so.
> 
> I suggest http://www.xemacs.org.
> 

Already downloaded some from a google search - just asked in case I 
missed anything dude :-)

Thanks to all who wrote .


-- 
http://www.cannabiscoffeeshops.co.uk


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

Date: Thu, 29 May 2003 17:33:23 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Filling an array from another array
Message-Id: <slrnbdd2lj.1u4.tadmc@magna.augustmail.com>

Graham Drabble <graham.drabble@lineone.net> wrote:

> I'm trying to do this and have been working on it for a while 


You are not "working smart" then. You should check to see if any
of the Perl FAQs help with what you are trying to do...


> and 
> haven't even got close to getting code that does what I need.


Your Question is Asked Frequently.


> @choices = ('a', 'b', 'c')
> and
> $depth = 3;
> 
> then how can I make
> 
> @all_possible_choices = ('a a a',
>     	    	    	    	    'a a b',
>                          'a a c',
>                          'a b a',
>                          'a b b',
>     	    	    	    	   .... all the rest,
>                          'c c c',)


   perldoc -q permute

      "How do I permute N elements of a list?"


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


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

Date: 29 May 2003 23:20:45 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Filling an array from another array
Message-Id: <bb64kd$g6r$1@mamenchi.zrz.TU-Berlin.DE>

Tad McClellan <tadmc@augustmail.com> wrote in comp.lang.perl.misc:
> Graham Drabble <graham.drabble@lineone.net> wrote:
> 
> > I'm trying to do this and have been working on it for a while 
> 
> 
> You are not "working smart" then. You should check to see if any
> of the Perl FAQs help with what you are trying to do...
> 
> 
> > and 
> > haven't even got close to getting code that does what I need.
> 
> 
> Your Question is Asked Frequently.
> 
> 
> > @choices = ('a', 'b', 'c')
> > and
> > $depth = 3;
> > 
> > then how can I make
> > 
> > @all_possible_choices = ('a a a',
> >     	    	    	    	    'a a b',
> >                          'a a c',
> >                          'a b a',
> >                          'a b b',
> >     	    	    	    	   .... all the rest,
> >                          'c c c',)
> 
> 
>    perldoc -q permute
> 
>       "How do I permute N elements of a list?"

Well, the OP asked about combinations, not permutations, but it may still
be a good idea to look at the permutation FAQ.  Techniques for one are
likely to apply to the other.  In particular, a solution that doesn't
rely on a fixed $depth is likely to be recursive, like the permute()
function of the FAQ.

Anno


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

Date: Thu, 29 May 2003 19:56:45 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Filling an array from another array
Message-Id: <Xns938AD49C365ABsdn.comcast@216.166.71.239>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

clists@perrin.socsci.unc.edu (Andrew Perrin (CLists)) wrote in
news:84n0h5xxx7.fsf@perrin.socsci.unc.edu:

> Graham Drabble <graham.drabble@lineone.net> writes:
> 
>> Hi all,
>> 
>> If I have 
>> 
>> @choices = ('a', 'b', 'c')
>> and
>> $depth = 3;
>> 
>> then how can I make
>> 
>> @all_possible_choices = ('a a a',
>>                                         'a a b',
>>                          'a a c',
>>                          'a b a',
>>                          'a b b',
>>                                        .... all the rest,
>>                          'c c c',)
>> 
> 
> Check out Algorithm::Permute (or any one of several other modules
that
> do the same thing). 

What Mr. Drabble is looking for is clearly not permutation.

- -- 
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13

iD8DBQE+1qumY96i4h5M0egRAjZTAKC7mSe7cXBPl96qMqmBYqPl3N/nKQCeM/ny
upp29YOdlDL61wkpDc74Rto=
=tltm
-----END PGP SIGNATURE-----


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

Date: Thu, 29 May 2003 19:58:50 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Filling an array from another array
Message-Id: <Xns938AD4F6DB5A7sdn.comcast@216.166.71.239>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

tadmc@augustmail.com (Tad McClellan) wrote in
news:slrnbdd2lj.1u4.tadmc@magna.augustmail.com:

> 
>    perldoc -q permute
> 
>       "How do I permute N elements of a list?"

More of an odometer problem than a permutation problem.

- -- 
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13

iD8DBQE+1qwjY96i4h5M0egRAnVFAKCZ8iL/mcOhRex6lOk3pQm9X5j7/ACeOa/A
1erb8EJqYsjXjW8My+s6HoQ=
=R0Uu
-----END PGP SIGNATURE-----


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

Date: Fri, 30 May 2003 00:43:53 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: finding "mailto:" strings in html files
Message-Id: <3ED6A7AB.8080902@rochester.rr.com>

Veky wrote:

> Dok je Veky citao comp.lang.perl.misc, 
> pod PIDom 27288 (290771 off, 428 to go...),
> primijetio je kreaturu zvanu clos@trentu.ca (Netware60),
> ispod cijih su prstiju izasle (izmedu ostalih) sljedece rijeci:
> 
> |thanks for the code... but when I run it i don't get any output  when
> |I know there should be some. Any suggestions as to what is going
> |wrong?  Thanks.
> |> @ARGV=<*.html>;while(<>){
> |> 	push@spamlist,@f if@f=/"(mailto:[\w@.])"/g


Well, the regexp here is looking for a string containing a " followed by 
mailto: followed by exactly one character which is alphanumeric, @ or ., 
followed by a ".  So "mailto:a" would work, or "mailto:@", etc.  But 
none of those are valid email addresses.  Maybe something like 
/"(mailto:[\w@.]+)"/g would work a little better?  You might be better 
off using modules like Email::Valid or RFC::RFC822::Address, as those 
should adhere to all the standards.  But I don't know if they would pick 
them out of HTML.


> |> };print join"\n",sort@spamlist
> 
> Did you run it from the directory in which your HTML files are?
> 
> 

-- 
Bob Walton



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

Date: Fri, 30 May 2003 00:47:24 +0000 (UTC)
From: veky@cromath.math.hr (Veky)
Subject: Re: finding "mailto:" strings in html files
Message-Id: <bb69ms$d9q$1@bagan.srce.hr>

Dok je Veky citao comp.lang.perl.misc, pod PIDom 317 (291645 off, 0 to go...),
primijetio je kreaturu zvanu bwalton@rochester.rr.com,
ispod cijih su prstiju izasle (izmedu ostalih) sljedece rijeci:

|> |> @ARGV=<*.html>;while(<>){
|> |> 	push@spamlist,@f if@f=/"(mailto:[\w@.])"/g
|Well, the regexp here is looking for a string containing a " followed by 
|mailto: followed by exactly one character which is alphanumeric, @ or ., 
|followed by a ".  So "mailto:a" would work, or "mailto:@", etc.  But 
|none of those are valid email addresses.  Maybe something like 
|/"(mailto:[\w@.]+)"/g would work a little better?

Of course, sorry, I meant + to be there.

|You might be better 
|off using modules like Email::Valid or RFC::RFC822::Address, as those 
|should adhere to all the standards.  But I don't know if they would pick 
|them out of HTML.

I really think that this one should be enough for the OP.

-- 
\#{%	Sad gradi svoj grad iz snova... znaj da mozes i znaj da znas...


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

Date: Fri, 30 May 2003 00:26:22 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Help: Printing Out an Object?/Overloaded Operation Error with Graph Module?
Message-Id: <3ED6A392.5050302@rochester.rr.com>

entropy123 wrote:

> Hey all,
> 
> I'm trying to get the Graph::DFS module up and running and one of the
> things I think I need is the DFS routine -> apparently its output is
> an 'object' :) and I don't know how to print out object
> attributes...that might be my problem...any advice?
> 


    use Data::Dumper;

   ...

    print Dumper($object);


 ...


-- 
Bob Walton



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

Date: Thu, 29 May 2003 18:51:35 -0400
From: "andré caron" <analystes@videotron.ca>
Subject: How to get current URL from CGI-Perl program? - Apache
Message-Id: <Z9wBa.3813$xG4.41305@weber.videotron.net>

Hi,

With a CGI-Perl program, is it possible to get the URL that the user sees?
I found the module Apache::URI but I'm still unable to get the current URL.
How can I get the URL?

OS: Red Hat 8, intel
Perl: 5.8.0
Apache 2

Many thanks,

André
Mirabel, Canada




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

Date: Fri, 30 May 2003 01:25:06 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How to get current URL from CGI-Perl program? - Apache
Message-Id: <Pine.LNX.4.53.0305300111190.10220@lxplus098.cern.ch>

On Thu, May 29, andré caron inscribed on the eternal scroll:

> With a CGI-Perl program, is it possible to get the URL that the user sees?

Not exactly...  You get a number of pieces, which you might be able to
re-assemble into a working absolute URL, but it might or might not be
exactly what the user specified, or is seeing in their client,
depending on a number of things (none of which are specific to Perl).

> I found the module Apache::URI but I'm still unable to get the current URL.

Perl is just the particular scripting language you're using: if
it's not there in the CGI, then no amount of magic from Perl is
going to fabricate it from whole cloth...

Note by the way that Apache::URI deals with the Apache API, not with
the CGI.  They're not the same thing, despite quite a number of
similarities.

> How can I get the URL?

Why exactly do you reckon that you need it?  What are you trying to
achieve, and why can't you achieve it with the environment variables
which the CGI provides for you?  But I say again, the question here is
about the CGI, not specifically about Perl (which is another way of
saying that there's a more appropriate group for it, as hinted in Perl
FAQ part 9, where you also find links to CGI specifications etc.)

good luck


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

Date: Fri, 30 May 2003 01:29:36 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How to get current URL from CGI-Perl program? - Apache
Message-Id: <Pine.LNX.4.53.0305300125280.10220@lxplus098.cern.ch>

On Thu, May 29, andré caron had posted a copy separately to
comp.lang.perl.modules that I'd already taken time and effort to
answer on .misc:

> Hi,
>
> With a CGI-Perl program, is it possible to get the URL that the user sees?

Don't multipost.

[x-posted and f'ups set]


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

Date: 29 May 2003 17:30:59 -0700
From: andres@monroy.com (Andres Monroy-Hernandez)
Subject: Re: How to get current URL from CGI-Perl program? - Apache
Message-Id: <3591b31a.0305291630.5846a2aa@posting.google.com>

Hi André,
you can read the HTTP headers to build the URL.

One way to do it is by concatenating $ENV{HTTP_HOST} with $ENV{REQUEST_URI}.


Regards,
-Andres Monroy


"andré caron" <analystes@videotron.ca> wrote in message news:<Z9wBa.3813$xG4.41305@weber.videotron.net>...
> Hi,
> 
> With a CGI-Perl program, is it possible to get the URL that the user sees?
> I found the module Apache::URI but I'm still unable to get the current URL.
> How can I get the URL?
> 
> OS: Red Hat 8, intel
> Perl: 5.8.0
> Apache 2
> 
> Many thanks,
> 
> André
> Mirabel, Canada


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

Date: Thu, 29 May 2003 22:21:28 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: Nice'ing again..
Message-Id: <m3isrtqtr8.fsf@mail.goedsole.com>

Dear Vlad - 

Vlad Tepes <minceme@start.no> writes:

> Reading the other post about altering priorities on scripts, I thought
> I'd try it out. I was expecting to make the script run slower when
> giving a high value with setpriority, but it seems not to make any
> difference.

Imprecisely, changing the priority makes a process more willing to
give up the CPU to other processes that are trying to use it.  So, you
won't see any slowdown if there's nothing else trying to use the CPU.
Way back when, it was also the case that it only offered to give up
cycles on an interrupt.  Typically we'd do a disk access to force an
interrupt.

     Yours -      Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
                          http://www.goedsole.com:8080      
============================================================

          Lest we forget:

Conversation: A series of digressions.

		- Kevin Montuori


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

Date: 29 May 2003 22:39:13 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Nice'ing again..
Message-Id: <bb626h$epu$1@mamenchi.zrz.TU-Berlin.DE>

Vlad Tepes  <minceme@start.no> wrote in comp.lang.perl.misc:
> Hi,
> 
> Reading the other post about altering priorities on scripts, I thought
> I'd try it out. I was expecting to make the script run slower when
> giving a high value with setpriority, but it seems not to make any
> difference.

The effect of task priority on execution speed is indirect and depends
not only on the type of system you're running but also on the load and
type of job mix that is running concurrently.  Very little can be said
in general.

If there is little concurrent load, priority has no effect because there
are no processes with better priority that want processing.

> Maybe someone could explain how and when to use these functions?
> 
> (I'm using Redhat 7.2, perl 5.8.0)
> 
> Here's my test script:

[snipped]

Try running two or more of these at different priorities and see what
happens.

This has nothing to do with Perl, except for the fact that you happen
to use Perl for benchmarking.

Anno


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

Date: Fri, 30 May 2003 00:56:46 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: regular expression matches but $1 left undefined
Message-Id: <3ED6AC3B.337CE80B@acm.org>

justin wrote:
> 
> Is it ever possible for a regular expression containing brackets to
> match a string and still leave $1 undefined? Because that's what's
> happening to me.
> 
> [snip]
> 
> This tiny bit of code shows the problem.
> 
> $re = 'GET\s(?:/docs/([A-Fa-f0-9]{32})|/servlet/s\?Name=ShowDoc&(?:id=([A-Fa-f0-9]{32})|pid=([A-Fa-f0-9]{4}-[A-Fa-f0-9]{2}-[A-Fa-f0-9]{2}-[A-Fa-f0-9]{2}-[A-Fa-f0-9]{2})))';
> $line = 'GET /servlet/s?Name=ShowDoc&pid=4559-01-01-00-00&login=1&ref=undefined&ctx=slst&ht=null&seq=1050469368984
> HTTP/1.0';
> 
> if ($line =~ /$re/) {;
>  print $1;
> }

I'm surprised that nobody mentioned this yet but if you are using
alternation you can get the contents of the alternate capturing
parenthesis in $+

if ( $line =~ /$re/ ) {
    print $+;
    }


John
-- 
use Perl;
program
fulfillment


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

Date: Thu, 29 May 2003 17:43:50 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: scope of variable
Message-Id: <slrnbdd396.1u4.tadmc@magna.augustmail.com>

Al MacHonahey <supermanisadork71@yahoo.com> wrote:
> Abigail <abigail@abigail.nl> wrote in message news:<slrnbd6le9.co.abigail@alexandra.abigail.nl>...

>> Please show us the compile time error you are getting you moron, 
>> because it seems you have stumbled upon the reality that you should
>> not be working in Perl.


That is not what Abigail wrote.

You are despicable for your attempts at deceit.


> ???


Why don't you _jsut_ go away krakle/Manny/Robin/MJ/Fredo/...

Are you off of your meds again?


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


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

Date: Fri, 30 May 2003 10:15:04 +1000
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: sends email from the Windows machine
Message-Id: <3ed6a3a3$0$7467@echo-01.iinet.net.au>


"Lev Altshuler" <levalt@rogers.com> wrote in message
news:lmvBa.303860$w7k.65766@news04.bloor.is.net.cable.rogers.com...
> Hi,
>
> I am trying to write a program that sends email from the Windows machine.
> I am using Mail::Mailer module when specifying 'smtp' as an argument:
>
> #!perl -w
>
> use Mail::Mailer;
> use Net::SMTP;
>
> my $type = 'smtp';
> my $server = 'smtp';
> my $mailer = new Mail::Mailer 'smtp', Server => $server;
> $mailer->open ( { From => 'levalt@rogers.com',
>               To     =>  'altlev@hotmail.com',
>                               Subject => 'Hello' });
> print $mailer "Hello world";
> $mailer->close;
>
> I get an error: "Can't locate Mail/Mailer.pm in @INC (@INC  contains...)"
> whereas it is available there.
>

Check carefully.
Mailer.pm should be in the "$INC[1]/Mail/" directory, *not* (for example)
the "$INC[1]/" directory.

See if the following prints 'ok':
perl -e "if( -e \"$INC[1]\\Mail\\Mailer.pm\") {print \"ok\"}"

If it doesn't print 'ok', then try it with $INC[0], $INC[2] and any other
@INC elements you might have. If it ever prints 'ok' then you're right - it
*is* there and I have no idea why it can't be found.

How did you install Mail::Mailer ?

> Could anyone give me a clue why it happens on Windows, please.
> Yet, please review this peace of code if everything is OK.
>

If that's your real address then you probably want:
$server = 'mail.rogers.com';

Cheers,
Rob




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

Date: Fri, 30 May 2003 00:20:00 +0200
From: Winfried Koenig <w.koenig@acm.org>
Subject: Re: variable for current line number (of script)
Message-Id: <3ED68790.4080609@acm.org>

Eric Wilhelm wrote:
> If a script is making an assumption to which the data does not conform, I
> would like to be able to print the line-number (or nearly so) of said
> assumption in a warning message.
> 
> If the assumption caused something like "divide by zero", the interpreter
> would die with an error and print the line number and filename at which
> the error occured.  I would like to be able to do this without dying
> (e.g. warn and skip).
> 
> I've only been able to find the $. special variable, which counts the
> lines of input, but not anything which would count the lines of the
> script.

try:

print "line " . __LINE__ . ' "' . __FILE__ ."\n";

and read 'perldoc perlsyn'

Winfried

-- 
Winfried Koenig   +49 69 868707   w.koenig@acm.org
Perl - Beratung und Programmierung in Unixumgebung



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

Date: Thu, 29 May 2003 23:26:31 GMT
From: Eric Wilhelm <ericw@nospam.ku.edu>
Subject: Re: variable for current line number (of script)
Message-Id: <pan.2003.05.29.18.23.25.716988.8222@nospam.ku.edu>

On Thu, 29 May 2003 17:20:00 -0500, Winfried Koenig wrote:

> Eric Wilhelm wrote:
>> I've only been able to find the $. special variable, which counts the
>> lines of input, but not anything which would count the lines of the
>> script.
> 
> try:
> 
> print "line " . __LINE__ . ' "' . __FILE__ ."\n";

Exactly what I was looking for.
This __VAR__ stuff opens up an entirely new can of Perl, 
which is always fun:)

Thanks,
Eric


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

Date: 29 May 2003 17:48:02 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: variable for current line number (of script)
Message-Id: <etowug9xqkt.fsf@wormtongue.emschwar>

Eric Wilhelm <ericw@nospam.ku.edu> writes:
> On Thu, 29 May 2003 17:20:00 -0500, Winfried Koenig wrote:
> > try:
> > 
> > print "line " . __LINE__ . ' "' . __FILE__ ."\n";
> 
> Exactly what I was looking for.

Nah, what you want is warn(); it's simpler and more maintainable.

> This __VAR__ stuff opens up an entirely new can of Perl, 
> which is always fun:)

I can count on the fingers of one foot how many times I've needed to
use them.

-=Eric
-- 
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
		-- Blair Houghton.


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

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.  

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


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