[13577] in Perl-Users-Digest
Perl-Users Digest, Issue: 987 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 5 05:05:35 1999
Date: Tue, 5 Oct 1999 02:05:20 -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: <939114320-v9-i987@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 5 Oct 1999 Volume: 9 Number: 987
Today's topics:
Re: /foo/bar differs from /foo/bar? (Ilya Zakharevich)
Re: ActivePerl Implementation Problem (subs mysteriousl <wlkngowl@unix.asb.com>
Re: adding (summing) elements of an array (or hash) (Abigail)
Re: Bug with localtime() in Perl 5.004 and 5.005 <wlkngowl@unix.asb.com>
Re: DBD and DBI install question mr_potato_head@my-deja.com
Re: DBI/CGI Problem (cmd line works, but webserver fail (David Salgado)
Re: DBI/CGI Problem (cmd line works, but webserver fail (David Salgado)
Re: Email Attachments <homelessinseattle@yahoo.com>
Re: free testing (d.k. henderson)
Re: Getting variable contents from other files <JoelNelson@Home.net>
Re: Help: Permission Denied when trying to create a fi <nobody@newsfeeds.com>
Re: How to start up Netscape or Internet Explorer from <gellyfish@gellyfish.com>
I need a programmer to create gimp driven banner maker <dmuller@lcc.net>
Re: Knowing sizeof (int) inside a Perl program (Abigail)
Loking for a Yahoo-like Perl script (Perulinks)
Re: Net::SMTP <homelessinseattle@yahoo.com>
Re: Net::SMTP (Abigail)
Newbie question ! <WiseGuy_73@go.com>
Re: Newbie question: Ordering files by Modification tim <rick.delaney@home.com>
Re: Newbie question: Ordering files by Modification tim <uri@sysarch.com>
Re: Newbie question: Ordering files by Modification tim (Larry Rosler)
Re: Newbie: Combining split and shift on One Statement (I.J. Garlick)
Perl Debugger <gs_ananth@ti.com>
Re: Perl on OS/2, can't run it (Ilya Zakharevich)
Posting an article to a newsgroup using Perl <marcel@genamics.com>
Re: previous link (Abigail)
Re: regexp question - last occurrence of an expression (Larry Rosler)
Re: Setuid Question (Abigail)
Re: try to test perl off-line <kims@emmerce.com.au>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Oct 1999 05:22:05 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: /foo/bar differs from /foo/bar?
Message-Id: <7tc1tt$7qf$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Henry Sobotka
<sobotka@axess.com>],
who wrote in article <37F97F71.95857FD2@axess.com>:
> I'm trying to get the Mozilla version of LXR (mozilla/webtools/lxr)
> running on an OS/2 box. An opendir(DIR, $Path->{'real'})call is failing.
> Displaying the value of $Path->{'real'} shows "s:/lxr/javaprojects".
"Displaying" is a 4-letter word. Use 'x' command in debugger instead.
Ilya
------------------------------
Date: Tue, 05 Oct 1999 01:19:00 -0400
From: Robert Rothenburg <wlkngowl@unix.asb.com>
Subject: Re: ActivePerl Implementation Problem (subs mysteriously redefined)
Message-Id: <37F98A44.1DD0B8C1@unix.asb.com>
David Amann wrote:
>
> Hi all,
>
> In order to demo a web based application, I've been forced to move it to
> a Windows NT environment. I've installed ActivePerl and all of the
> various modules, but when I try to test my script from the command line
> I get a lot of the following errors:
>
> Screen.pm: Subroutine title redefined at ../cm-lib Screen.pm line 37.
Would the same subroutines be defined in c:\perl\lib, c:\perl\site\lib?
------------------------------
Date: 5 Oct 1999 01:17:46 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: adding (summing) elements of an array (or hash)
Message-Id: <slrn7vj6g0.dtc.abigail@alexandra.delanet.com>
Craig Berry (cberry@cinenet.net) wrote on MMCCXXV September MCMXCIII in
<URL:news:rvi07n12mom50@corp.supernews.com>:
\\
\\ Only two obvious ways I can think of doing it...
\\
\\ #!/usr/bin/perl -w
\\ # sumarray - benchmarks various ways to sum an array
\\ # Craig Berry (19991004)
\\
\\ use Benchmark;
\\
\\ my @values = ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
\\ my $sum;
\\
\\ timethese(10000, {
\\ 'foreach' => sub { $sum = 0; foreach (@values) { $sum += $_; } },
\\ 'eval' => sub { $sum = eval join ' + ', @values; }
\\ });
\\
\\
\\ Results, not surprisingly:
\\
\\ Benchmark: timing 10000 iterations of eval, foreach...
\\ eval: 66 secs (50.13 usr 0.01 sys = 50.14 cpu)
\\ foreach: 6 secs ( 5.39 usr 0.00 sys = 5.39 cpu)
\\
\\ Anybody else have an idea on how to beat 'foreach'?
'fast' => sub {55}
HTH. HAND.
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 05 Oct 1999 01:15:33 -0400
From: Robert Rothenburg <wlkngowl@unix.asb.com>
Subject: Re: Bug with localtime() in Perl 5.004 and 5.005
Message-Id: <37F98975.62F9E90A@unix.asb.com>
Thanks for the (obvious) reference to Daylight Savings. Forgot about
that....
Tom Briles wrote:
> Of course it's a feature.
>
> Before you make a fool out of yourself (again), try to test your code a
> bit more thoroughly. Keep in mind that there are alot of very
> high-level professionals using Perl, and this type of bug would be
> virtually impossible.
Testing more thoroughly wasn't the issue... just foolishly forgot
about DST. (Better to ask a foolish question on Usenet and get a smart
answer than use a dumb workaround.)
As for the the notion that a lot of high-level professionals using
something makes a stupid bug virtually impossible... well, that's
another topic for discussion/argument (which I'll take a virtual
raincheck on).
Thanks again.
------------------------------
Date: Tue, 05 Oct 1999 05:31:07 GMT
From: mr_potato_head@my-deja.com
Subject: Re: DBD and DBI install question
Message-Id: <7tc2er$9ok$1@nnrp1.deja.com>
I set the database to a known database on the system I was compiling the
DBD module. I'll try to get the stores database and recompile.
In article <7t8fqt$a1u$1@gellyfish.btinternet.com>,
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> In comp.lang.perl.misc mr_potato_head@my-deja.com wrote:
> > Hi,
> > I'm installing DBI and DBD on my system and I'm running into
install
> > problems. I want to install these into my /usr/local directory but
> > this directory is automounted to my NFS server. If I try to install
> > these modules to my NFS server, it doesn't have Informix. So I
decided
> > to install these modules to a machine that does have Informix 7.23
UC9
> > on it. I'm trying to install everything into /u/local and then I
was
> > going to copy all the files to the NFS server so I can use the DBI
and
> > DBD from other machines. I was successful in installing the DBI
module
> > in the /u/local directory and copying it over to my NFS server so
now I
> > can see it in /usr/local. But when I try to setup DBD I get errors.
> > To make it simple I just left DBD in the directory /u/DBD and ran
"perl
> > Makefile.PL". Then I ran "make", and then "make test" and got the
> > following:
> >
> > n30# make test
> > PERL_DL_NONLAZY=1 /usr/local/bin/perl -Iblib/arch -Iblib/lib -
> > I/usr/local/lib/perl5/5.00502/sun4-solaris
-I/usr/local/lib/perl5/5.00
> > 502 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0;
runtests
> > @ARGV;' t/*.t
> > t/t00basic..........DBI->connect failed: SQL: -329: Database not
found
> > or no system permission.
> > ISAM: -111: ISAM error: no record found.
> > at blib/lib/DBD/InformixTest.pm line 74
> > !! Terminating Test !!
> >
>
> You need to have the 'stores' database available when you do the make
test.
>
> You might need to rename 'stores7' to stores ...
>
> /J\
> --
> Jonathan Stowe <jns@gellyfish.com>
> <http://www.gellyfish.com>
> Hastings:
<URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 05 Oct 1999 08:56:59 GMT
From: david@connmed.co.nospam.uk (David Salgado)
Subject: Re: DBI/CGI Problem (cmd line works, but webserver fails to connect)
Message-Id: <37f9bbbd.2966745@news.demon.co.uk>
Thanks for replying.
On Mon, 04 Oct 1999 12:44:52 -0400, HHH <hartleh1@westat.com> wrote:
>I can think of two possibilities and there are almost certainly more.
>
>1. Try changing the file permissions so that everyone has full control
>over the mdb file. If that fixes things, you know it is a permissions
>problem and can work from there to get it set the way you want.
They already do (dangerous I know, but it's a small company of highly
IT-literate people).
>2. If MS Access is running and the file is open, this response is pretty
>likely. Make sure the file is not opened by anyone else when the Perl
>script tries to access it.
Well, although this will need to be the case for the live version, it
shouldn't be a problem, because the Access app. is split into a
front-end app. with linked tables to a backend mdb file. It's the
backend that I'm plugging into from the webserver (yes, I have tried
plugging into the front-end -- same problem). Concurrent access to the
backend shouldn't cause any problems.
Anyway, while I'm developing, I'm talking to a separate copy of the
backend database, which noone else is using, so it can't be that
either.
Thanks for the suggestions though.
David
------------------------------
Date: Tue, 05 Oct 1999 09:03:12 GMT
From: david@connmed.co.nospam.uk (David Salgado)
Subject: Re: DBI/CGI Problem (cmd line works, but webserver fails to connect)
Message-Id: <37fabd63.3388963@news.demon.co.uk>
Thanks for replying
On Mon, 04 Oct 1999 18:25:24 GMT, pyammine@my-deja.com wrote:
>Are you running IIS 4.0? Can you provide the code that you use to
>connect to the DB?
I am now -- installed it yesterday -- but I get exactly the same
problem. Here's the script (names changed to protect the guilty!).
Works fine from the command-line.
Cheers
David
#######################################
#!D:\perl\bin\perl.exe
use CGI qw/:standard/;
use DBI;
use strict;
my ($table, $dbh, $q);
my ($callout_date);
my $sortby;
my $pageURL = 'list_callouts.pl';
# Open DB connection.
$dbh = DBI->connect('dbi:ODBC:cmops', 'Username', 'Password');
# I've also tried specifying the user and password at the ODBC
# configuration stage, and leaving them blank here - no difference.
$sortby = param('sortby');
unless ($sortby) { $sortby = '[CalloutDate], [ClientName]'; };
$table = callout_table();
#print $q->header;
print "Content-Type: text/html\n";
##################################################
print <<EOF;
... HTML here document with $table in it somewhere.
EOF
##################################################
sub callout_table
{
my $strSQL = '';
my $sth;
my ($calloutid, $date, $status, $client, $engineer);
my $return = '';
$strSQL .= qq{SELECT [CalloutID], [CalloutDate], [ClientName],
[Engineer] FROM [qryCalloutDetails]};
$strSQL .= qq{ WHERE [CalloutStatus]='Open'};
$strSQL .= qq{ ORDER BY $sortby;};
$sth = $dbh->prepare($strSQL);
$sth->execute ||
die "Could not execute SQL statement ... maybe invalid?";
# Open the table.
$return .= "<table border=1 padding=2>\n";
... stuff to build an HTML table containing all the records I want --
not really relevant to this problem ...
$return .= "</table>\n";
return $return;
}
------------------------------
Date: Tue, 5 Oct 1999 04:05:05 -0500
From: "homeless" <homelessinseattle@yahoo.com>
Subject: Re: Email Attachments
Message-Id: <i6jK3.1672$V4.7760265@typhoon.stlnet.com>
Ian Bertie wrote in message <7ta5pd$ma9$1@lure.pipex.net>...
>
>I am trying to attach a file to a html form, but when I submit the form all
>that gets sent is the path to the file, and not the file itself. I cannot
>seem to get my email perl program to attach the file. Can anyone help.
>
>Thanks Ian.
Try something like this (sorry for the ugly html stuff):
#!/usr/bin/perl
# attachment_demo.pl
# by homeless
# Turn Off Buffering
$|=1;
# Use CGI to parse file upload method
use CGI qw (:all);
# path to directory where uploads will be stored
$rootpath="/wwwhomeless/uploaddata";
# Total maximum upload size in bytes
$maxfilelength=1500000;
print "content-type:text/html\n\n";
HTML_head();
if(param('delete'))
{
Delete(param('delete'));
}
if (param('a1'))
{
$error=Upload_And_Report(param('a1'));
}
Print_Empty("a1");
Report();
HTML_foot();
exit;
sub Print_Empty
{
my $name=shift;
print qq~
<INPUT TYPE="file" NAME="$name" SIZE=30>
<BR>
<INPUT TYPE="submit" VALUE="Attach File">
~;
}
sub HTML_head
{
print qq~
<html><head><title>ATTACHMENTS</title></head><body>
<table cellpadding=2 cellspacing=0 border=0 width=100%>
<tr><td bgcolor=#ff6666>
<B>ATTACHMENTS
</td></tr></table>
<FORM METHOD="POST" ENCTYPE="multipart/form-data">
<table cellpadding=2 cellspacing=0 border=0 width=100%>
<tr><td bgcolor=#ff9999>
<input type=button value="Finished" onclick="window.close()">
</td></tr></table>
<ol><li>Push Browse and select the file<Br> you want to attach.
<li>Click "Attach File".
<br>
NOTE: this can take a few minutes depending <Br>
on the speed of your internet connection <Br>
and the size of your file
<li>The total size of all attached files <Br>
can not exceed 1.5 Megabytes.</ol>
<BR>
~;
return 1;
}
sub HTML_foot
{
print qq~
<table cellpadding=2 cellspacing=0 border=0 width=100%>
<tr><td bgcolor=#ff6666>
<input type=button value="Finished" onclick="window.close()">
<input type=hidden name=username value="$formdata{'username'}">
<input type=hidden name=tempid value="$tempid">
</td></tr></table><p>
<center><font color=#000099>
COPYRIGHT ©1999 homeless in seattle<Br>
but you can use it too.</font></center>
</FORM>
</body>
</html>
~;
}
sub Report
{
dbmopen(%LOG,"$rootpath/dirinf1786324",0644);
foreach $key(keys %LOG)
if ($key=~m/totalbytes/){next;}
($name,$size)=split(/::/,$LOG{$key});
print qq~
<table cellpadding=2 cellspacing=0 border=1 width=100%>
<tr><td bgcolor=#ffcccc>
$name </td><td bgcolor=#ffcccc>$size bytes
</td><td bgcolor=#ffcccc><a href="attach.pl?delete=$key">
DEL
</a>
</td></tr></table>
~;
}
if ($LOG{'totalbytes'})
{
print qq~
<table cellpadding=2 cellspacing=0 border=1 width=100%>
<tr>
<td bgcolor=#ffcccc>
total bytes=$LOG{'totalbytes'}
</td>
</tr>
</table>
~;
}
dbmclose(%LOG);
}
sub Upload_And_Report
{
my $file=shift;
my $name="$file";
$name=~ s#^.*[\\\/](.*)#$1#;
$name=~tr/ /_/;
my $length=0;
dbmopen(%LOG,"$rootpath/dirinf1786324",0644);
$totalbytes=$LOG{'totalbytes'};
#==========Check if already uploaded Or too big========
if(-e "$rootpath/$name")
{
return("File already uploaded");
}
#=========Upload the file
open(OUT,">$rootpath/$name");
binmode(OUT);
while (read($file,$data,4096))
{
print OUT $data;
$length+=length($data);
$totalbytes+=length($data);
if($totalbytes>$maxfilelength)
{
close(OUT);unlink("$rootpath\\$name");
return("File too large");
}
}
close(OUT);
#=======LOG Info in DBM
$LOG{'totalbytes'}=$totalbytes;
$LOG{$name}="$file\::$length";
#===========Return nothing if everything is cool.
dbmclose(%LOG);
return("Upload of $name Successful");
}
sub Delete
{
my $file=shift;
dbmopen(%LOG,"$rootpath/dirinf1786324",0644);
delete $LOG{$file};
my $size=(-s "$rootpath/$file");
unlink("$rootpath/$file");
$LOG{'totalbytes'}-=$size;
print "$file unattached<br>";
dbmclose(%LOG);
}
#===========End Example
--homeless
------------------------------
Date: Tue, 05 Oct 1999 06:45:50 GMT
From: dalekh@hotmail.com (d.k. henderson)
Subject: Re: free testing
Message-Id: <8E551C8C0dkhenderson@207.14.236.171>
You can get an account at www.virtualave.net and upload your script to test
it.
------------------------------
Date: Tue, 05 Oct 1999 05:14:53 GMT
From: Joel Nelson <JoelNelson@Home.net>
Subject: Re: Getting variable contents from other files
Message-Id: <37F98987.3B0A8422@Home.net>
Try this:
# Start of .kayrc file
$NODE_DIR = "/home/karah";
1
# End of .kayrc file
# Start of of kay.pl
#!/usr/bin/perl
require ".kayrc";
....more stuff
# End of kay.pl
Note the "1" at the bottom of the required file!!! :)
arahkay@my-deja.com wrote:
> Help!
>
> I want to use the contents of certain assigned
> variables in my perl program.
>
> For example,
>
> If I have a .kayrc file (written in perl) that
> assigns $NODE_DIR = "/home/karah";
> How do I grap the value of $NODE_DIR for the file
> kay.pl.
>
> I thought maybe a use statement would be appropriate,
> instead of doing an open, reading contents into an
> array and then doing a grep.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Tue, 5 Oct 1999 09:44:04 +0100
From: Anonymous <nobody@newsfeeds.com>
Subject: Re: Help: Permission Denied when trying to create a file for output
Message-Id: <37f9bc31.0@tahiti.alcom.co.uk>
Have tried excute permissions, makes no difference. :-(
David Efflandt <efflandt@xnet.com> wrote in message
news:slrn7vik79.a5.efflandt@efflandt.xnet.com...
> On Mon, 4 Oct 1999 14:18:49 +0100, Anonymous <nobody@newsfeeds.com> wrote:
> >Could someone tell me how to write data to a text file that is not in my
> >cgi-bin directory?
> >
> >The "settings" dir has the permissions set to 766. What else do I need
to
> >do?
>
> You need execute dir permission to create a file. Since you are 'nobody'
> try 747. Of course then any other CGI on your system can write to your
> files if they are also 'nobody'.
>
> --
> David Efflandt efflandt@xnet.com http://www.xnet.com/~efflandt/
> http://www.de-srv.com http://cgi-help.virutalave.net/
> http://thunder.prohosting.com/~cv-elgin/
--------== Posted Anonymously via Newsfeeds.Com ==-------
Featuring the worlds only Anonymous Usenet Server
-----------== http://www.newsfeeds.com ==----------
------------------------------
Date: 5 Oct 1999 09:55:17 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to start up Netscape or Internet Explorer from a Perl script
Message-Id: <37f9bcf5_2@newsread3.dircon.co.uk>
Nim Chu <nimchu@hal-pc.org> wrote:
> Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>
>>On Sun, 03 Oct 1999 12:48:51 GMT Nim Chu wrote:
>>> I have a need to start up a Netscape or Internet Explorer browser
>>> session from a Perl script and give it the an URL and goes to a web
>>> page. The script later will send another URL and ask the browser to
>>> display the page. I appreciate any help.
>>>
>
>>You could use the module Win32::OLE if of course you are on windows ...
>
>
> Where to get info about using Win32::OLE?
>
You might want to see :
<http://msdn.microsoft.com/workshop/browser/webbrowser/reference/Objects/InternetExplorer.asp>
In concert with the documentation for Win32::OLE that comes with the
ActiveState distribution of Perl.
A quick example:
#!/usr/bin/perl -w
use Win32::OLE;
use strict;
my $browser = Win32::OLE->new('InternetExplorer.Application') or die "Aiee \n";
$browser->Navigate('http://www.gellyfish.com',1,'_BLANK');
/J\
--
"It's times like this I wish I had a penis" - Duckman
------------------------------
Date: Tue, 5 Oct 1999 01:47:14 -0000
From: "Don Muller" <dmuller@lcc.net>
Subject: I need a programmer to create gimp driven banner maker
Message-Id: <7tc6kd$bmq@atlas.lcc.net>
This is a multi-part message in MIME format.
------=_NextPart_000_0034_01BF0ED3.8C7AA740
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello,=20
I am looking for someone to create a gimp driven banner maker for online =
website use. This could be a pay job, or , if you are good at such =
things, a % in the biz.
e-mail me your contact information
Thanks
jim@minister.com
------=_NextPart_000_0034_01BF0ED3.8C7AA740
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hello, </FONT></DIV>
<DIV> </DIV>
<DIV>I am looking for someone to create a gimp driven banner maker for =
online=20
website use. This could be a pay job, or , if you are good at such =
things, a %=20
in the biz.</DIV>
<DIV> </DIV>
<DIV>e-mail me your contact information</DIV>
<DIV> </DIV>
<DIV>Thanks</DIV>
<DIV> </DIV>
<DIV><A =
href=3D"mailto:jim@minister.com">jim@minister.com</A></DIV></BODY></HTML>=
------=_NextPart_000_0034_01BF0ED3.8C7AA740--
------------------------------
Date: 5 Oct 1999 00:05:22 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Knowing sizeof (int) inside a Perl program
Message-Id: <slrn7vj28b.dtc.abigail@alexandra.delanet.com>
Makarand Kulkarni (makkulka@cisco.com) wrote on MMCCXXV September
MCMXCIII in <URL:news:37F9263A.8644F5FA@cisco.com>:
::
:: I am writing a configuration script and I need to know
:: the value of sizeof(int), sizeof(char) etc inside
:: my perl program. What is the easiest way to do this.
Use C.
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 05 Oct 1999 06:35:39 GMT
From: perulinks@aol.com (Perulinks)
Subject: Loking for a Yahoo-like Perl script
Message-Id: <19991005023539.22455.00001031@ng-fa1.aol.com>
Hello there,
I am looking for a Perl scripts that works as a search engine and directory.
It must remove dead links authomatically. Does anybody know where I can look
for? I would appreciate any help. Thanks
Carlos M. Chapa
perulinks@aol.com
------------------------------
Date: Tue, 5 Oct 1999 02:29:22 -0500
From: "homeless" <homelessinseattle@yahoo.com>
Subject: Re: Net::SMTP
Message-Id: <yIhK3.1670$V4.7717007@typhoon.stlnet.com>
nigh_postal wrote in message <7tb3tf$k3h$1@nnrp1.deja.com>...
>I'm trying to write a bulk email program using the Net::SMTP module and
>I'm running into some problems. I've showed my code to various people,
>and they all say it looks right. What I need help with is determining
>what my be causing it to fail. I've posted the code below. Assume
>that @email_addr contains the list of emails to send to.
>
>For obvious reasons, I've replace the mail server address with a bogus
>one.
>
> $smtp = Net::SMTP->new('mailserver');
> $smtp->mail('foo');
> $smtp->to(@email_addr);
> $smtp->data();
> $smtp->datasend("From: $email_from\n");
> $smtp->datasend("Date: $email_date\n");
> $smtp->datasend("To: Blah\n");
> $smtp->datasend("Subject: $email_subject\n\n");
> $smtp->datasend("$TxtToSend\n\n");
> $smtp->dataend();
> $smtp->quit;
>
>Now the thing is, I am on this list about 1/4 of the way up (about 130
>on the list), and everytime the cgi runs I get the email. But we are
>getting complaints that some aren't recieving it. So somewhere along
>the line the process is failing. I've tried sending it in chunks of 50
>and even 20 but still no luck. If anybody knows why this code might
>not be working, please let me know.
You should, of course, check the validity of the email list you are
providing.
If, for instance, one of your addresses is missing a qoute, like:
"Big Bad Bubba <bubba@big.bad.com>,
then it'll flub up a gabunch of other addresses.
Also, if you are accessing a remote SMTP server that does not allow
relaying from the server the script is running on, then only those email
addresses
that are hosted on the SMTP server will be delivered.
--homeless
P.S. If you get desparate, let me know, I do lots of low level pop3 and
smtp stuff and would
be happy to lend a hand.
------------------------------
Date: 5 Oct 1999 03:23:37 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Net::SMTP
Message-Id: <slrn7vjds2.dtc.abigail@alexandra.delanet.com>
homeless (homelessinseattle@yahoo.com) wrote on MMCCXXVI September
MCMXCIII in <URL:news:yIhK3.1670$V4.7717007@typhoon.stlnet.com>:
..
.. You should, of course, check the validity of the email list you are
.. providing.
.. If, for instance, one of your addresses is missing a qoute, like:
.. "Big Bad Bubba <bubba@big.bad.com>,
use RFC::RFC822::Address qw /valid/;
$addr = q {"Big Bad Bubba <bubba@big.bad.com>};
if (valid $addr) {
...
}
else {
warn "$addr is not valid\n";
}
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 05 Oct 1999 08:13:36 GMT
From: Wise Guy <WiseGuy_73@go.com>
Subject: Newbie question !
Message-Id: <7tcbva$gi6$1@nnrp1.deja.com>
Hi !
I am pretty new to perl and would like some help. In Benchmark, what is
the "iterations" ? From basic definition, I understand it is a loop.
Why do I need iterations - can I not make do with only one iteration ?
Or is it that the more the number of iterations, the more accurate is
the result ?
Pls excuse me for the simple nature of the question - like I said
before, I am still learning.
Many thanks for all your help.
Regards !
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 05 Oct 1999 05:22:28 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Newbie question: Ordering files by Modification time
Message-Id: <37F98ACE.DE15D469@home.com>
[posted & mailed]
Uri Guttman wrote:
>
> i am gladdened to see our method infecting the perl community like a
> virus. we still need a catchy name so if you like it, post or send a
> suggestion.
The Guzzler (GUTtman-roSLER sort). Don't think of this as meaning it's
not fuel efficient but rather as guzzling the sort keys to deliver
Ferrari-type performance.
Well... it's better than GRP. ;-)
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: 05 Oct 1999 01:23:23 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Newbie question: Ordering files by Modification time
Message-Id: <x7wvt2s7n8.fsf@home.sysarch.com>
>>>>> "MV" == Martien Verbruggen <mgjv@comdyn.com.au> writes:
MV> I know. I do use pack, now and again, but I try to stay away from it.
MV> It's just never clear to me immediately what's going on when I see a
MV> pack string or unpack string. I don't mind being close to 'the dirty
MV> underside of c data', not at all. I mind not being able to map pack
MV> strings in my brain to something meaningful. Maybe all I need to do is
MV> sit down, and write a few pack strings for some of the C structs that
MV> I have sitting around in various files on disk. Maybe all I need is
MV> practice.
MV> But I still don't like them. Yet.
just do more of our sorts and you will see the light!
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Mon, 4 Oct 1999 22:48:14 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Newbie question: Ordering files by Modification time
Message-Id: <MPG.126330f4d7f690bc98a036@nntp.hpl.hp.com>
In article <8UdK3.134$xs2.5413@nsw.nnrp.telstra.net> on Tue, 05 Oct 1999
03:03:32 GMT, Martien Verbruggen <mgjv@comdyn.com.au> says...
...
> my $dir = '..';
> opendir(DIR, $dir) or die "Cannot opendir $dir: $!";
> my @s_list =
> map { $_-> [0] } # Get rid of mtime part
> sort { $a->[1] <=> $b->[1] } # Sort on mtime
> map { [ $_, (stat "$dir/$_")[9] ] } # Get mtime, and store in anon
> # array reference.
> grep { -f "$dir/$_" } # Only 'plain' files
> readdir(DIR);
...
> There may be more efficient methods, but this one limits the number of
> stats per file to one by using a map, instead of doing a stat inside
> the sort function, which I have seen suggested in the past :).
Small correction/improvement: There are actually two stats per file in
the above code -- one in the grep, the other in the map. They could be
reduced to one by moving the '-f' filter into the map:
map { -f "$dir/$_" ? [ $_, (stat _)[9] ] : () } ...
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 5 Oct 1999 07:57:51 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: Newbie: Combining split and shift on One Statement
Message-Id: <FJ4E4G.Cvt@csc.liv.ac.uk>
In article <mfleming-0410991155460001@cserv51.csubak.edu>,
mfleming@csub.edu (Michael W. Fleming) writes:
> I have the following situation:
>
> $x = " abc xxx";
> @stuff = split(/\s+/,$x);
> shift(@stuff);
>
> I have tried all manner of non-working attempts at combining the
> functionality of the split and shift into one statement. I have tried a
...[snipped irrelevant explanation]
>
> How might I accomplish this?
Simple answer you don't.
You are travelling ten times around the world to accomplish strolling down
to the corner shop, do you have a really valid reason for doing this?
As far as I can tell the only reason you are doing this is because the
split gives you a '' value in $stuff[0]
So why not simply remove the leading white space before the split? radical
concept I know but you'll get the hang of it.
$x =~ s/^\s+//;
Then there is no need for the shift hack/cock-up you were trying to come
up with.
--
Ian J. Garlick
ijg@csc.liv.ac.uk
You probably wouldn't worry about what people think of you if you could
know how seldom they do.
-- Olin Miller.
------------------------------
Date: 05 Oct 1999 10:49:16 +0530
From: "G.Ananth Somayaji" <gs_ananth@ti.com>
Subject: Perl Debugger
Message-Id: <rf5905i4c6j.fsf@ti.com>
Hello,
Is there any way I can emulate tcsh inside the perl debugger. What I would like specifically is something like history,inteligent completion etc.
Thanks in advance
Ananth
--
_ _____________________________________ _
/ )| G. Ananth Somayaji |( \
/ / | Texas Instruments (India) | \ \
_( (_ | Ph : 5099126 email:gs_ananth@ti.com | _) )_
(((\ \>|_/ )_____________________________( \_|</ /)))
(\\\\ \_/ /Intelligence is like underwear,\ \_/ ////)
\ / everyone should have it, \ /
\ _/ but we shouldn't show it off. \_ /
/ / \ \
------------------------------
Date: 5 Oct 1999 05:27:36 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl on OS/2, can't run it
Message-Id: <7tc288$7rj$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to peter karlsson
<dat95pkn@mds.mdh.se>],
who wrote in article <slrn7vi7ai.d35.pk@dat95pkn.campus.mdh.se>:
> I downloaded Perl 5.005_53 for OS/2 from www.perl.com, but can't get it to
> run correctly. I used the GUI installer, and it finished correctly (except
> that I skipped installing its sh.exe, since I already had a sh.exe pointing
> to bash.exe in that directory).
Then you need to install it manually. Otherwise globs will not work
(with bash).
> However, after the required reboot, I can't get it to run. It answers almost
> everything I do with "Malformed PERLLIB_PREFIX". It is set to
> "E:/APP/PERLLIB/LIB", which is where I installed it. I had it set to
> "E:\APP\PERLLIB\LIB" (which was what the installation program set it to),
I doubt it very much. Anyway, if
view perl PERLLIB_PREFIX
does not answer your concerns, call again.
Ilya
------------------------------
Date: Tue, 5 Oct 1999 20:32:52 +1300
From: "Marcel Dinger" <marcel@genamics.com>
Subject: Posting an article to a newsgroup using Perl
Message-Id: <939108691.183142@ham.ihug.co.nz>
I am writing a cgi/perl script to allow a user to post a message to a newsgroup
through an HTML form.
How do I post an article to a newsgroup using Perl? I have looked at the module
News::Article which appears to provide this function, but could not see how to
implement it without the luxury of an example file.
Thanks in advance.
Marcel Dinger.
------------------------------
Date: 5 Oct 1999 01:36:39 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: previous link
Message-Id: <slrn7vj7jg.dtc.abigail@alexandra.delanet.com>
ICEMOUNTAIN@prodigy.net (ICEMOUNTAIN@prodigy.net) wrote on MMCCXXV
September MCMXCIII in <URL:news:7tb7uj$2bnc$1@newssvr04-int.news.prodigy.com>:
;; I made a script to display a camaro gallery. Everything works perfectly
;; except the previous link, It is there but It is always there even when there
;; isn't anything before it to see.
Well, don't make a previous link when there's nothing to see.
It's a simple matter of *not* printing.
;; print "<a
;; href=http://www.3gc.net/cgi-bin/scripts/backup/gallerytest.cgi?action=desc&m
;; odel=$model&year=$year&numb=$numb><img
^^^^^
That of course, is invalid.
;; odel=$model&year=$year&numb=$numb>19$year $FORM{'model'}</a></td></tr>\n";
^^^^^^^
Urg.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 4 Oct 1999 22:01:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: regexp question - last occurrence of an expression before another
Message-Id: <MPG.12632613c07f972798a035@nntp.hpl.hp.com>
In article <slrn7vieri.o01.gerry@xmission.xmission.com> on 4 Oct 1999
23:42:43 GMT, Gerry JJ Dyn-O-Myte Walker <gerry@xmission.com> says...
> How do I extract the last occurrence of an expression occurring before
> another expression. For example in the following string:
... (reproduced below)
> I want to to extract only the last bold item (which is "text" in this
> example) which occurs before the list <ul>.*<\/ul>
#!/usr/local/bin/perl -w
use strict;
$_ = 'A <b> lot </b> of <b> html </b> text, some of it in <b> bold </b>. I
want to extract the last <b> bold </b> section of <b> text </b> prior
to a list of items - <ul> <li> item one </ul> - maybe more <b> bold </b>
still.';
m%.*<b>\s*(.*?)\s*</b>.*<ul>%s and print "|$1|\n";
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 5 Oct 1999 01:44:09 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Setuid Question
Message-Id: <slrn7vj81i.dtc.abigail@alexandra.delanet.com>
Dale Bohl (dbohl@sgi.com) wrote on MMCCXXV September MCMXCIII in
<URL:news:37F90EEF.2944C4A1@sgi.com>:
!!
!! Does anyone know how to use Perl to
!! traverse a file tree to find all setuid root
!! executables on UNIX?
@files = `find / -perm -4000 -uid 0`;
Abigail
--
split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_) {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 5 Oct 1999 16:13:05 +1000
From: "Kim Saunders" <kims@emmerce.com.au>
Subject: Re: try to test perl off-line
Message-Id: <939104023.10252@draal.apex.net.au>
Go to www.perl.com and download and install the perl of your choice.
TinyWeb is an *excellent* webserver for testing on a box, it's like 60k,
easy to config, etc. (does CGI of course) Excellent.
KimS
------------------------------
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 987
*************************************