[17747] in Perl-Users-Digest
Perl-Users Digest, Issue: 5167 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 21 03:05:41 2000
Date: Thu, 21 Dec 2000 00:05:14 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <977385913-v9-i5167@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 21 Dec 2000 Volume: 9 Number: 5167
Today's topics:
Re: "use" inside a subroutine bdesany@my-deja.com
Re: Arguments to perlscript in DOS-promt <nathanw@optimus-corp.com>
Re: ASP and Perlscript Socket Checking?! <nathanw@optimus-corp.com>
automatic FAQ answerer idea (Logan Shaw)
Re: automatic FAQ answerer idea <uri@sysarch.com>
Re: automatic FAQ answerer idea (Logan Shaw)
Re: bug in open() <joe+usenet@sunstarsys.com>
Re: bug in open() <krahnj@acm.org>
CGI.pm error output set_message() [was: Re: Anything wr <nospam@nospam.com>
Re: Convert YM to YMD Where D Is Last D of M Using Date <monty@primenet.com>
CPAN upgrade -> perl virus <danny@lennon.postino.com>
Re: CPAN upgrade -> perl virus (Chris Fedde)
Re: File::Find - meaning of 'symlinks'? (Philip Lees)
help! "Bad file number" error <djodrell00@home.com>
Re: help! "Bad file number" error (Garry Williams)
Re: how to invalidate a hash value during a foreach loo (Philip Lees)
Re: perl DBI <nospam@nospam.com>
Perl newbie question <lielar@my-deja.com>
Re: Perl newbie question <lielar@my-deja.com>
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi (Tad McClellan)
Re: qmail-inject (Tad McClellan)
Re: Rename File in Win32 Environment (Garry Williams)
Re: Rename File in Win32 Environment (Garry Williams)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 21 Dec 2000 05:14:20 GMT
From: bdesany@my-deja.com
Subject: Re: "use" inside a subroutine
Message-Id: <91s3j9$dm1$1@nnrp1.deja.com>
> Did you know deja.com has a Usenet search engine? This is not the
> first thread on this subject. It's not even the first this week.
> Actually I doubt it's even the second.
Yes. Too bad my limited vocabulary apparently wasn't up to recognizing
these threads for what they were when I must have observed them during
my use of the search engine.
>
> perldoc AutoLoader
Thanks for this pointer (I had no idea what I was doing was related to
AutoLoader).
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 21 Dec 2000 04:27:47 GMT
From: nate <nathanw@optimus-corp.com>
Subject: Re: Arguments to perlscript in DOS-promt
Message-Id: <nathanw-A29D4C.14282920122000@news>
In article <3A30FF29.9A1E37CD@nowhereatall.com>, mothra
<mothra@nowhereatall.com> wrote:
> Søren Christian Rix wrote:
>
> > Hi,
> >
> > I need to pass an argument to a perlscript (5.05 win32) in a DOS-promt.
> >
> > What is the DOS-promt-syntax for that, and how do I address the
> > argument in
> > the script?
> >
>
> perldoc perlvar and look for @ARGV
>
> >
> > When I type this in the DOS-promt:
> > perl D:\Inetpub\wwwroot\test.pl > D:\Inetpub\wwwroot\output.txt
> >
> > (and test.pl looks like this)
> > open(FILE, "D:/Inetpub/wwwroot/input.txt") or die "$!";
> >
> > The script works fine, but I need to replace
> > "D:/Inetpub/wwwroot/input.txt"
> > with a file-path from the DOS-promt.
> >
> > Thanks for your time!
> > Søren Christian Rix
>
Also check out the Getopt::Long module it has some great flexability
when reading arguments from the command line.
------------------------------
Date: Thu, 21 Dec 2000 04:11:25 GMT
From: nate <nathanw@optimus-corp.com>
Subject: Re: ASP and Perlscript Socket Checking?!
Message-Id: <nathanw-1EB6BF.14120720122000@news>
In article <90orv5$g4$1@nnrp1.deja.com>, acalbazana@epotec.com wrote:
> Hello,
>
> I have the task of checking to see that an IP and socket are
> available. I want to use Perl to accomplish this by embedding the
> following code in the ASP page using Perlscript server side:
>
> <%@Language="PerlScript"%>
> <%
> use IO::Socket;
> $sock = new IO::Socket::INET (PeerAddr => 'myIP',
> PeerPort => myPort,
> Proto => 'tcp',
> );
>
> die "Socket could not be created. Reason: $!\n" unless $sock;
> %>
>
> Obviously this will not work since I can not use the DIE statement in
> this context. How can I return the presence or absence of a socket
> using Perscript? Basically, I want to do something if the connection
> is available to me or do something else if it is not.
>
> Thank in advance,
>
> Al Calbazana
> acalbazana@epotec.com
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy
unless ($sock) { ...Create error page... end; }
If you already have output generated you can use $Response->Clear to
clear it out of the asp buffer (buffer varible must be true)
------------------------------
Date: 21 Dec 2000 00:38:10 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: automatic FAQ answerer idea
Message-Id: <91s8gi$h9v$1@boomer.cs.utexas.edu>
Hi everyone.
I've noticed lately a lot of trouble with people asking questions
that are answered in the FAQ. They may ask on the newsgroup
because they don't know where the FAQ is, don't know how to use
it, don't know that it exists, or just because they're too lazy.
But why they do it isn't the point. The point is that it happens and
it would be nice if something constructive could be done about it.
I was thinking about this problem, and it suddenly occurred to me that
maybe something really can be done about it. So, here's my idea.
As a former sysadmin turned college student, I had the opportunity
to take an artificial intelligence class this last semester, and I
learned (among other things) a little about automatic text
categorization. Most importantly, I learned that tools to do it
already exist, and that they can be pretty accurate in many
cases. Given a bunch of documents and their correct categories,
such a tool can construct a database that it can use to categorize
new documents it hasn't seen before. It will even give a
probability that a document belongs in the category it suggests.
So, what I propose is the construction of a system that would run
every new article posted to comp.lang.perl.misc through a text
categorization engine and look at the result. If the engine says,
"Hey, there is a greater than 90% chance that this article falls
into the category called 'questions that are equivalent to FAQ
question number #41'", then the system would post the answer to
the newsgroup so that the original asker and others could see it.
There are some difficulties, but I think I can see ways to get
around many of them. False matches (which would result in unwanted
automatic postings!) could be reduced with several heuristics such
as not considering articles with non-blank References: headers or
articles with low rates of certainty for the categorization.
The biggest difficulty would probably be the fact that the system
would have to be trained. In order to learn how to do the
categorization accurately, it would need to know the correct
categorizations for a bunch of articles. This could be
accomplished in a number of ways, such as special keywords that
could be inserted into replies by humans; these keywords would
alert the system that a particular post was an FAQ, and the system
would use that as its training data. Or, a web-based interface
could be used as well. (And, either approach could be used to
improve performance later on as well, by correcting the system
when it guesses wrong and letting it know when it guesses right.)
Does this sound like an interesting idea to anyone?
Would anyone be willing to work on it with me? (And,
does anyone have a machine with a full-time Internet
connection and NNTP access that this thing could run on?)
The tool I had in mind, by the way, is the "rainbow" program
from http://www.cs.cmu.edu/~mccallum/bow/ . It uses Bayesian
methods (which I personally know a little bit about), but
also supports other methods (which I know nothing about).
- Logan
------------------------------
Date: Thu, 21 Dec 2000 07:03:35 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: automatic FAQ answerer idea
Message-Id: <x766kedznc.fsf@home.sysarch.com>
>>>>> "LS" == Logan Shaw <logan@cs.utexas.edu> writes:
LS> So, what I propose is the construction of a system that would run
LS> every new article posted to comp.lang.perl.misc through a text
LS> categorization engine and look at the result. If the engine says,
LS> "Hey, there is a greater than 90% chance that this article falls
LS> into the category called 'questions that are equivalent to FAQ
LS> question number #41'", then the system would post the answer to
LS> the newsgroup so that the original asker and others could see it.
this has been proposed several times before. search deja for some thread
(dunno what keys to search for).
it has been shot down for a variety of reasons. some IIRC were it would
be to hard to make accurate, it would generate too much new volume, many
people don't want a robot in a newsgroup, etc. it couldn't do the proper
thing by emailing the answers since so many use antispam addresses.
just watch this thread develop. :(
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 21 Dec 2000 01:34:00 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: automatic FAQ answerer idea
Message-Id: <91sbp8$hrk$1@boomer.cs.utexas.edu>
In article <x766kedznc.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> wrote:
>it has been shot down for a variety of reasons.
Interesting. I will give my answer to these reasons just for the sake
of discussion. It may be that it is not a good idea, but having not
seen previous discussions about it, I haven't come to a conclusion
myself.
> some IIRC were it would be to hard to make accurate,
This could be a problem. It is easy, with a probabilistic (Bayesian)
engine, to ignore those cases where the confidence is not high. So,
although perfect accuracy would be best, a nice compromise would be
silence when the system isn't pretty sure it's accurate. Further,
there may be questions which it can't recognize accurately and ones it
can. It would be easy to use it only for the former kind. (In fact,
I'd start development by having it try to answer only one very
frequently asked question.)
> it would generate too much new volume,
Once a question is posted, it is likely to generate volume whether or
not an autoresponder is in place. *If* the system could be made to
work as intended, then I'd argue it would actually decrease volume
since it would reply very quickly, and since it could potentially
prevent flamewars.
> many people don't want a robot in a newsgroup, etc.
Don't we already have a robot in this newsgroup posting answers to FAQs
randomly? Would it be better (again, *if* it can be made to work as
intended) to send responses in a more directed fashion?
> it couldn't do the proper
>thing by emailing the answers since so many use antispam addresses.
I'd argue that the proper thing is to post, optionally copying on
e-mail. Mailing wouldn't be useful because other readers of the group
wouldn't know when the question has already been answered and thus
would spend their time answering an already-answered question.
>just watch this thread develop. :(
I will. I hope it doesn't turn into a mess, and I'm sorry in advance
if it does.
- Logan
------------------------------
Date: 20 Dec 2000 21:55:54 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: bug in open()
Message-Id: <m3wvcuiith.fsf@mumonkan.sunstarsys.com>
bmetcalf@nortelnetworks.com (Brandon Metcalf) writes:
> open() seems to have been broken in Perl 5.005_3 as well as the latest
> ActivePerl. In Perl 5.6.0 on solaris open() behaves as it should.
>
> Can anyone confirm this?
Similar for linux. However, I'm not sure which version
I'd consider having a bug. You're doing IPC with open,
and man perlipc talks about this:
[...]
Be careful to check both the open() and the close() return
values. If you're writing to a pipe, you should also trap
SIGPIPE. Otherwise, think of what happens when you start
up a pipe to a command that doesn't exist: the open() will
in all likelihood succeed (it only reflects the fork()'s
success), but then your output will fail--spectacularly.
Perl can't know whether the command worked because your
command is actually running in a separate process whose
exec() might have failed. Therefore, while readers of
bogus commands return just a quick end of file, writers to
bogus command will trigger a signal they'd better be
prepared to handle.
[...]
"open" produces a successful fork in either case, but the "exec"
fails for "lls". The camel v2 on p 342 is more explicit
(probable typos- be careful :)
... The reason you need to check both the *open* and the *close*
has to do with an idiosyncrasy of UNIX in how a piped commands
are started up. When you do the *open*, your process forks a
child process that is in charge of executing the command you
gave it. The fork(2) system call, if successful, returns
immediately within the parent process, and the parent script
leaves the *open* function successfully, even though the child
process may not have even run yet. By the time the child process
actually tries to run the command, it's already a separately
scheduled process. So if it fails to execute the command,
it has no easy way to communicate that fact back to the *open*
statement, which may have already exited successfully in the
parent. The way the disaster is finally communicated back to
the parent is the same way any other disaster in the child
process is communicated back: namely, the exit status of the
child process is harvested by the parent process when it
eventually does a wait(2) system call. But this happens in the
*close* function, not the *open* function. And that's why
you have to check the return value of your *close* function.
Whew.
...
The 5.6 behavior you observe is "nicer", but it's not in
agreement with the description above. You might use
this instead:
#!/usr/bin/perl -w
use strict;
open (DD, "lls|") || die "bad fork: $!";
print while <DD>;
close DD || die "bad lls: $! $?";
print "Definitely shouldn't get here!";
__END__
HTH.
--
Joe Schaefer
------------------------------
Date: Thu, 21 Dec 2000 05:23:53 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: bug in open()
Message-Id: <3A419476.A19C17DC@acm.org>
Brandon Metcalf wrote:
>
> open() seems to have been broken in Perl 5.005_3 as well as the latest
> ActivePerl. In Perl 5.6.0 on solaris open() behaves as it should.
>
> Can anyone confirm this?
>
> $ cat ~/tmp/jj
> open (DD, "lls|") || die "bad command: $!";
I'm guessing that lls is an alias not an actual command which is why it
can't be found by open.
John
------------------------------
Date: 21 Dec 2000 04:01:02 GMT
From: The WebDragon <nospam@nospam.com>
Subject: CGI.pm error output set_message() [was: Re: Anything wrong with this code?]
Message-Id: <91rv9u$4r0$0@216.155.33.36>
In article <91pd6d$kh3$1@dipsy.missouri.edu>, Justin McNutt
<mcnuttj@nin.iats.missouri.edu> wrote:
| Fryar386 <fryar386@aol.com> wrote:
| > My server keeps giving me errors for this code, all it says is
| > premature end.
| > I don't see anything wrong with it, do you?
|
| > print &PrintHeader;
| > open FILE, ">> /serverfiles/test.txt"
| > or die "Error, Please contact Fryar386@aol.com\n";
|
| You need to escape the @ like this: \@
|
| Also, the browser expects an HTML trailer. My CGIs usually do this when
| they
| die:
|
| print "Error message.<BR";
| die "</BODY></HTML>\n";
|
| Do this any time you need to die() in a CGI.
there's an even better way to output your err0r messages to the browser
using CGI.pm, which I discovered recently, when re-browsing Lincoln's
website docs.
use CGI::Carp qw(fatalsToBrowser set_message);
BEGIN {
sub handle_errors {
my $msg = shift;
print qq{<h2>aCk!</h2>};
print qq{<p>I'm currently beta-testing some changes, so E-mail
me, <a href="mailto:your\@e-mail.address.com">Your Name Here</a>, about
this if it persists.</p><hr>};
print qq{<p>Got an error:<br>$msg</p>};
}
set_message(\&handle_errors);
}
use CGI qw( :standard :html3 -no_xhtml);
works like a charm, and overrides the default "admin@server.com" e-mail
message for your CGI that typically gets sent to the browser on fatal
errors.
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: 21 Dec 2000 08:22:38 GMT
From: Jim Monty <monty@primenet.com>
Subject: Re: Convert YM to YMD Where D Is Last D of M Using Date::Manip
Message-Id: <91seke$8fj$2@nnrp2.phx.gblx.net>
Abigail <abigail@foad.org> wrote:
> Jim Monty <monty@primenet.com> wrote:
> > I want to use Date::Manip to convert date strings from YYYYMM to
> > YYYYMMDD, where the DD is the last day of the month MM. How do I
> > do this?
> >
> > The Date::Manip man page is over 2,600 lines long and grepping it
> > like a madman didn't help me, so I'm looking for a good spoon
> > feeding here. I promise to pay the USENET community back. Thank you.
>
> Using Date::Manip would be overkill.
Thank you! Every few months I have to waste an hour of my life
poking about CPAN and perusing POD to remind myself that I don't
get paid to cobble Perl modules together.
> @last = (31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
> $date =~ s/(\d\d\d\d)(\d\d)/"$1$2" . ($last[$2-1] ||
> ($1 % 4 ? 28 : $1 % 100 ? 29 : $1 % 400 ? 28 : 29))/e;
Yes, but did you type this fragment at a rate of 90 WPM or above
without touching the Backspace key or reversing the direction of
the cursor?
Hey, since we're on the subject... Is it a Bad Thing to do this?
@last = (0, 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
It's hard to image the value of C<scalar @last> or C<$#last> ever
being of much use anyway. And using a placeholder for the purpose
of aligning the date values with their proper ordinal subscripts
saves arithmetic, right?
(At least I didn't ask, "What's wrong with using C<local $[ = 1;>?")
Thanks, Abigail!
--
Jim Monty
monty@primenet.com
Tempe, Arizona USA
------------------------------
Date: Thu, 21 Dec 2000 02:54:22 GMT
From: Danny Aldham <danny@lennon.postino.com>
Subject: CPAN upgrade -> perl virus
Message-Id: <91rrbd$3b6$1@lennon.postino.com>
Andreas,
I understand that you are the author of the CPAN module. While using
it today, the module suggested that a new version was available, and
that I could do a seemless upgrade by running install Bundle::CPAN .
This command replaced my perl binary, and changed the path of the
libraries, basically fucking up my development machine. Nowhere in the
install was I told that it was about to replace the entire perl
distribution.
Thanks for nothing, looks like you have created the first perl virus.
--
Danny Aldham Providing Certified Internetworking Solutions to Business
www.postino.com E-Mail, Web Servers, Web Databases, SQL PHP & Perl
------------------------------
Date: Thu, 21 Dec 2000 04:41:10 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: CPAN upgrade -> perl virus
Message-Id: <GRf06.384$B9.187360256@news.frii.net>
In article <91rrbd$3b6$1@lennon.postino.com>,
Danny Aldham <danny@lennon.postino.com> wrote:
>
>Andreas,
>I understand that you are the author of the CPAN module. While using
>it today, the module suggested that a new version was available, and
>that I could do a seemless upgrade by running install Bundle::CPAN .
>This command replaced my perl binary, and changed the path of the
>libraries, basically fucking up my development machine. Nowhere in the
>install was I told that it was about to replace the entire perl
>distribution.
>Thanks for nothing, looks like you have created the first perl virus.
>
The CPAN install you asked for did exactly what it was supposed to
do. It installed a new version of Perl. Somewhere as the install
was running it asked you if you wanted to make the new perl your
default perl. You accepted the default and CPAN did what you asked.
Your old perl should still be available but it is installed with
a numeric suffix indicating it's version. Your old version of perl
and all it's libraries are still just where they were before you
ran the CPAN.
Good Luck
chris
--
This space intentionally left blank
------------------------------
Date: Thu, 21 Dec 2000 06:40:20 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: File::Find - meaning of 'symlinks'?
Message-Id: <3a41a57d.1189780@news.grnet.gr>
On Wed, 20 Dec 2000 08:09:49 GMT, pjlees@ics.forthcomingevents.gr
(Philip Lees) wrote:
>The File::Find documentation says, under Bugs:
>
>'There is no way to make find or finddepth follow symlinks.'
>
>Is that why my text search algorithm works fine on the HD but can't
>find anything on a CD-ROM?
>
>(Windows NT, I'm afraid)
Sorry for wasting your time - the problem was elsewhere. Such a stupid
error I'm too embarrased to say what it was.
At least I found out what symlinks are, which is good to know, even if
not relevant to my situation.
Thanks anyway to all who responded.
Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer
------------------------------
Date: Thu, 21 Dec 2000 05:06:32 GMT
From: genie <djodrell00@home.com>
Subject: help! "Bad file number" error
Message-Id: <3A419266.7077E8CB@home.com>
Can anyone tell me why this doesn't work?
I am trying to write a sinple client server app. When I run this code
in linux, everything works as it should. When I run it in windows, I
get a "Bad file number" error. This code is right out of the O'reilly,
"Advanced Perl Programming" book.
Windows is running perl ver. 5.004_02, linux has perl ver. 5.6.0
# CLIENT APP
use IO::Socket;
$sock = new IO::Socket::INET ( PeerHost => 'localhost',
PeerPort =>
2345,
Proto => 'tcp'
);
die "Socket could not be created. Reason: $!\n" unless $sock;
print $sock "Msg $_: How are you?\n";
close($sock);
*** output
C:\work>perl my_client.pl
Socket could not be created. Reason: Bad file number
# SERVER APP
use IO::Socket;
print "Starting my test server... \n";
$sock = new IO::Socket::INET ( LocalHost => 'localhost',
LocalPort =>
2345,
Proto => 'tcp',
Listen => 5,
Reuse => 1);
die "Socket could not be created. Reason: $!" unless $sock;
while ($new_sock = $sock->accept())
{
print "connection detected!\n";
while (defined ($buf = <$new_sock> ))
{
print "$buf\n";
}
}
print "closing socket...\n";
close ($sock);
*** yields,
C:\work>perl my_server.pl
Starting my test server...
Any help is appreciated,
-dj
------------------------------
Date: Thu, 21 Dec 2000 05:17:03 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: help! "Bad file number" error
Message-Id: <jng06.584$Kk5.32096@eagle.america.net>
On Thu, 21 Dec 2000 05:06:32 GMT, genie <djodrell00@home.com> wrote:
>I am trying to write a sinple client server app. When I run this code
>in linux, everything works as it should. When I run it in windows, I
>get a "Bad file number" error.
>
>Windows is running perl ver. 5.004_02, linux has perl ver. 5.6.0
I can't get to my Windows machine right now, but you have a down-level
version of perl on yours. Check ActiveState and upgrade. The latest
build is at least 620 (version 5.6.0).
--
Garry Williams
------------------------------
Date: Thu, 21 Dec 2000 06:52:37 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: how to invalidate a hash value during a foreach loop?
Message-Id: <3a41a86a.1938827@news.grnet.gr>
On Wed, 20 Dec 2000 08:23:14 -0500, tadmc@metronet.com (Tad McClellan)
wrote:
>Philip Lees <pjlees@ics.forthcomingevents.gr> wrote:
>
>>On Tue, 19 Dec 2000 15:18:45 GMT, "Olwynn" <info@jjmackay.ca> wrote:
>>
>>>if(values(%form_results)!='')
>>
>>For string comparisons, use ne instead of !=.
>
>The important part here is that a string comparison should
>not be used at all!
>
>values() does not return a string.
Yes, of course you're right. I was just looking at the right hand
side. Silly me.
Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer
------------------------------
Date: 21 Dec 2000 04:14:39 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: perl DBI
Message-Id: <91s03f$4r0$1@216.155.33.36>
In article <m14rzz2lo9.fsf@halfdome.holdit.com>, merlyn@stonehenge.com
(Randal L. Schwartz) wrote:
| print table( map { Tr( map { td(escape_HTML($_)) } @$_ ) } @$two_d );
|
| Lots of meat in this. Study each piece, and you will be enlightened,
| my son.
ye gods, Randal, I never knew that one could do this. Learn somethin'
new every day, and lovin' it!
is it possible to embed formatting subroutines into a line such as this
to ensure that for some td()'s I can set the bgcolor of the table cell
depending on the value of the variable to be inserted in the cell?
I already know that once I move from a flat-file format to a DBI format
I'm going to save a LOT of time and memory dealing with my data, and
you've just set off lightbulbs by the hundreds in my brain as to how to
populate the table more efficiently than I am.
I remember now why I keep reading this group. :)
If you're interested rendering some assistance in this minor puzzle,
I'll be happy to post the particulars.
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Thu, 21 Dec 2000 06:11:34 GMT
From: Patrick Fong <lielar@my-deja.com>
Subject: Perl newbie question
Message-Id: <91s6uk$fr7$1@nnrp1.deja.com>
Hi
I have a slight problem. When I submit a form to my server, I call it
http://www.experimedia.vic.gov.au/~pfong/cgi-bin/pattemp.cgi it returns
me the download of the file on the web browser. It should print out my
favourite color after processing the form.
Am I missing some setting on perl, cgi-bin directory, public_html
directory that causes this?
This should be really basic and I have no idea how to solve it?
Patrick
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 21 Dec 2000 06:34:51 GMT
From: Patrick Fong <lielar@my-deja.com>
Subject: Re: Perl newbie question
Message-Id: <91s8ac$gs4$1@nnrp1.deja.com>
In addition to what I have mentioned,
1) I have set the perl script permission to 755.
2) Whenever I set the form method to post it replies that the file is
not found (Error 404).
3) I have checked the syntax, it works.
4) An equivalent script is on the perl.com site
(http://www.perl.com/cgi-bin/backatya.pl). Hence I know that it is the
settings on my account.
How can I solve this problem?
P.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 20 Dec 2000 21:50:32 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.3 $)
Message-Id: <slrn942rvo.40r.tadmc@magna.metronet.com>
Jerome O'Neil <jerome@activeindexing.com> wrote:
>It happens when someone posts a set of requirements, and then asks
>"Can Perl do that?"
>
>It drives me frickin nuts, making me spend hours counting to ten.
It takes me about 20 seconds to make a config file entry,
and I'm moving on.
It is gratifying to be reminded of all of the counting time
I am saving for other things. Thanks. :-)
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 20 Dec 2000 19:36:57 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: qmail-inject
Message-Id: <slrn942k58.3r2.tadmc@magna.metronet.com>
[ Please put your comments following the quoted text that you
are commenting on.
Please do not quote entire articles.
Please do not quote .sigs
]
Ed Grosvenor <secursrver@hotmail.com> wrote:
>Tad McClellan <tadmc@metronet.com> wrote in message
>news:slrn941mkd.2gn.tadmc@magna.metronet.com...
>> Ed Grosvenor <secursrver@hotmail.com> wrote:
>>
>> >My hosting provider uses qmail-inject instead of sendmail.
>>
>> >every once in a great while, I get an error that reads "Use of
>> >uninitialized value at line 100..."
>>
>> qmail is written in C. That is a _Perl_ warning message.
>>
>> The problem is in your Perl program, not in qmail-inject.
>> >So what I was wondering is if any of you knows where I might be able to
>get
>> >my hands on an actual real copy of qmail-inject.
>>
>>
>> www.qmail.org
>That may well be, Tad, but the exact error states
You should show us the exact error message. We still have not seen it...
>that the error is at
>qmail-inject.pl at line 100 regardless of which of my scripts causes it to
>fail.
Do _you_ call something named 'qmail-inject.pl' or something
named 'qmail-inject'?
If the later, then you have some strange non-standard setup. Ask
your provider what they have done.
If the former, then you can read the source of 'qmail-inject.pl' :-)
>Obviously, there is either a Perl version of qmail or qmail contains
>a Perl script.
Those are not all of the possibilities.
It may be that your provider has done something hokey. Ask them
what they have done. "Real" qmail does not use Perl.
I have the source tree for qmail 1.03 right here, and there
isn't any Perl anywhere in there.
>So again, I go back to asking if qmail is an open source
^^^^^
>project of if there is any way of getting my hands on the source code.
Why again? I already showed you where. Did you read my followup?
Keep hammering at your provider for info. I'll bet they are
responsible some way or another...
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 21 Dec 2000 03:15:49 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Rename File in Win32 Environment
Message-Id: <FBe06.573$Kk5.30560@eagle.america.net>
On Wed, 20 Dec 2000 22:21:17 +0100, Oliver Söder
<soeder@ai-lab.fh-furtwangen.de> wrote:
>Depp!
>
>system(ren PATH\file1.fls PATH\file2.fls
This doesn't compile:
$ perl -wle 'system(ren PATH\file1.fls PATH\file2.fls'
Unquoted string "fls" may clash with future reserved word at -e line 1.
syntax error at -e line 1, at EOF
Execution of -e aborted due to compilation errors.
$
--
Garry Williams
------------------------------
Date: Thu, 21 Dec 2000 03:23:31 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Rename File in Win32 Environment
Message-Id: <TIe06.574$Kk5.30560@eagle.america.net>
On Thu, 21 Dec 2000 10:25:50 +1300, Peter Sundstrom
<peter.sundstrom@eds.com> wrote:
>Mike Mesarch <me@me.com> wrote in message
>news:91r485$8es$1@sshuraab-i-1.production.compuserve.com...
>> rename($file, $newfile);
>>
>> This doesn't work in a win32 environment. Does anyone have any other
>> recommendations?
>
>perldoc File::Copy
Others have properly pointed out that perl will tell the original
poster what the problem is. Without that information how do you know
that File::Copy::move() will fix the problem?
--
Garry Williams
------------------------------
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 5167
**************************************