[16307] in Perl-Users-Digest
Perl-Users Digest, Issue: 3719 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 18 10:18:12 2000
Date: Tue, 18 Jul 2000 07:17:51 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963929871-v9-i3719@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 18 Jul 2000 Volume: 9 Number: 3719
Today's topics:
Need help with a regular expression (Philip P. Obbard)
Re: Need help with a regular expression (Cameron Kennedy)
Re: Need help with a regular expression (Greg Bacon)
Re: Need help with a regular expression (Samay)
Re: Need help with a regular expression (Ulrich Ackermann)
Re: Need help with a regular expression (Philip P. Obbard)
Re: Need help with a regular expression (Bart Lateur)
Re: need post/lwp example (Bill Webster)
Re: Net/Config.pm problem (Gerard Lanois)
Net::FTP error:Bad arg length for Socket::unpack_sockad (Yu Zhang)
Re: NEt::POP3 difficulties (Jonathan Stowe)
Re: NEt::POP3 difficulties (Gus)
Re: Net::Smtp problems (deno)
Re: Net::Smtp problems ()
Re: Net::Smtp problems (Jonathan Stowe)
Re: Net::Smtp problems (deno)
Re: Net::Smtp problems (Tony Curtis)
Re: Net::Smtp problems (jason)
Re: Net::Smtp problems (Jonathan Stowe)
Re: Net::Smtp problems (Abigail)
Re: Net::Smtp problems (Logan Shaw)
Re: Net::Smtp problems (Logan Shaw)
New beginner with execution problems (Stefan Jonsson)
Re: New beginner with execution problems (Brendon Caligari)
Re: New beginner with execution problems (Bungy Williams)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Jul 2000 18:30:07 GMT
From: pobbard@hotresponse.com.bbs@openbazaar.net (Philip P. Obbard)
Subject: Need help with a regular expression
Message-Id: <3bRLJV$V0S@openbazaar.net>
Hi all,
I've got a string that can look like this:
stuff&hr_id=55&pub_id=2121
or
somestuff&hr_id=125&pub_id=21290
or
otherstuff&hr_id=98336&pub_id=213
I'm trying to use a regex to pull out the value of hr_id. (Nope, I can't use
the CGI object here).
I'm trying the following:
$link = "otherstuff&hr_id=98336&pub_id=213";
if ($link =~ m/hr_id=(.*)[$|&]/) {
$hr_id = $1;
warn "we got an hr_id of $hr_id";
}
...but $hr_id keeps coming out as "98336&pub_id=213" or "125&pub_id=21290",
when it should be devoid of the "&pub_id=21290" nonsense.
Any ideas? Thanks in advance for any assistance.
--Philip
------------------------------
Date: 17 Jul 2000 18:40:03 GMT
From: kenned57@NoSpam.edu.bbs@openbazaar.net (Cameron Kennedy)
Subject: Re: Need help with a regular expression
Message-Id: <3bRLW3$VSJ@openbazaar.net>
In article <ziIc5.47696$MT.1573726@news-west.usenetserver.com>, "Philip P.
Obbard" <pobbard@hotresponse.com> wrote:
> Hi all,
>
> I've got a string that can look like this:
> stuff&hr_id=55&pub_id=2121
> Any ideas? Thanks in advance for any assistance.
>
($hr_id)=$link=~m/hr_id=(\d+)/;
Cameron
------------------------------
Date: 17 Jul 2000 18:50:02 GMT
From: gbacon@HiWAAY.net.bbs@openbazaar.net (Greg Bacon)
Subject: Re: Need help with a regular expression
Message-Id: <3bRLiQ$WXu@openbazaar.net>
In article <ziIc5.47696$MT.1573726@news-west.usenetserver.com>,
Philip P. Obbard <pobbard@hotresponse.com> wrote:
: I've got a string that can look like this:
: stuff&hr_id=55&pub_id=2121
: or
: somestuff&hr_id=125&pub_id=21290
: or
: otherstuff&hr_id=98336&pub_id=213
:
: I'm trying to use a regex to pull out the value of hr_id. (Nope, I can't use
: the CGI object here).
my %info;
for (split /&/, $str) {
if (/^(.+?)(?:=(.*))?$/) {
$info{$1} = ($2 || 0);
}
}
my $hr_id = $info{hr_id};
Greg
--
As an adolescent I aspired to lasting fame, I craved factual certainty, and
I thirsted for a meaningful vision of human life -- so I became a scientist.
This is like becoming an archbishop so you can meet girls.
-- Matt Cartmill
------------------------------
Date: 17 Jul 2000 18:50:03 GMT
From: samay1NOsaSPAM@hotmail.com.invalid.bbs@openbazaar.net (Samay)
Subject: Re: Need help with a regular expression
Message-Id: <3bRLiR$Wbx@openbazaar.net>
I suggest use .*? instead of .* in your regex..
Read more about regex..
the \d+ as suggested by different author is also a good and
better solution if your hr_id is always some integer number..
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: 17 Jul 2000 19:00:03 GMT
From: UlleAckermann@t-online.de.bbs@openbazaar.net (Ulrich Ackermann)
Subject: Re: Need help with a regular expression
Message-Id: <3bRM93$XHs@openbazaar.net>
"Philip P. Obbard" wrote:
>
> Hi all,
>
> I've got a string that can look like this:
> stuff&hr_id=55&pub_id=2121
> or
> somestuff&hr_id=125&pub_id=21290
> or
> otherstuff&hr_id=98336&pub_id=213
>
> I'm trying to use a regex to pull out the value of hr_id. (Nope, I can't use
> the CGI object here).
>
> I'm trying the following:
> $link = "otherstuff&hr_id=98336&pub_id=213";
>
> if ($link =~ m/hr_id=(.*)[$|&]/) {
> $hr_id = $1;
> warn "we got an hr_id of $hr_id";
> }
>
> ...but $hr_id keeps coming out as "98336&pub_id=213" or "125&pub_id=21290",
> when it should be devoid of the "&pub_id=21290" nonsense.
>
> Any ideas? Thanks in advance for any assistance.
This is because the * is greedy, that means it takes as much as it can.
The first try will let him go till the end. The $ in your [$|&] part
means, when mentioned as the last sign of the regex, the end of the
string. Well the regex is at the end of the string, so a match is found
(everything from the hr_id= until the end and that's it.
If there are only numbers following the hr_id= you can use
/hr_id=(\d*)/
If you need everything until the next & it may be better to use
/hr_id=([^&]*)/
For more detailed info:
perldoc regex or the book "Mastering regular Expressions" by Jeffrey E.
Friedl (a must).
HTH
Ulrich
PS: If the |-sign in your square brackets should mean 'or': just leave
it away.
------------------------------
Date: 17 Jul 2000 20:40:03 GMT
From: pobbard@hotresponse.com.bbs@openbazaar.net (Philip P. Obbard)
Subject: Re: Need help with a regular expression
Message-Id: <3bROc5$W4J@openbazaar.net>
Thanks everyone - talk about fast responses! I really appreciate it,
especially the added detail on why my original code wasn't working.
best regards,
Philip
------------------------------
Date: 17 Jul 2000 23:20:02 GMT
From: bart.lateur@skynet.be.bbs@openbazaar.net (Bart Lateur)
Subject: Re: Need help with a regular expression
Message-Id: <3bRSk2$SSN@openbazaar.net>
Philip P. Obbard wrote:
>if ($link =~ m/hr_id=(.*)[$|&]/) {
Apart from your main problem (".*" -> ".*?"), you should also replace
the "[$|&]" with "(?:$|&)".
--
Bart.
------------------------------
Date: 11 Jul 2000 16:30:03 GMT
From: billw@dal.asp.ti.com.bbs@openbazaar.net (Bill Webster)
Subject: Re: need post/lwp example
Message-Id: <3bMXDT$Y02@openbazaar.net>
Malcolm Dew-Jones wrote:
> Bill Webster (billw@dal.asp.ti.com) wrote:
> : Hello folks,
>
> : My goal is to fill out a form for a given URL which uses the POST
> : method,
> : without the use of a browser. I understand using LWP is a good way to
> : go.
> : Looking through LWPCOOK, I found:
>
> : #!/usr/bin/perl
> : use LWP::UserAgent;
> : $ua = LWP::UserAgent->new;
>
> : my $req = HTTP::Request->new(POST =>
> : 'http://www.perl.com/cgi-bin/BugGlimpse');
> : $req->content_type('application/x-www-form-urlencoded');
> : $req->content('match=www&errors=0');
>
> : my $res = $ua->request($req);
> : print $res->as_string;
>
> : ...well http://www.perl.com/cgi-bin/BugGlimpse no longer exists, so
> : its hard for me to
> : play with this example. I would like an example program that will work,
>
> : so I can make
> : sure I'm starting at the right point to debug my program ( which I think
>
> : my problems my name/value pairs...).
>
> : Can someone send me an example similar to the one above that will
> : work?
>
> I really think you should install your own web server to receive the POST
> data for this sort of testing. It's not very polite to be sending bogus
> requests to someone elses server when you're developing routines.
>
> You would have the added benefit of being able to check both ends of the
> connection to see what's really happening.
>
> Your URL would be something like
> 'http://localhost/cgi-bin/my_test_cgi.pl'
>
> and my_test_cgi.pl could be as simple as (untested)
>
> #!/usr/bin/sh
> echo 'new request received' >> /tmp/my_test_cgi.log
> date >> /tmp/my_test_cgi.log
> cat >> /tmp/my_test_cgi.log
>
> This just dumps the incoming POST data into a log file (make sure its
> writable by the cgi script running account) so you can examine it. You
> might also want to dump the environment variables. I forget how, but
> 'printenv', or 'set' probably work.
>
> Windows would be a bit different, but the idea is the same. Find a
> utility that copies its standard input into a file and run that as the cgi
> script. Perhaps its as easy as 'TYPE CON >> file 'in a batch file.
Hi Malcom,
Thanks for your help. My little novice-self is slowly catching on.
I started messing with my linux box at home last night not having
much idea of what you meant by, http://localhost. When I typed
that in my browser - it said "congratulations for having Apache
installed in your Red Hat machine ". Oh! I guess my machine can
act just like an apache server. If you want to give me one more little
nudge, I assume - somehow I can copy the program you wrote above
into the pathway you suggested ( ....cgi-bin/my_test_cgi.pl) which
will reside somewhere on my computer. I'm sure all this is in the
apache doc - but this is the idea, right? Then I can use LWP
stuff to try post calls.
Also, what about specific web pages with forms that use the POST
method out there that I want to access using the LWP. Is there a
way I can copy their cgi to my computer so that I can practice
my routines? I'm thinking probably not....since they're accessing their
own huge databases...etc...etc....
Thanks,
Bill Webster (billw@dal.asp.ti.com)
------------------------------
Date: 14 Jul 2000 23:10:01 GMT
From: gerard@NOSPAMlanois.com.bbs@openbazaar.net (Gerard Lanois)
Subject: Re: Net/Config.pm problem
Message-Id: <3bPC9Q$WPq@openbazaar.net>
Sean Lavelle wrote:
>
> Hi,
> I am trying to use Activestates perl to do somethings. One of
> the things I needed to do was to use Net::FTP. So i went out and
> installed libnet.ppd from Activestate. After entering in the
> information that Net/Config.pm wanted I tried to run my program (the
> only module it uses is Net::FTP). This is what I got:
>
> syntax error at D:/Perl/site/lib/Net/Config.pm line 70, near ">"
> Compilation failed in require at D:/Perl/site/lib/Net/FTP.pm line 21.
> BEGIN failed--compilation aborted at D:/Perl/site/lib/Net/FTP.pm line
> 21.
> Compilation failed in require at lg_updater.pl line 6.
> BEGIN failed--compilation aborted at lg_updater.pl line 6.
>
> This is what the auto generated last bit of config.pm look like:
>
> DATA>%NetConfig = (
Change this line in your Config.pm to look like this:
%NetConfig = (
That might fix the problem, but gosh knows what else is broken.
I think the "DATA>" is some template substitution crud that
found its way into the ActiveState distribution and/or .ppd file.
">" is usually considered evidence of cut and paste from HTML.
You are not the first person to experience this specific problem:
http://x53.deja.com/viewthread.xp?AN=616431672
A better approach would be to install libnet directly from CPAN
and forget about ActiveState. In my experience, the interactive
questions that the libnet installer asks you get confused with
the ppm shell prompt. Thus, personally I've always installed
libnet manually from the CPAN .tar.gz.
All you'll need to do that is a copy of nmake, which you can get
from Microsoft. My Perl page has a link and instructions on where
to get nmake and how to use it to install a module:
http://www.lanois.com/perl/
Good luck, and let us know how it works out for you.
-Gerard
http://www.lanois.com/perl/
> ftp_int_passive => '0',
> snpp_hosts => [],
> inet_domain => 'mydomain.com',
> test_exist => '1',
> daytime_hosts => [],
> ph_hosts => [],
> time_hosts => [],
> smtp_hosts => [],
> ftp_ext_passive => '0',
> ftp_firewall => undef,
> test_hosts => '0',
> nntp_hosts => ['news.mydomain.com'],
> pop3_hosts => ['pop.mydomain.com'],
> );
> 1;
>
> I have no idea what's going on. I have even tried to install libnet
> without filling in this info and it crashes. If anybody could help I
> would really appreciate it.
>
> Sean
>
> slavelle@concentus-tech.com
------------------------------
Date: 14 Jul 2000 14:10:02 GMT
From: zhangy@yuma.Princeton.EDU.bbs@openbazaar.net (Yu Zhang)
Subject: Net::FTP error:Bad arg length for Socket::unpack_sockaddr_in
Message-Id: <3bOk6U$YHs@openbazaar.net>
Hi folks,
I wrote a simple script using Net::FTP to download bunch of files,
each time after processing several hundred of them, the script
stops and prints
"Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16
at /usr/lib/perl5/5.00503/i386-linux/Socket.pm line
295, <FILE> chunk 1130."
Anyone has an idea what the message means and how to get round of it?
The script is as follows:
#!/usr/bin/perl
#Script for extracting latitude and longitude of each 7.5dem
use Shell;
use Net::FTP;
open(FILE0, ">7.5dem_list.d")||die;
print "Connecting to edcftp\n";
$ftp = Net::FTP->new("edcftp.cr.usgs.gov")||die;
$ftp->login("anonymous","zhangy\@princeton.edu")||die;
$ftp->cwd("/pub/data/DEM/7.5min/");
@a=$ftp->ls("*");
foreach $a(@a){
if($a=~/^\D/ && !($a=~/^n/)){
print $a,"\n";
$ftp->cwd("/pub/data/DEM/7.5min/$a/");
@dirs = $ftp->dir ();
print "/pub/data/DEM/7.5min/$a/\n";
$count=0;
foreach $dir(@dirs){
if($count>2 && $dir=~/^(drw)/){
@dirnew = split(/\s+/,$dir);
$dir = $dirnew[8];
$ftp->cwd("/pub/data/DEM/7.5min/$a/$dir/");
if(@files = $ftp->ls("*.gz")){
print $dir," $files[0]\n";
$ftp->get($files[0]);
wait();
# print ""gunzip -cd $files[0] | /bin/tar xBf - ";
system("gunzip -cd $files[0] | /bin/tar xBf - ");
$demid = `ls *IDEN.DDF`;
chomp($demid);
$data = `cat $demid`;
@dummi =split(/\:{2}/,$data);
$lat = $dummi[1];
$lon = $dummi[2];
$lat =~s/LONG//g;
$lon =~s/SCALE//g;
print "$dir $lat $lon\n";
print FILE0 "$dir $lat $lon\n";
system("/bin/rm *DDF *gz");
}
}
$count++;
}
}
}
print "Disconnecting..\n";
$ftp->quit;
------------------------------
Date: 16 Jul 2000 18:10:06 GMT
From: gellyfish@gellyfish.com.bbs@openbazaar.net (Jonathan Stowe)
Subject: Re: NEt::POP3 difficulties
Message-Id: <3bQVIX$VWE@openbazaar.net>
In comp.lang.perl.misc Somebody Special <someone@msn.com> wrote:
>
> I am having some trouble accessing message content with Net::POP3
>
> I can get the correct number of messages with:
>
> my $pop = Net::POP3->new($server);
> my $numMsgs = $pop3->login($user,$pass);
Heres an example I prepared earlier :
#!/usr/bin/perl -w
use strict;
use Net::POP3;
use Mail::Internet;
use Mail::Header;
my $postoffice = Net::POP3->new('localhost') || die "No POP !\n";
my $no_mesgs = $postoffice->login('gellyfish','fru1tbat')
|| die "Cant login - @{[$postoffice->message]}\n";
#
# message() is a method of Net::Cmd from which Net::POP3 is derived
# and returns the last message received from the server - we will use
# it to give a diagnostic if anything goes wrong.
#
my $msg_list = $postoffice->list;
|| die "Cant list messages - @{[$postoffice->message]}\n";
#
# list() returns a hash whose keys are the undeleted msg numbers and the
# values are the sizes of the messages.
#
foreach my $msgnum (sort keys %{$msg_list} )
{
my $message = $postoffice->get($msgnum)
|| die "Cant get msg $msgnum - @{[$postoffice->message]}\n";
# get() returns a reference to an array of the lines of the message
# Create a new Mail::Internet object from the retrieved message
my $mail = Mail::Internet->new($message);
my $head = $mail->head; # A Mail::Header;
print "Mail from : ",$head->get('From'),
"Subject : ", $head->get('Subject'),"\n";
foreach my $body_line (@{$mail->body})
{
# do something with each line of the message
print $body_line;
}
}
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 17 Jul 2000 08:10:02 GMT
From: gus@black.hole-in-the.net.bbs@openbazaar.net (Gus)
Subject: Re: NEt::POP3 difficulties
Message-Id: <3bR5CQ$X5X@openbazaar.net>
In comp.lang.perl.modules Somebody Special <someone@msn.com> wrote:
> But when I try to dereference the result of
> my $msgList = $pop3->list();
> I cannot access the has table -- the documentation says that this is a
> reference to a hash table...
$pop = Net::POP3->new($host);
$num = $pop->login($user,$pass);
*msglist = $pop->list();
foreach $number (keys %msglist) {
print "Message number ", $number, " is ", $msglist{$number} , " bytes\n";
}
Regards,
_Gus
--
gus@black.hole-in-the.net
0x58E18C6D
82 AA 4D 7F D8 45 58 05 6D 1B 1A 72 1E DB 31 B5
http://black.hole-in-the.net/gus/
------------------------------
Date: 16 Jul 2000 14:00:03 GMT
From: jdNOjdSPAM@syncon.ie.invalid.bbs@openbazaar.net (deno)
Subject: Re: Net::Smtp problems
Message-Id: <3bQOg4$VS5@openbazaar.net>
See the original question which started the topic and you'll see
the script.
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: 16 Jul 2000 14:10:01 GMT
From: tony_barratt@my-deja.com.bbs@openbazaar.net ()
Subject: Re: Net::Smtp problems
Message-Id: <3bQP6P$WP_@openbazaar.net>
I had to resort to hitting the "previous in thread" hotlink to find out
the context. No big deal.
In article <em8c5.39271$fR2.354889@news1.rdc1.mi.home.com>,
clintp@geeksalad.org (Clinton A. Pierce) wrote:
> [posted and mailed]
>
> In article <30a7589c.55654d8e@usw-ex0105-036.remarq.com>,
> deno <jdNOjdSPAM@syncon.ie.invalid> writes:
> >
> > I have increased the timeout to limit. This script does not work
> > reliably connecting to 3 different mail hosts which are in the
> > same room (never mind the same network).
> >
> > The mail hosts are rock solid, hence the question. (Yes I have
> > tried another workstation also)
>
> Who are you? What do you want? Is this even a Perl question?
> Where's the Perl? What script? I see no script here. What's the
> question? There's no question here! What workstation?
>
> What in the name of bloody Hell are you talking about?
>
> Or are we expected to wade through the last few weeks of
> comp.lang.perl.misc looking for your (spam-blocked) e-mail address to
> try to reconstruct some earlier thread in which you may or may not
> have asked an intelligible question?
>
> --
> Clinton A. Pierce Teach Yourself Perl in 24 Hours!
> clintp@geeksalad.org for details see
http://www.geeksalad.org
> "If you rush a Miracle Man,
> you get rotten Miracles." --Miracle Max, The Princess Bride
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Jul 2000 18:10:05 GMT
From: gellyfish@gellyfish.com.bbs@openbazaar.net (Jonathan Stowe)
Subject: Re: Net::Smtp problems
Message-Id: <3bQVIV$Xne@openbazaar.net>
On Sat, 15 Jul 2000 17:34:15 -0700 deno wrote:
>
>
> Any1 had any problems with net::smtp ?
>
> the following only works 25% of the time
>
> use Net::SMTP;
>
> $smtp = Net::SMTP->new('192.168.0.99', Timeout => 30);
>
> print $smtp->banner,"\n";
> $smtp->quit;
>
>
You really do need to check the success of the call to new before
you carry on and try to use $smtp. You also will want to use the
Debug mode of Net::SMTP to determine what it was that went wrong.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 16 Jul 2000 19:20:06 GMT
From: jdNOjdSPAM@syncon.ie.invalid.bbs@openbazaar.net (deno)
Subject: Re: Net::Smtp problems
Message-Id: <3bQXA6$Tvi@openbazaar.net>
js>>You really do need to check the success of the call to new
js>>before you carry on and try to use $smtp. You also will want
js>>to use the Debug mode of Net::SMTP to determine what it was
js>>that went wrong.
use Net::SMTP;
$smtp = Net::SMTP->new('192.168.0.100', Timeout => 100);
print "smtp is $smtp";
print $smtp->banner,"\n";
$smtp->quit;
$smtp prints as "Net::SMTP=GLOB(0x1b3cd50"
Also none of the net:dns examples from the perldocs appear to
work on win 98, is this known problem?
Thanks,
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: 16 Jul 2000 21:20:07 GMT
From: tony_curtis32@yahoo.com.bbs@openbazaar.net (Tony Curtis)
Subject: Re: Net::Smtp problems
Message-Id: <3bQaG6$UPc@openbazaar.net>
>> On Sun, 16 Jul 2000 12:20:14 -0700,
>> deno <jdNOjdSPAM@syncon.ie.invalid> said:
js> You really do need to check the success of the call to
js> new before you carry on and try to use $smtp. You also
js> will want to use the Debug mode of Net::SMTP to
js> determine what it was that went wrong.
> use Net::SMTP;
> $smtp = Net::SMTP->new('192.168.0.100', Timeout => 100);
> print "smtp is $smtp"; print $smtp->banner,"\n";
> $smtp->quit;
> $smtp prints as "Net::SMTP=GLOB(0x1b3cd50"
The person you cited above, without naming them, suggested
using the Debug mode, which you haven't done. That, along
with testing the defined()ness of the new(), is probably
going to help pinpoint this problem.
> Also none of the net:dns examples from the perldocs
> appear to work on win 98, is this known problem?
Shouldn't think so. It sounds like your network is badly
setup if you're having all these problems with standard
network services.
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: 16 Jul 2000 22:40:02 GMT
From: elephant@squirrelgroup.com.bbs@openbazaar.net (jason)
Subject: Re: Net::Smtp problems
Message-Id: <3bQcK3$UKL@openbazaar.net>
deno wrote ..
>See the original question which started the topic and you'll see
>the script.
read up on how usenet works and you'll realise that not everyone will
necessarily HAVE the original question which started the topic
just include the relevant parts of what you're replying to and your
posts will be read and understood
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 17 Jul 2000 08:30:04 GMT
From: gellyfish@gellyfish.com.bbs@openbazaar.net (Jonathan Stowe)
Subject: Re: Net::Smtp problems
Message-Id: <3bR5bT$UKR@openbazaar.net>
On Sun, 16 Jul 2000 12:20:14 -0700 deno wrote:
>
> js>>You really do need to check the success of the call to new
> js>>before you carry on and try to use $smtp. You also will want
> js>>to use the Debug mode of Net::SMTP to determine what it was
> js>>that went wrong.
>
>
> use Net::SMTP;
>
> $smtp = Net::SMTP->new('192.168.0.100', Timeout => 100);
> print "smtp is $smtp";
> print $smtp->banner,"\n";
> $smtp->quit;
>
>
> $smtp prints as "Net::SMTP=GLOB(0x1b3cd50"
>
Er yes that is right. I'm not sure what you are saying here, that is what
should be in the variable. If your messages are not being delivered
you should be using the Debug mode as I said before, you should also be
checking that $smtp is defined befoe you attempt to use it :
if ($smtp = Net:SMTP->new('192.168.0.100', Timeout => 100, Debug => 1))
{
print $smtp->banner,"\n";
}
else
{
print "SMTP failed to connect\n";
}
The chances are that a failure to connect is not a Perl problem at all but
something wong with your mail server or your network.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 17 Jul 2000 20:00:10 GMT
From: abigail@delanet.com.bbs@openbazaar.net (Abigail)
Subject: Re: Net::Smtp problems
Message-Id: <3bRNaD$WDr@openbazaar.net>
deno (jdNOjdSPAM@syncon.ie.invalid) wrote on MMDXI September MCMXCIII in
<URL:news:0e990fca.4de9b34e@usw-ex0105-036.remarq.com>:
||
||
|| Any1 had any problems with net::smtp ?
||
|| the following only works 25% of the time
||
|| use Net::SMTP;
||
|| $smtp = Net::SMTP->new('192.168.0.99', Timeout => 30);
||
|| print $smtp->banner,"\n";
|| $smtp->quit;
||
||
|| when it fails it returns the following error
||
|| "Can't call method "banner" on an undefined value at banner.txt
|| line 8."
What do you think the value of $smtp is when the connection fails?
Never blindly assume connections are going to succeed.
Abigail
--
$"=$,;*{;qq{@{[(A..Z)[qq[0020191411140003]=~m[..]g]]}}}=*_=sub{print/::(.*)/};
$\=$/;q<Just another Perl Hacker>->();
------------------------------
Date: 17 Jul 2000 21:00:04 GMT
From: logan@cs.utexas.edu.bbs@openbazaar.net (Logan Shaw)
Subject: Re: Net::Smtp problems
Message-Id: <3bRPF5$Xvk@openbazaar.net>
In article <MPG.13dcd911e03686cb9896c3@news>,
jason <elephant@squirrelgroup.com> wrote:
>deno wrote ..
>>See the original question which started the topic and you'll see
>>the script.
>
>read up on how usenet works and you'll realise that not everyone will
>necessarily HAVE the original question which started the topic
Your news server doesn't keep articles for at least two days? If it
did, you'd have that article.
Of course, it helps to have a threaded newsreader so you can get to
that article easily...
- Logan
------------------------------
Date: 17 Jul 2000 23:00:01 GMT
From: logan@cs.utexas.edu.bbs@openbazaar.net (Logan Shaw)
Subject: Re: Net::Smtp problems
Message-Id: <3bRSL1$Vm8@openbazaar.net>
In article <8kuf05$b16$1@orpheus.gellyfish.com>,
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>The chances are that a failure to connect is not a Perl problem at all but
>something wong with your mail server or your network.
It's not necessarily something *wrong* with the mail server. The mail
server might be doing it on purpose in some cases.
("grep RefuseLA /etc/sendmail.cf".)
- Logan
------------------------------
Date: 16 Jul 2000 20:10:08 GMT
From: stefan.jonsson@chello.se.bbs@openbazaar.net (Stefan Jonsson)
Subject: New beginner with execution problems
Message-Id: <3bQYOW$Tbl@openbazaar.net>
Hi! I am a newbeginner on Perl programming. How do I execute an
Perlprogram - from the doswindow by writing "perl helloworld.pl" or how?
When I do this i get a message "wrong commando or filename".
I have installed the "Perl 5.6.0.616" - package on a Window 95 system and a
AMD K6 200 mhz processor. I downloaded InstMsi.exe (Installer 1.1) to make
it possible to install the "Perl 5.6.0.616" - package on to it, and the
installation procedure runned smoth. What am I doing wrong?
------------------------------
Date: 16 Jul 2000 21:40:11 GMT
From: bcaligari@shipreg.com.bbs@openbazaar.net (Brendon Caligari)
Subject: Re: New beginner with execution problems
Message-Id: <3bQafB$WzX@openbazaar.net>
"Stefan Jonsson" <stefan.jonsson@chello.se> wrote in message
news:2Hoc5.1180$u21.277042@nntp1.chello.se...
> Hi! I am a newbeginner on Perl programming. How do I execute an
> Perlprogram - from the doswindow by writing "perl helloworld.pl" or how?
> When I do this i get a message "wrong commando or filename".
> I have installed the "Perl 5.6.0.616" - package on a Window 95 system and
a
> AMD K6 200 mhz processor. I downloaded InstMsi.exe (Installer 1.1) to make
> it possible to install the "Perl 5.6.0.616" - package on to it, and the
> installation procedure runned smoth. What am I doing wrong?
>
>
616!!!! a week ago it was 615!!!...ah well :-(
check that perl.exe is in your path
if you followed the default installation it should be in c:\perl\bin
and said directory should be in your path
if not, add the following line to your autoexec.bat file
set PATH=%PATH%;c:\perl\bin
(and reboot)
if you have a perl program, say, runme.pl which you want to run
all you have to type is
perl runme.pl
Brendon
------------------------------
Date: 16 Jul 2000 22:40:01 GMT
From: gwbr23144@cableinet.co.uk.bbs@openbazaar.net (Bungy Williams)
Subject: Re: New beginner with execution problems
Message-Id: <3bQcK1$UCN@openbazaar.net>
Firstly, check that perl is in your path. In the dos window type:
perl -v
If perl is in your path you should get a screen of information giving the
version.
If you still get an error, you need to extend your PATH variable in you
autoexec.bat.
If you need any further help, let me know and I will send you an example of
an autoexec.bat
Bungy
Stefan Jonsson wrote:
> Hi! I am a newbeginner on Perl programming. How do I execute an
> Perlprogram - from the doswindow by writing "perl helloworld.pl" or how?
> When I do this i get a message "wrong commando or filename".
> I have installed the "Perl 5.6.0.616" - package on a Window 95 system and a
> AMD K6 200 mhz processor. I downloaded InstMsi.exe (Installer 1.1) to make
> it possible to install the "Perl 5.6.0.616" - package on to it, and the
> installation procedure runned smoth. What am I doing wrong?
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 3719
**************************************