[26281] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8463 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 27 21:05:30 2005

Date: Tue, 27 Sep 2005 18:05:05 -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           Tue, 27 Sep 2005     Volume: 10 Number: 8463

Today's topics:
    Re: Checking to see if PID is running <abigail@abigail.nl>
    Re: Checking to see if PID is running (Anno Siegel)
        CPAN install failure - help? <peoria6384@yahoo.com>
    Re: CPAN install failure - help? <abigail@abigail.nl>
    Re: CPAN install failure - help? <1usa@llenroc.ude.invalid>
    Re: CPAN install failure - help? <peoria6384@yahoo.com>
    Re: FAQ . <ebohlman@omsdev.com>
    Re: FAQ . axel@white-eagle.invalid.uk
    Re: Help - How do I install Perl (CPAN) on Windows ? <noreply@gunnar.cc>
    Re: Help - How do I install Perl (CPAN) on Windows ? <1usa@llenroc.ude.invalid>
    Re: How do I get more-detailed directory info? <joe@inwap.com>
    Re: print  @{1} versus print  @{11} <joe@inwap.com>
        Shell script <chalupa@yomama-nospam.com>
    Re: Shell script <sherm@dot-app.org>
        Use of hash variables in module call - puzzling behavio <news@lawshouse.org>
    Re: Use of hash variables in module call - puzzling beh <1usa@llenroc.ude.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 27 Sep 2005 21:16:23 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Checking to see if PID is running
Message-Id: <slrndjjdl7.9lk.abigail@alexandra.abigail.nl>

A. Sinan Unur (1usa@llenroc.ude.invalid) wrote on MMMMCDX September
MCMXCIII in <URL:news:Xns96DDE20AB4A90asu1cornelledu@127.0.0.1>:
##  "H. Wade Minter" <minter@lunenburg.org> wrote in
##  news:IE1_e.71957$SL.1554708@twister.southeast.rr.com: 
##  
## > Is there a preferred module, under Linux, to verify whether a given
## > process ID number is still running?  Nothing looked promising via a
## > CPAN search, and I didn't get anywhere with "perldoc -q process" or
## > "perldoc -q pid". 
##  
##  perldoc -f kill


Well, you can find out something in some cases, but you cannot use kill
to find out whether a given process ID isn't running.

I presume your suggestion is 'kill 0, $PID'. Sure, if that returns true,
the process is running. But if it's false, it just means you can't send
it a signal. This can be because there's no process with that process ID,
but it can also be because the process sending the signal doesn't have
UID 0, and doesn't have the same UID as the process the signal is send to.


Abigail
-- 
#!/opt/perl/bin/perl -w
$\ = $"; $SIG {TERM} = sub {print and exit};
kill 15 => fork for qw /Just another Perl Hacker/;


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

Date: 27 Sep 2005 22:01:54 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Checking to see if PID is running
Message-Id: <dhcfgi$233$1@mamenchi.zrz.TU-Berlin.DE>

Abigail  <abigail@abigail.nl> wrote in comp.lang.perl.misc:
> A. Sinan Unur (1usa@llenroc.ude.invalid) wrote on MMMMCDX September
> MCMXCIII in <URL:news:Xns96DDE20AB4A90asu1cornelledu@127.0.0.1>:
> ##  "H. Wade Minter" <minter@lunenburg.org> wrote in
> ##  news:IE1_e.71957$SL.1554708@twister.southeast.rr.com: 
> ##  
> ## > Is there a preferred module, under Linux, to verify whether a given
> ## > process ID number is still running?  Nothing looked promising via a
> ## > CPAN search, and I didn't get anywhere with "perldoc -q process" or
> ## > "perldoc -q pid". 
> ##  
> ##  perldoc -f kill
> 
> 
> Well, you can find out something in some cases, but you cannot use kill
> to find out whether a given process ID isn't running.
> 
> I presume your suggestion is 'kill 0, $PID'. Sure, if that returns true,
> the process is running. But if it's false, it just means you can't send
> it a signal. This can be because there's no process with that process ID,
> but it can also be because the process sending the signal doesn't have
> UID 0, and doesn't have the same UID as the process the signal is send to.

    use Errno;
    $alive = kill( 0, $PID) || $!{ EPERM};

does a decent job, as far as it's portable.

Anno
-- 
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article.  Click on 
"show options" at the top of the article, then click on the 
"Reply" at the bottom of the article headers.


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

Date: Tue, 27 Sep 2005 23:21:19 GMT
From: ChiTownBob <peoria6384@yahoo.com>
Subject: CPAN install failure - help?
Message-Id: <Ptk_e.7187$6e1.538@newssvr14.news.prodigy.com>

I'm pretty much a newbie; used Perl very casually over the years, but 
never got too deep. Right now I'm trying to convert my company's docs 
into the Wikipedia format (MediaWiki), and I found a package 
http://search.cpan.org/~diberri/HTML-WikiConverter-0.30/WikiConverter.pm 
that promises to do that for HTML.

(btw, if someone has a better way to do this, regardless of whether it's 
perl or not, *please* speak up).

Anyway, CPAN fails to install it, and I am clueless as to why. Here's 
the relevant part of the output:

========================================

 ...............

HTML-WikiConverter-0.30/README Removing previously used 
\.cpan\build\HTML-WikiConverter-0.30 CPAN.pm: Going to build 
D/DI/DIBERRI/HTML-WikiConverter-0.30.tar.gz

Checking if your kit is complete...

Looks good

Writing Makefile for HTML::WikiConverter
-- OK
Running make test

'test' is not recognized as an internal or external command, operable 
program or batch file.

test -- NOT OK

Running make install

make test had returned bad status, won't install without force 
=============================

I've tried going back in and saying "force install HTML::WikiConverter" 
but that just fails in the same way. This is all on Windows XP. Help?
Bob


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

Date: 27 Sep 2005 23:36:24 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: CPAN install failure - help?
Message-Id: <slrndjjlro.9lk.abigail@alexandra.abigail.nl>

ChiTownBob (peoria6384@yahoo.com) wrote on MMMMCDX September MCMXCIII in
<URL:news:Ptk_e.7187$6e1.538@newssvr14.news.prodigy.com>:
::  I'm pretty much a newbie; used Perl very casually over the years, but 
::  never got too deep. Right now I'm trying to convert my company's docs 
::  into the Wikipedia format (MediaWiki), and I found a package 
::  http://search.cpan.org/~diberri/HTML-WikiConverter-0.30/WikiConverter.pm 
::  that promises to do that for HTML.
::  
::  (btw, if someone has a better way to do this, regardless of whether it's 
::  perl or not, *please* speak up).
::  
::  Anyway, CPAN fails to install it, and I am clueless as to why. Here's 
::  the relevant part of the output:
::  
:: ========================================
::  
::  ...............
::  
::  HTML-WikiConverter-0.30/README Removing previously used 
::  \.cpan\build\HTML-WikiConverter-0.30 CPAN.pm: Going to build 
::  D/DI/DIBERRI/HTML-WikiConverter-0.30.tar.gz
::  
::  Checking if your kit is complete...
::  
::  Looks good
::  
::  Writing Makefile for HTML::WikiConverter
::  -- OK
::  Running make test
::  
::  'test' is not recognized as an internal or external command, operable 
::  program or batch file.
::  
::  test -- NOT OK
::  
::  Running make install
::  
::  make test had returned bad status, won't install without force 
:: =============================
::  
::  I've tried going back in and saying "force install HTML::WikiConverter" 
::  but that just fails in the same way. This is all on Windows XP. Help?


Do you have a working make installed?


Abigail
-- 
END   {print "Hacker\n"}
BEGIN {print "Just "   }
INIT  {print "Perl "   }
CHECK {print "another "}


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

Date: Tue, 27 Sep 2005 23:45:33 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: CPAN install failure - help?
Message-Id: <Xns96DEC8FD94BB3asu1cornelledu@127.0.0.1>

ChiTownBob <peoria6384@yahoo.com> wrote in
news:Ptk_e.7187$6e1.538@newssvr14.news.prodigy.com: 

> Anyway, CPAN fails to install it, and I am clueless as to why. Here's 
> the relevant part of the output:
> 
> ========================================
> 
> ...............
> 
> HTML-WikiConverter-0.30/README Removing previously used 
> \.cpan\build\HTML-WikiConverter-0.30 CPAN.pm: Going to build 
> D/DI/DIBERRI/HTML-WikiConverter-0.30.tar.gz
> 
> Checking if your kit is complete...
> 
> Looks good
> 
> Writing Makefile for HTML::WikiConverter
> -- OK
> Running make test
> 
> 'test' is not recognized as an internal or external command, operable 
> program or batch file.
> 
> test -- NOT OK
> 
> Running make install
> 
> make test had returned bad status, won't install without force 
> =============================
> 
> I've tried going back in and saying "force install
> HTML::WikiConverter" but that just fails in the same way. This is all
> on Windows XP. Help? Bob

I am not sure which Perl distribution you are using. Unless you are 
using cygwin, you very likely do not have the proper tools to compile 
Perl modules from scratch.

Now, the good news is that the module does not seem to contain any XS 
code, so you don't really need a C compiler.

Just extraction the files from the archive, and manually copying the 
files to the appropriate locations should work. That is:

c:\Perl\site\lib\HTML\WikiConverter.pm
c:\Perl\site\lib\HTML\WikiConverter\DocuWiki.pm
 ...  etc
bin\html2wiki => c:\Perl\bin\html2wiki.pl

assuming you have vanilla AS Perl installation in C:\Perl

Or, you can put the files in a separate location, and then put a use lib 
in your scripts.

See perldoc -q lib

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

Date: Wed, 28 Sep 2005 00:41:12 GMT
From: ChiTownBob <peoria6384@yahoo.com>
Subject: Re: CPAN install failure - help?
Message-Id: <IEl_e.7208$6e1.6006@newssvr14.news.prodigy.com>

A. Sinan Unur wrote:
> ChiTownBob <peoria6384@yahoo.com> wrote in
> news:Ptk_e.7187$6e1.538@newssvr14.news.prodigy.com: 
> 
> 
>>Anyway, CPAN fails to install it, and I am clueless as to why. Here's 
>>the relevant part of the output:
>>
>>========================================
>>
>>...............
>>
>>HTML-WikiConverter-0.30/README Removing previously used 
>>\.cpan\build\HTML-WikiConverter-0.30 CPAN.pm: Going to build 
>>D/DI/DIBERRI/HTML-WikiConverter-0.30.tar.gz
>>
>>Checking if your kit is complete...
>>
>>Looks good
>>
>>Writing Makefile for HTML::WikiConverter
>>-- OK
>>Running make test
>>
>>'test' is not recognized as an internal or external command, operable 
>>program or batch file.
>>
>>test -- NOT OK
>>
>>Running make install
>>
>>make test had returned bad status, won't install without force 
>>=============================
>>
>>I've tried going back in and saying "force install
>>HTML::WikiConverter" but that just fails in the same way. This is all
>>on Windows XP. Help? Bob
> 
> 
> I am not sure which Perl distribution you are using. Unless you are 
> using cygwin, you very likely do not have the proper tools to compile 
> Perl modules from scratch.
> 
> Now, the good news is that the module does not seem to contain any XS 
> code, so you don't really need a C compiler.
> 
> Just extraction the files from the archive, and manually copying the 
> files to the appropriate locations should work. That is:
> 
> c:\Perl\site\lib\HTML\WikiConverter.pm
> c:\Perl\site\lib\HTML\WikiConverter\DocuWiki.pm
> ...  etc
> bin\html2wiki => c:\Perl\bin\html2wiki.pl
> 
> assuming you have vanilla AS Perl installation in C:\Perl
> 
> Or, you can put the files in a separate location, and then put a use lib 
> in your scripts.
> 
> See perldoc -q lib
> 
> Sinan
> 

thanks to Sinan and Abigail for the extremely quick response.  Re 
Abigail's question, no, I didn't have make.ext in my DOS environment, 
but I do have Cygwin installed.  Running it in Cygwin got much, much 
farther, but it still failed in many horrible ways, deep inside the 
dependencies.  (I tried capturing the output to a file, but it just hung 
and the errors didn't make it to the output file.)

I did do what Sinan suggested, and html2wiki is working now!  (as I 
said, I'm pretty much a Perl neophyte.)  So thanks again.

Interestingly enough, I've also got Fedora Core 3 on another machine, 
and on that one, once I su'ed to root, the install worked the first time.

Bob


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

Date: 27 Sep 2005 20:04:39 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: FAQ .
Message-Id: <Xns96DE9B1DFD0B7ebohlmanomsdevcom@130.133.1.4>

Zeno <zeno@lastone.com> wrote in news:s4qij15n4ecehkhg7k43rbtopm2l37sa3k@
4ax.com:

> It would be far more useful for me to get 1 large FAQ - rather
> than countless small ones.

An important reason for posting the FAQs individually is that it encourages 
discussion of them, which often leads to their improvement.  For reference 
purposes, you have all the FAQs installed along with perl.


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

Date: Tue, 27 Sep 2005 20:40:17 GMT
From: axel@white-eagle.invalid.uk
Subject: Re: FAQ .
Message-Id: <R6i_e.5312$iW5.1237@fe3.news.blueyonder.co.uk>

Eric Bohlman <ebohlman@omsdev.com> wrote:
> Zeno <zeno@lastone.com> wrote in news:s4qij15n4ecehkhg7k43rbtopm2l37sa3k@
 
>> It would be far more useful for me to get 1 large FAQ - rather
>> than countless small ones.
 
> An important reason for posting the FAQs individually is that it encourages 
> discussion of them, which often leads to their improvement.  For reference 
> purposes, you have all the FAQs installed along with perl.

And for people like me with a memory like a leaky bucket, it reminds me of
things that have hidden themselves away somewhere in my grey matter.

Axel



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

Date: Tue, 27 Sep 2005 21:07:36 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Help - How do I install Perl (CPAN) on Windows ?
Message-Id: <3ptjjpFc8muoU1@individual.net>

Zeno wrote:
> I downloaded the ActiveState perl msi from: ActiveState (ver.
> 5.8.7). It installed. But now I find that I am, naturally,
> missing a load of CPAN modules.
> 
> I can find these things quite easily but how do I install them?
> 
> The instructions are simple, but unfortunately these
> instructions involve running either of these 2 command line
> options:
> 
> 	Perl -MCPAN -e shell
> or
> 	cpanp

Haven't you missed ppm?

http://ppm.activestate.com/PPMPackages/5.8-windows/

I think there is a simple command for downloading and installing those 
packages if you have installed ActiveState Perl. (I'm using IndigoPerl, 
with a slightly different interface to ActiveState's ppm.)

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


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

Date: Tue, 27 Sep 2005 22:40:12 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Help - How do I install Perl (CPAN) on Windows ?
Message-Id: <Xns96DEBDEC93C03asu1cornelledu@127.0.0.1>

Zeno <zeno@lastone.com> wrote in 
news:eg0jj1l5b08s52mo0heta9fnmfik44fhcs@4ax.com:

> Running:
>      Perl -MCPAN -e shell
> 
> begins an incomprehensible dialog. For instance, the program
> wants to know where my gzip, tar, make, lynx, wget, ncftpget,
> ncftp, gpg programs are, etc.  I don't even know what these
> things are let alone where they are.

Well, the first time you install CPAN.pm on a *nix system, you would 
still have to go through this dialog. So, I am not sure why that is 
incomprehesible.

This is all explained in 

http://search.cpan.org/~andk/CPAN-1.76/lib/CPAN.pm#CONFIGURATION

> Is there a simple set of instuctions for configuring Perl to
> install CPAN modules quickly and simply. 

As others have pointed out, ppm works fine in most cases.

> (with some meaningful documentation
> explaining what the options in the cofigurations file are for).

See the documentation for CPAN.pm.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

Date: Tue, 27 Sep 2005 12:49:30 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: How do I get more-detailed directory info?
Message-Id: <cKWdnXEJ8v_WP6TeRVn-jg@comcast.com>

Reinhard Pagitsch wrote:

>     my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
>        $atime,$mtime,$ctime,$blksize,$blocks) = stat($_);
>        my $FileRecord = {};
>        $FileRecord->{Date} = "Unknown";
>        $FileRecord->{Time} = $mtime;
>        $FileRecord->{Type} = $mode;
>        $FileRecord->{Size} = $size;
>        $FileRecord->{Attr} = "Unknown";
>        $FileRecord->{Name} = $_;
> 

You're Type is wrong: the low-order 12 bits are Mode, not Type.

	... = lstat($_);	# Must use lstat() for -l() to work
	$FileRecord->{AccessMode} = $mode & 0x0fff;	# 07777 octal
	my $type_code = ($mode & 0xf000) >> 12;
	$FileRecord->{Type} =
		-l _ ? 'Symlink' :
		-d _ ? 'Directory' :
		-f _ ? 'File' :
		-p _ ? 'NamedPipe' :
		-S _ ? 'UnixSocket' :
		-b _ ? 'BlockDev' :
		-c _ ? 'CharDev' :
		$type_code == 0x0d ? 'Door' :
		"Unknown($type_code)";

Perl does not know that Solaris has doors:
   solaris8# ls -ldF /var/run/*_door /etc/sysevent/*_door
Dr--r--r--   1 root    0 Apr  4  2002 /etc/sysevent/piclevent_door>
Drw-------   1 root    0 Apr  3  2002 /etc/sysevent/sysevent_door>
Dr--r--r--   1 root    0 Feb 21  2005 /var/run/picld_door>
drwxrwxrwt   2 root   69 Feb 22  2005 /var/run/rpc_door/
Drw-r--r--   1 root    0 Feb 22  2005 /var/run/syslog_door>

	-Joe


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

Date: Tue, 27 Sep 2005 13:07:10 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: print  @{1} versus print  @{11}
Message-Id: <M5WdnS7PP-fyO6TeRVn-sA@comcast.com>

Tad McClellan wrote:
> xhoster@gmail.com <xhoster@gmail.com> wrote:
>>>Now, what on earth is a "punctuation" array and why is "punctuation" in
>>>quotes?
>>
>>A punctuation array is an array whose name is composed of punctuation.  It
>>is in quotes because the other of perlop is notifying you that he is either
>>coining the term, or is using the term advisedly.
> 
> Perhaps the author quoted it because he had $^I in mind, which
> not strictly all punctuation characters.

Well, I consider tab (^I) and backspace (^H) as punctuation characters.

perl -le 'print +(ord($_)<32?ord($_):$_)," = $::" for sort keys %::'

	-Joe


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

Date: Tue, 27 Sep 2005 15:10:29 -0700
From: "Shabam" <chalupa@yomama-nospam.com>
Subject: Shell script
Message-Id: <SdKdnYTVYra5X6TeRVn-vA@adelphia.com>

Up to now I've been doing this manually via the command shell.  However I'm
sure I can automate this using a script with better results.  Can someone
show me how I can do this?

cp -pr /site/template/user /site/j/jason
cp -p /site/data/j/jason.dat /site/data/j/jason.dat; pico -w
/site/data/j/jason.dat

In pico I'm basically changing the first 3 lines, replacing the first line
with user "jason"s email, second with his name, and third with his zip code.

I'm trying to come up with a script that will take the username, email,
name, and zip code as arguments.  Once done it will perform the above steps
and be done.  Can someone perhaps help me with this?  I've dabbled in some
Perl, but mostly by editting what's already been made.  Thanks.




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

Date: Tue, 27 Sep 2005 18:22:34 -0400
From: Sherm Pendley <sherm@dot-app.org>
Subject: Re: Shell script
Message-Id: <m2fyrq6thx.fsf@Sherm-Pendleys-Computer.local>

"Shabam" <chalupa@yomama-nospam.com> writes:

> Up to now I've been doing this manually via the command shell.  However I'm
> sure I can automate this using a script with better results.  Can someone
> show me how I can do this?
>
> cp -pr /site/template/user /site/j/jason
> cp -p /site/data/j/jason.dat /site/data/j/jason.dat; pico -w
> /site/data/j/jason.dat
>
> In pico I'm basically changing the first 3 lines, replacing the first line
> with user "jason"s email, second with his name, and third with his zip code.
>
> I'm trying to come up with a script that will take the username, email,
> name, and zip code as arguments.  Once done it will perform the above steps
> and be done.  Can someone perhaps help me with this?

What have you tried so far? Give it your best shot, then post questions here
if you get stuck.

If you need some help learning the language and getting started, have a look
at <http://learn.perl.org>.

Followups trimmed - comp.lang.perl was deactivated years ago.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Tue, 27 Sep 2005 21:57:27 +0100
From: Henry Law <news@lawshouse.org>
Subject: Use of hash variables in module call - puzzling behaviour
Message-Id: <1127854648.22344.0@sabbath.news.uk.clara.net>

I have a piece of code that is to send mail using Mail::Internet from my 
Linux server (Perl 5.8.0).  It reads variables - the recipient, the 
outbound mail server and so on - from an XML file into a hash.

Using the variables in the hash causes errors in Mail::Internet; using 
equivalent variables from a hash created from data in the program does 
not cause the same error.  Odder still, the error doesn't occur at all 
when I run the same program under ActiveState Perl in Windows.

Can someone help?  Firstly I'm at a loss to understand why this might 
be; secondly I've run out of ideas for debugging the thing.

The program below simulates the reading of the XML through the use of 
__DATA__; it builds the Mail::Internet structures $header and $mail; it 
then executes the smtp send using first a structure built in the program 
itself ($G_server) and then the XML-derived structure ($g_server).  The 
program even checks that the corresponding elements in $g_server and 
$G_server are the same ...

----------- sample program ------------
#! /usr/bin/perl

use strict;
use warnings;

use Mail::Internet;
use Mail::Header;
use XML::Simple;

my @data = <DATA>;
my $xml = XMLin(join (' ',@data));

my %g_server;

$g_server{adminuser} = $xml -> {adminuser};
$g_server{smtpserver} = $xml -> {smtpserver};
$g_server{localuser} = $xml -> {localuser};

my %G_server = (localuser=>'nfb@neptune.lawshouse.org',
		adminuser=>'postmaster@lawshouse.org',
		smtpserver=>'smtp.bt.net');

my @message = ("Line 1\n","Line 2");

print ( $g_server{localuser} eq $G_server{localuser} ?
	"localuser same\n" : "localuser different\n");
print ( $g_server{adminuser} eq $G_server{adminuser} ?
	"adminuser same\n" : "adminuser different\n");
print ( $g_server{smtpserver} eq $G_server{smtpserver} ?
	"smtpserver same\n" : "smtpserver different\n");


my $header = Mail::Header->new( ["From:$g_server{localuser}",
		"Sender:$g_server{localuser}",
		"To:$g_server{adminuser}",
		"Subject:Testing"] );

my $mail =  Mail::Internet->new(Header=>$header,Body=>\@message);

my @recipients;

print "Sending with G_server variables\n";
@recipients = $mail->smtpsend(Host=>$G_server{smtpserver},
	MailFrom=>$G_server{localuser},
	To=>$G_server{adminuser});
print "Mail sent to @recipients\n";

print "Sending with g_server variables\n";
@recipients = $mail->smtpsend(Host=>$g_server{smtpserver},
	MailFrom=>$g_server{localuser},
	To=>$g_server{adminuser});
print "Mail sent to @recipients\n";
__DATA__
<nfbserver>
         <adminuser>postmaster@lawshouse.org</adminuser>
         <smtpserver>smtp.bt.net</smtpserver>
         <localuser>nfb@neptune.lawshouse.org</localuser>
</nfbserver>

----------------- output under Linux ----------------
[nfb@neptune nfb]$ ./tryit.pl
localuser same
adminuser same
smtpserver same
Sending with G_server variables
Mail sent to postmaster@lawshouse.org
Sending with g_server variables
Unrecognised line: postmaster@lawshouse.org at blib/lib/Mail/Internet.pm 
(autosplit into blib/lib/auto/Mail/Internet/smtpsend.al) line 616
---------------- ends ------------------

OK, I'm braced for someone finding a simple typo in my code ...


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

Date: Tue, 27 Sep 2005 22:34:39 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Use of hash variables in module call - puzzling behaviour
Message-Id: <Xns96DEBCFB7A186asu1cornelledu@127.0.0.1>

Henry Law <news@lawshouse.org> wrote in news:1127854648.22344.0
@sabbath.news.uk.clara.net:

> Can someone help?  Firstly I'm at a loss to understand why this might 
> be; secondly I've run out of ideas for debugging the thing.

 ...
> @recipients = $mail->smtpsend(Host=>$G_server{smtpserver},
>      MailFrom=>$G_server{localuser},
>      To=>$G_server{adminuser});

I can't see anything that is obviously wrong, and it would take me a 
little too much effort to test this (as I do not have access to an SMTP 
server that does not require SSL).

However, have you tried turning debug on?

@recipients = $mail->smtpsend(
   Host     => $G_server{smtpserver},
   MailFrom => $G_server{localuser},
   To       => $G_server{adminuser},
   Debug    => 1,
);

I am not sure if that would help.

The actual source of the message seems to Mail::Address.pm (line 122 in 
version 1.67).

I have access to a FreeBSD system (Mail::Address v.1.66) where I tried

asu1@recex:~ > cat m.pl
use strict;
use warnings;

use Data::Dumper;
use Mail::Address;

print Dumper (Mail::Address->parse('postmaster@lawshouse.org') );

__END__

asu1@recex:~ > perl m.pl
$VAR1 = bless( [
                 '',
                 'postmaster@lawshouse.org',
                 ''
               ], 'Mail::Address' );
asu1@recex:~ >

Maybe you can try the same script on your Linux system



-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

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


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