[7090] in Perl-Users-Digest
Perl-Users Digest, Issue: 715 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 9 19:04:21 1997
Date: Wed, 9 Jul 97 16:00:34 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 9 Jul 1997 Volume: 8 Number: 715
Today's topics:
Re: [Fwd: Using link to copy a file] (Jim Skislak)
Re: Boston to Perl Conference (Nathan V. Patwardhan)
Re: Boston to Perl Conference (Chris Nandor)
Re: Can an array have two subscripts (i.e., @array (i,j <jpm@iti-oh.com>
DISLIN Plotting Extension for Perl <michels@linax1.mpae.gwdg.de>
Foreach with lists of arrays <joshg@ola.bc.ca>
Re: HELP! Insecure dependancy problem (Randy J. Ray)
Re: Help (Tung-chiang Yang)
Re: How do you do a 'cut -cx-y' with Perl? (Nathan V. Patwardhan)
Re: How to constantly get contents of a Web page (Chris Klugewicz)
how to redirect using ` ` <raarhus@bme.unc.edu>
Re: HTTP SOCKET SUPPORT <merlyn@stonehenge.com>
Re: Match closing parenthesis (Dean Inada)
Re: Perl & MsAccess (Scott McMahan)
Re: Perl is 20 times slower on Cray J90 than SGI! (Booker Bense)
Re: Perl5 for IRIX 6.2!!! (Anton Dischner)
Please help troubleshoot this for me.... (DBenson)
Re: Please help troubleshoot this for me.... (Nathan V. Patwardhan)
POP3 Help!! <admin@mailstuff.com>
Re: Q: Why doesn't "eval" work in this trivial example (David B. White)
Re: Q: Why doesn't "eval" work in this trivial example (David B. White)
San Diego Sybase Job Opportunity!!! <dglass@swpartners.com>
Re: Searching entire directory ,incl sub-dir using rege (Jamie O'Shaughnessy)
Re: Sharing Data btwn XS C calls <fox@vulpes.com>
Shell Module <jcoursey@sed.nist.gov>
Re: SSI's in CGI output (Matthew Cravit)
Re: Strange bug when blessing <domi@marlis.grenoble.hp.com>
Re: system call - Never mind <limpj@sterlingdi.com>
Re: system call <rootbeer@teleport.com>
Trouble with returning from a signal handler (Charles B Dunn)
Using ANSIColor in write formatted screen output ben@dha.unon.org
Re: Web Architect (Scott McMahan)
Why use 'use strict' ??? <ashfield.matthew@miti.nb.ca>
Win32 & FTP <buxx@buxx.com>
WIN32 Perl head aches! <thigh@mci2000.com>
Re: WIN32 Perl head aches! (Scott McMahan)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 9 Jul 1997 13:27:59 -0400 (EDT)
From: jims@nic.mil (Jim Skislak)
Subject: Re: [Fwd: Using link to copy a file]
Message-Id: <199707091728.NAA19956@ops.nic.mil>
Install the <File-Tools-2.0.tar.gz> module that is available from
ftp://ftp.cdrom.com/pub/perl//CPAN/modules/, and
use File::Tools;
copy("$file1", "$file2") || die "$file1 not copied to $file2, $!";
jims@nic.mil
------------------------------
Date: 8 Jul 1997 13:38:11 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Boston to Perl Conference
Message-Id: <5ptfs3$lvm@fridge-nf0.shore.net>
uri@sysarch.com wrote:
: * a support group for perl hackers
Perhaps some counseling, or even a 12-step plan? :-)
: * boston branch of the perl institute
I think there's a lot of Perl stuff going on in Cambridge with the MIT
community, _The Perl Journal_ and all. In other words, I know a
number of folks who are dedicated Perl hackers, but they seem to
prefer the institute, perl.com, CPAN, etc for their contributions,
and this newsgroup for their discussions.
: * perl proselytizing in beantown
I was just standing out on Mass Ave last week with a tin cup and sign
that read "regular expressions - 5 cents." :-)
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Tue, 08 Jul 1997 13:06:32 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Boston to Perl Conference
Message-Id: <pudge-ya02408000R0807971306320001@news.idt.net>
In article <5ptfs3$lvm@fridge-nf0.shore.net>, nvp@shore.net (Nathan V.
Patwardhan) wrote:
# I was just standing out on Mass Ave last week with a tin cup and sign
# that read "regular expressions - 5 cents." :-)
That was you?
--
Chris Nandor pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'08 24 09 0B CE 73 CA 10 1F F7 7F 13 81 80 B6 B6'])
------------------------------
Date: 8 Jul 1997 13:53:03 GMT
From: "Joshua Marotti" <jpm@iti-oh.com>
Subject: Re: Can an array have two subscripts (i.e., @array (i,j))?
Message-Id: <01bc8ba6$408bff80$36601ec6@bach>
That's a nice book you have...
To answer your question... no you cannot have 2 subscripts the way you
think...
Try looking up
arrays - multidemensional
Josh
F J Deng <fdeng@cc.memphis.edu> wrote in article
<33C05907.9D8D343@cc.memphis.edu>...
> Sorry for asking a question that may be too elementary. Can an array
> have two subscripts, such as @array(i,j)? I have looked my Teach
> Yourself Perl 5 in 21 days and found no answer.
>
> Thanks for helping.
>
> Johnny
>
>
------------------------------
Date: Tue, 08 Jul 1997 15:53:35 +0200
From: Helmut Michels <michels@linax1.mpae.gwdg.de>
Subject: DISLIN Plotting Extension for Perl
Message-Id: <33C2465F.41C6@linax1.mpae.gwdg.de>
DISLIN is a high-level and easy to use graphics library for
displaying data as curves, bar graphs, pie charts, 3D-colour plots,
surfaces, contours and maps. Several output formats are supported
such as X11, PostScript, CGM, HPGL, TIFF and Prescribe. The library
contains about 400 plotting and parameter setting routines and is
available for several C, Fortran 77 and Fortran 90 compilers.
The DISLIN distributions for Linux, SunOS and OSF/1 contain now
plotting extensions for Perl 5.003/5.004.
DISLIN for Linux is free, other DISLIN versions can be tested freely
for 10 days.
FTP site:
ftp://ftp.gwdg.de/pub/grafik/dislin
Files:
dislin_manual.63.tar.gz DISLIN PostScript manual
dislin_perl.63.ps.gz DISLIN Perl manual
unix/README.UNX Installation instructions for UNIX
unix/dislin_linux.63.tar.gz DISLIN distribution for Linux
unix/dislin_osf.63.tar.gz DISLIN distribution for OSF/1
unix/dislin_sun5.63.tar.gz DISLIN distribution for SunOS
DISLIN Home Page:
http://www.mpae.gwdg.de/dislin/dislin.html
---------
Helmut Michels michels@linax1.mpae.gwdg.de
Max-Planck-Institut fuer Aeronomie Phone: +49 5556 979-334
D-37191 Katlenburg-Lindau, Germany Fax : +49 5556 979-240
------------------------------
Date: Wed, 09 Jul 1997 14:48:27 -0700
From: Joshua Gemmell <joshg@ola.bc.ca>
Subject: Foreach with lists of arrays
Message-Id: <33C4072B.69B@ola.bc.ca>
Howdy,
Is it possible to iterate through a list of arrays and get the whole
array? For example, iterating through a list of scalars goes like this:
@List = ('one','two','three');
foreach $Thing (@List) {
print " This is $Thing\n";
}
And the output is:
This is one
This is two
This is three
But if I try this with a list of arrays, things get screwy.
@List = (['one','two','three'],['a','b','c'],['1','2','3']);
foreach $Thing (@List) {
print " This is $Thing\n";
}
And the output is...
This is ARRAY(0x217e738)
This is ARRAY(0x2180288)
This is ARRAY(0x21802c4)
I've tried a few other things, but they just barf at me. Anybody out
there know how to do this?
Thanks,
Josh
------------------------------
Date: 08 Jul 1997 12:06:03 -0600
From: rjray@tremere.ecte.uswc.uswest.com (Randy J. Ray)
Subject: Re: HELP! Insecure dependancy problem
Message-Id: <uow2059ber8.fsf@tremere.ecte.uswc.uswest.com>
>>>>> "Ronald" == Ronald L Parker <ron@farmworks.com>
>>>>> wrote the following on Mon, 07 Jul 1997 15:37:17 GMT
Ronald> Martin Scantland <coopdcs@nortel.ca> wrote:
>> open(CMD, "ls -t *.src|" ); while($latest_file = <CMD>)
Ronald> I seem to recall that taint has a hard time trusting
Ronald> anything that comes from "outside." I would guess that not
Ronald> trusting the output from ls is intended to keep someone from
Ronald> putting their own custom-made ls earlier in the path and
Ronald> using it to break your script. Either that or Perl just
Ronald> treats CMD like any other file and assumes that it could
Ronald> have been modified by a malicious user.
A little of both. Data in from a file descriptor will be considered tainted
under -T. Additionally, trying to open a pipe if your PATH environment is
insecure will also cause problems. In the short case, $ENV{PATH} should be
set to '' (perhaps temporarily) and ls replaced with /bin/ls. In the more
sound case...
Ronald> Have you considered using opendir/readdir/closedir and the
Ronald> -X or stat functions instead? They are more portable and
Ronald> probably faster, so you should use them whenever possible.
Ronald> (What do you do if your user doesn't have an ls command, it
Ronald> doesn't support the -t option, or it doesn't output things
Ronald> in the same format yours does?)
If it's UNIX, they should have an ls that properly handles -t. If not in /bin,
then the Config module might have an entry for it. But your way is best:
opendir(DIR, '.');
while (defined($file = readdir(DIR)))
{
next unless ($file =~ /(.*\.src)$/o);
$file = $1; # Not only have we skipped non *.src files, $file is now
# untainted by virtue of regex "washing".
...
}
I left ellipses at the end there because I don't know what the original intent
is... he calls the line "latest_file", and -t does sort the files by time-
stamp, but in ascending order. If he meant for the while-loop to result in the
*newest* file, then the ls above would need the -r flag as well, and the while
loop I wrote would be:
$latest_file = '';
$latest_stamp = 0;
opendir(DIR, '.');
while (defined($file = readdir(DIR)))
{
next unless ($file =~ /(.*\.src)$/o);
$file = $1; # Not only have we skipped non *.src files, $file is now
# untainted by virtue of regex "washing".
if (($stamp = (stat($file))[9]) > $latest_stamp)
{
$latest_file = $file;
$latest_stamp = $stamp;
}
}
closedir(DIR);
print "Most recently-updated file is $latest_file, at ",
scalar localtime($stamp), "\n";
Randy
--
===============================================================================
Randy J. Ray -- U S WEST Technologies IAD/CSS/DPDS Phone: (303)595-2869
Denver, CO rjray@uswest.com
"It's not denial. I'm just very selective about the reality I accept." --Calvin
------------------------------
Date: Tue, 8 Jul 1997 09:15:24 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Help
Message-Id: <tcyangECztpo.2tH@netcom.com>
(1) HTML files cannot be 'executed'.
(2) You are better to ask this question in the comp.infosystems.www.*
groups because very likely you are asking about a CGI question.
Most importantly, choose a smart and meaningful subject next time when you
post. Wait for the subject-choosing FAQ in CLPM.
================================
Fan Ng wrote after zapping the scum of the universe:
: Hi all:
: can some one tell me chomp function in this case:
: I wrote a HTML file who is excuted by perl. In My HTML has some text in a small
: windows(textarea) but when it (HTML)pointed to perl, perl separate my text (in
: HTML) whit the blank lines come out ( when I used the browers to view it).
: help me, Thank you
: fanngmail@prodigy.net
--
========= Try the low-crossposting robomoderated 'alt.culture.taiwan' ===
soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml
------------------------------
Date: 8 Jul 1997 13:31:51 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: How do you do a 'cut -cx-y' with Perl?
Message-Id: <5ptfg7$lvm@fridge-nf0.shore.net>
Chris Hostetter (me@anon.com) wrote:
: ok, i admit, at first i thought you were smoking something, but then i
: whiped out the camel and looked up split... i never truely appreciated
: this function.
No. Not smoking anything. Drinking too much Nescafe, though. :-)
Yes, unpack(), and substr() will be dandy, too. Actually, probably
even better.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Wed, 09 Jul 1997 09:12:55 GMT
From: ck@chesbay.com (Chris Klugewicz)
Subject: Re: How to constantly get contents of a Web page
Message-Id: <33c354f8.123924474@news3.his.com>
On 9 Jul 1997 05:20:23 GMT, Out Of The Blue <gohhonge@iscs.nus.edu.sg>
wrote:
>hi,
>
> I need to write a program that will keep getting
> the (changing) Web content for a URL, for my school
> project :( Anyone can give any hints :)
>
Check out the LWP module (available through CPAN) -- something like
this could be called from a crontab entry with its output directed
wherever you want:
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
use HTML::Parse;
my $ua = new LWP::UserAgent;
my $request = new HTTP::Request('GET', $ARGV[0]);
my $response = $ua->request($request);
if ($response->is_success) {
print parse_html($response->content)->format;
} else {
print $response->as_string;
}
Incidentally, the example is taken from "Web Client Programming in
Perl" by Clinton Wong (O'Reilly) -- highly recommended if you're going
to do this sort of thing regularly.
------------------------------
Date: Wed, 09 Jul 1997 12:41:39 -0400
From: aarhus <raarhus@bme.unc.edu>
Subject: how to redirect using ` `
Message-Id: <33C3BF3D.11B8@bme.unc.edu>
Hi!
I used ` ` to execute a command which outputs to the screen. Then I
tried redirect it to a file. e.g.
` $cmmd $infile >& $outfile `;
I found that perl couldn't recognize the redirection symbol. Could
anyone tell how I can redirect output? Thanks a lot
Wen
------------------------------
Date: 05 Jul 1997 23:55:07 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: mwf1@engr.uark.edu
Subject: Re: HTTP SOCKET SUPPORT
Message-Id: <8clo3kacvo.fsf@gadget.cscaper.com>
>>>>> "Matt" == Matt Froemsdorf <mwf1@engr.uark.edu> writes:
Matt> I tried writing a very simple PERL program using HTTP sockets, based on
Matt> the example given in the llama book.
Ouch. That's the hard way. :-)
Matt> All help would be greatly appreciated.
Get and install LWP from the CPAN.
Then it's just:
use LWP::Simple;
$content = get "http://www.stonehenge.com/merlyn/WebTechniques/";
Too easy.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 422 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 6 Jul 1997 04:07:50 GMT
From: dmi@deltanet.com (Dean Inada)
Subject: Re: Match closing parenthesis
Message-Id: <5pn5mm$egc$1@news01.deltanet.com>
In article <hhu3ib9r93.fsf@dres.elam.org> James LewisMoss <dres@dimensional.com> writes:
>>>>>> On Thu, 03 Jul 1997 15:01:25 +0200, Markus Bubendorf <markus.bubendorf@siemens.ch> said:
> Markus> Example: Given string: 'abc(def(foo)ghi)jkl'
> Markus> Known search string: 'abc('
> Markus> Wanted string: 'def(foo)ghi'
>
>You can create something that will work for the one example you
>provide above, but it'll fail with a string like
>"abc(def(foo)ghi)jkl(bar)". If you can assure that your strings will
>always be nice patterns (I believe though I haven't thought too much
>on it only nested parens) then something simple like /\(.*\)/ will
>work. Otherwise you are outa luck and you need to write a parser that
>counts parens as it reaches them.
Fortunately, Larry, Henry, Ilya, et al. have already written one for you:-)
$given = "abc(def(foo)ghi)jkl(bar)";
$known = 'abc(';
($wanted=$given)=~s/\(/(?:/g;
$wanted=~s/(\Q$known\E)\?:|(\(\?:|\))|./$+./gs;
($wanted) = ($given =~ /$wanted/s);
$wanted =~ /^(//;
If $given may contain unmatched parentheses, then you could try:
($_)=($given=~/\Q$known\E(.*\))/s);
($wanted=$_)=~s/((\()|(\))|[^()]+)/$3\Q$1\E$2/g;
$wanted = "(?:" x tr/)// . "($wanted)" . ")" x tr/(//;
($wanted) = /$wanted/;
------------------------------
Date: 9 Jul 1997 16:32:21 GMT
From: scott@lighthouse.softbase.com (Scott McMahan)
Subject: Re: Perl & MsAccess
Message-Id: <5q0eel$qp9$4@mainsrv.main.nc.us>
Aldo Calpini (dada@divinf.it) wrote:
: > How can I use MSAcess Database with Perl?
: Get the Win32::ODBC module from:
: http://www.perl.com/CPAN/authors/Dave_Roth/
You could also use OLE Automation, if you had a thing for
pain, and DAO.
Scott
------------------------------
Date: 9 Jul 1997 14:53:08 GMT
From: bbense@telemark.stanford.edu (Booker Bense)
Subject: Re: Perl is 20 times slower on Cray J90 than SGI!
Message-Id: <5q08kk$nbs$1@nntp.Stanford.EDU>
In article <33C2DA14.7566@cray.com>, Justin Banks <justinb@cray.com> wrote:
>James J. Heck wrote:
>>
>> Brett,
>>
>> A few of us tested the same thing on our Cray J90 however it only took
>> 1.28 seconds to execute. Then we ran it on a SGI R10k machine here and
>> it took 1.01 seconds.
>> After talking to a few ppl we believe that it has to do with the fact
>> that the Cray is word addressable whereas the SGI is byte addressable.
>> Thus the parsing of each line on the Cray takes more memory overhead.
>>
>> James
>>
>
>This is probably true (absolutely NO guarantees), but I have another
>question : how many runs did you make, and which did you use for the
>measurement? In other words, did you run the script several times,
>notice the time difference and then measure how long it took for the SGI
>to execute vs. the Cray? Sounds wierd, but it will probably make a
>difference.
>
- I've seen this effect with lots of codes, not just perl5. Anything
that makes heavy use of char ptrs is going to be slow as death on a
Cray. Spaghetti fortran code will also exhibit this same
behaviour. As a "scalar" machine a C90 can be beat by most high
powered workstations. It's only when you can vectorize the code
(i.e. for loops ) that you get the tremendous speedups
possible. Multitasking is also required for the flat out topend
speed. All of this takes a fair amount of work and specialized
knowledge. Cray's compilers are pretty amazing, but getting maximum
performance still takes someone that understands how the machine works
down to the register level on the chip. You don't have to write
assembler, but you'll get much more use out of the machine if you take
an assembler class. Perl is very handy on a cray, but unless you can
put the heavy lifting in an optimized C or Fortran library you'll
never get the performance that you are paying for.
- Since UNICOS has a very optimized file system, benchmarking a script
on a Cray is a tricky task. Anything that runs under 5 or 10 secs is
essentially a useless benchmark. You can easily get runtimes that vary
by a 100% due to whether the executable and data are in cache or not
and what the load is on the rest of the system. In my former life as
a code tweaker at SDSC, I tried to get benchmarks that ran for at least a
minute, 3 minutes is better, 5 or 10 for really complex codes. UNICOS
has some very nice profiling tools for digging into this kind of stuff.
- Booker C. Bense : bbense@stanford.edu
------------------------------
Date: Wed, 09 Jul 1997 11:04:23 +0200
From: dischner@_NO_SPAM_med.uni-muenchen.de (Anton Dischner)
Subject: Re: Perl5 for IRIX 6.2!!!
Message-Id: <dischner-ya02408000R0907971104230001@news.lrz-muenchen.de>
Hi Chris,
Why don't you make your own binaries ?
Get the source, use Irix 6.0 defaults.
The install is pretty straight-forward.
Kind regards,
Toni
In article <33BCE86E.41C6@titan.tcn.net>, Christopher Smith
<cbsmith@titan.tcn.net> wrote:
> Hi there. I am migrating from IRIX 5.3 to 6.2 and I'm having a heck of a
> time finding Perl5 binaries for that platform (my 5.3 binaries seem to
> fail whenever I load a perl library).
>
> Is there a location where I can find an up to date version of Perl5
> easily?
>
> --Chris
> cbsmith@adeo.com
--
A. Dischner, SGI&AIX sysadmin, Oracle DBA | Don't let friends
Institut fuer Klinische Chemie | use WinDose
Klinikum Grosshadern | Just say NO.
Ludwig Maximilians Universitaet Muenchen, GER | Please remove
Marchioninistr.15 81366 Muenchen 49-89-70953202 | _NO_SPAM for email.
------------------------------
Date: Wed, 09 Jul 1997 03:37:44 GMT
From: dbenson@hopsgroup.com (DBenson)
Subject: Please help troubleshoot this for me....
Message-Id: <33c8073d.63273853@news.netmcr.com>
I'm having a lot of trouble getting all this to work. Would someone
please read through it for me and give me some suggestions. I'm just
a newbie here....
I'm trying to allow the form input to parse via the cgi and post then
to another page. Like a guestbook actually. It's more to be a
bulletin wall.
I thank you in advance for any help you might offer....
dbenson@hopsgroup.com
Here's the form to send the input...
<html>
<head>
<title>Bulletin Board Submission Form</title>
</head>
<body bgcolor="#FFFBF0" text="#000000">
<p>
<center>
<form method=POST action="http://ns.netmcr.com/cgi-bin/dmanb/bull.pl">
Your Name Please: <input type=text name="usrname" size=20><br>
Your E-Mail Address: <input type=text name="email" size=17><br>
Your Comment Please: <textarea wrap="virtual" rows=7 cols=17
name="comment"></textarea><br>
<input type=submit value="Touch Me">
</center>
</body>
</html>
here's the cgi....
#!/usr/bin/perl
#This is a Bulletin Board
$bull="../../../../home/dmanb/public_html/bull/bull.htm";
$bull_url="http://ns.netmcr.com/~dmanb/bull/bull.htm";
$bull_cgi_url="http://ns.netmcr.com/cgi-bin/dmanb/bull.pl";
read(STDIN, $input, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $input);
foreach $pair (@pairs) {
($name, $value) = split (/=/, $pair);
$name=~ tr/+/ /;
$name=~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",
hex($1))/eg;
$value=~ tr/+/ /;
$value=~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",
hex($1))/eg;
$FORM{$name} = $value;
}
$usrname = $FORM{'usrname'};
$email = $FORM{'email'};
$comment = $FORM{'comment'};
$comments =~ s/<([^>]|\n)*>//g;
open(FILE, ">$bull") || die "I can't open $bull\n";
@file = <FILE>;
close(FILE);
$sizefile = @file;
open (FILE, ">$bull") || die "I can't!\n";
for($a = 0; $a <= $sizefile;
$sizefile++) {
$_ = $file[$a];
if(/<!--begin-->/) {
print FILE "<!--begin-->\n";
print FILE "<p><a
href=\"mailto:$FORM{'email'}\">$FORM{'usrname'}</a><br>\n";
print FILE "$FORM{'comment'}</p>\n";
} else {
print $_;
}
}
close(FILE);
here's the resulting page....
<html>
<head>
<title>Bulletin Board</title>
</head>
<body bgcolor="#FFFBF0" text="#000000">
<p>
<center>
This Bulletin Board begun on 07-07-97
</center>
</p>
<!--begin-->
</body>
</html>
------------------------------
Date: 9 Jul 1997 04:09:48 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Please help troubleshoot this for me....
Message-Id: <5pv2uc$k67@fridge-nf0.shore.net>
DBenson (dbenson@hopsgroup.com) wrote:
: I'm trying to allow the form input to parse via the cgi and post then
: to another page. Like a guestbook actually. It's more to be a
: bulletin wall.
This isn't a CGI newsgroup, but I *can* address a couple of problems
I've noticed with your Perl code. You'll have to get the rest of the
answers from comp.infosystems.www.authoring.cgi.
[html snipped]
: $bull="../../../../home/dmanb/public_html/bull/bull.htm";
: $bull_url="http://ns.netmcr.com/~dmanb/bull/bull.htm";
: $bull_cgi_url="http://ns.netmcr.com/cgi-bin/dmanb/bull.pl";
Don't use relative paths. Use the absolute path, like:
$bull = '/home/dmanb/public_html/bull/bull.htm';
Make sure the directories are readable and writable by the user
running the server (i.e. - nobody).
Also, why are you going through the trouble of parsing the FORM data
yourself? Why aren't you using CGI.pm? Get it from:
http://www.perl.com/CPAN/modules/by-module/CGI/
CGI.pm has been extensively tested, and the examples included with the
package are excellent. The module is also well-documented.
Learn it. Love it. Use it.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Wed, 09 Jul 1997 17:18:30 -0500
From: Todd <admin@mailstuff.com>
Subject: POP3 Help!!
Message-Id: <33C40E36.90BF1188@mailstuff.com>
HI,
I send mail to a user account I create on my 4.2 linux box. Then I try
and pull it from netscape on another machine. It does not work, I can
send mail from netscape using linux as smtp server
but can't pull it. In Netscape it says "an error in the pop3 server,
contact administrator".
I can get my mail by going to the linux console and using
Pine. I want to be able to pull mail with netscape from any machine. Why
does this not work? Do I have to set something in some conf file
somewhere?
Any help appreciated. email admin@mailstuff.com
------------------------------
Date: 9 Jul 1997 20:10:27 GMT
From: dbwhite@btv.vnet.ibm.com (David B. White)
Subject: Re: Q: Why doesn't "eval" work in this trivial example?
Message-Id: <5q0r7j$h02$1@mdnews.btv.ibm.com>
In article <33b97068.23354624@athos.cc.bellcore.com>,
ral@cc.bellcore.com (Ron Levenberg) writes:
> $SIG{ALRM} = { die "timeout" };
> PROBLEM: The script should wait 15 seconds for me to enter a line on
> the standard input, but in fact the timeout message above is
> output immediately upon execution, as if the SIG assignment worked
> but the following 3 statements (those bracketed by alarm 15 .. alarm)
> are not executed.
Perl is trying to execute { die "timeout" } to see what is returned,
so that it can use that result to set the handler (like the Plumber()
example on page 139 of the second edition of the Camel.) Unfortunately
for you, the result of "die"ing is fatal.
It works much better if you give Perl a hint that the block *IS* your
handler by prefacing it with a sub
i.e. $SIG{ALRM} = sub { die "timeout" };
--
David B. White
IBM Microelectronics, Circuit Verification & Design Tools
Internal: dbwhite@btv Internet: dbwhite@vnet.ibm.com
Phone: 802-769-5671 (TieLine: 446) Fax: 802-769-5722
------------------------------
Date: 9 Jul 1997 20:29:26 GMT
From: dbwhite@btv.vnet.ibm.com (David B. White)
Subject: Re: Q: Why doesn't "eval" work in this trivial example?
Message-Id: <5q0sb6$h02$3@mdnews.btv.ibm.com>
In article <33b97068.23354624@athos.cc.bellcore.com>,
ral@cc.bellcore.com (Ron Levenberg) writes:
> $SIG{ALRM} = { die "timeout" };
> PROBLEM: The script should wait 15 seconds for me to enter a line on
> the standard input, but in fact the timeout message above is
> output immediately upon execution, as if the SIG assignment worked
> but the following 3 statements (those bracketed by alarm 15 .. alarm)
> are not executed.
Perl is trying to execute { die "timeout" } to see what is returned,
so that it can use that result to set the handler (like the Plumber()
example on page 139 of the second edition of the Camel.) Unfortunately
for you, the result of "die"ing bails out of your eval block.
It works much better if you give Perl a hint that the block *IS* your
handler by prefacing it with a sub
i.e. $SIG{ALRM} = sub { die "timeout" };
--
David B. White
IBM Microelectronics, Circuit Verification & Design Tools
Internal: dbwhite@btv Internet: dbwhite@vnet.ibm.com
Phone: 802-769-5671 (TieLine: 446) Fax: 802-769-5722
------------------------------
Date: Wed, 09 Jul 1997 11:00:52 -0700
From: Daniel Glassman <dglass@swpartners.com>
Subject: San Diego Sybase Job Opportunity!!!
Message-Id: <33C3D1D4.5A70@swpartners.com>
Sybase Engineers Wanted!!!
Software Partners is a solutions oriented consulting company serving the
southern California area. We specialize in developing custom
client/server
applications, such as data-driven intranets and Internet web sites. We
are
also an authorized reseller of Sybase and PowerBuilder products. We
provide quality service to our customers and have an excellent track of
achieving total customer satisfaction.
Software Partners currently has several job openings for Sybase
engineers
who will be assigned to work with one of our key customers in the
financial
services industry. Job assignment areas include Sybase Reporting,
Sybase
Data Integrity, Sybase/Forte Application Development, Sybase/Visual
Basic
Application Development, Sybase Data Import, Sybase/Perl Development,
and Sybase DBA.
The successful candidate will have a Bachelors or Masters degree in
Computer
Science or related discipline, will have at least one year of Sybase
experience, will have strong Unix skills (except for the Sybase/Visual
Basic assignment), and will enjoy working in customer environments. The
Forte assignment also requires one year of Forte experience, and the
Sybase/Perl assignment requires one year of Perl experience.
If this sounds good to you, mail, fax, or e-mail your resume to:
Human Resources
Software Partners
Box 230229
Encinitas, CA 92023-0229
Fax: (619) 350-0372
email: dglass@swpartners.com
------------------------------
Date: Tue, 08 Jul 1997 10:21:02 GMT
From: joshaugh@uk.oracle.com (Jamie O'Shaughnessy)
Subject: Re: Searching entire directory ,incl sub-dir using regexps, for files.
Message-Id: <33c413a9.1100163921@newshost.us.oracle.com>
On Tue, 08 Jul 1997 09:50:11 +0100, Shaun O'Shea <lmisosa@eei.ericsson.se>
wrote:
>Hi
> I'm rtelatively new to this so bear with me. I want to use
>reg-exps(or any other method) to search through a directory (including
>it's sub directories) for certain files.
> Is this possible?
Do you mean apply the regexp to the filename? Try something like
use File::Find;
find(\&proc_func, $start_dir);
sub proc_func {
if(/[regexp goes here]/) {
print "$_\n";
}
}
i.e. look at the File::Find module. The above will search through $start_dir
and below for all files and directories that match the [ ] regexp.
Jamie
___________________________________________________________________________
Jamie O'Shaughnessy Work: joshaugh@uk.oracle.com
Oracle C++ Object Layer Generator Team Home: jamie@thanatar.demon.co.uk
______________________________________________________ __ __ _ __ . __
Opinions expressed here are my own and not those of... (__)|-</-\(__ |__ -_
------------------------------
Date: Wed, 09 Jul 1997 11:01:41 -0400
From: Ken Fox <fox@vulpes.com>
Subject: Re: Sharing Data btwn XS C calls
Message-Id: <33C3A7D5.3E06@vulpes.com>
James J. Heck wrote:
> My dilemma is that it seems like the data that each calls makes/uses is
> held separate from the subsiquent calls to the other functions.
This sounds like a logic error. An XS function is a normal C function
(well,
if you consider C to be normal I guess). There isn't any special magic
going
on. You can use file scope or global scope C variables to preserve
state between
function calls. (I don't recommend this though.) You can also use
explicit
return values and parameter passing. This usually makes your code
easier to
understand and more reusable. Finally, you can use perl variables (e.g.
locals
in a module) to maintain your state. The perlguts documentation
describes how to
lookup perl locals from C code.
You'll probably have to evaluate your design and choose which technique
is most
appropriate. If you just can't make your code work, try posting a small
example
of the problem. Somebody might be able to spot the mistake.
- Ken
------------------------------
Date: Wed, 09 Jul 1997 16:25:12 -0400
From: Jack Coursey <jcoursey@sed.nist.gov>
Subject: Shell Module
Message-Id: <33C3F3A8.41C6@sed.nist.gov>
Where can I find a reasonable example of how to use the Shell Module
that comes in the standard library.
Jack
------------------------------
Date: 8 Jul 1997 12:37:44 -0700
From: mcravit@best.com (Matthew Cravit)
Subject: Re: SSI's in CGI output
Message-Id: <5pu4u8$g9t$1@shell3.ba.best.com>
In article <01bc8bbf$e55ca640$f540f6cd@cbshaw.superlink.net>,
Cliff Shaw <cliff@shawfamily.com> wrote:
>How can I have SSI's work in the output produced by my CGI scripts.
This is not a Perl question, really. This is more of a Web server
question, and as such, more properly belongs somewhere over in the
comp.infosystems.www.servers.* hierarchy. The answer also depends
on which web server you're using, which you neglected to state.
However, the answer to your question as regards all of the Web
servers I have used is that you can't. The output of a CGI script
normally goes directly to the browser, and is not parsed for SSIs.
Of course, if you asked over in the right group for your Web server,
you could get a definitive answer.
Hope this helps.
/MC
--
Matthew Cravit, N9VWG | Experience is what allows you to
E-mail: mcravit@best.com (home) | recognize a mistake the second
mcravit@taos.com (work) | time you make it.
------------------------------
Date: 08 Jul 1997 10:39:30 +0200
From: Dominique Dumont <domi@marlis.grenoble.hp.com>
Subject: Re: Strange bug when blessing
Message-Id: <vkzg1tqq6nx.fsf@marlis.grenoble.hp.com>
rick@infomechanics.com writes:
> I have a largish perl program which has been running for some time that
> has developed a most perplexing bug under perl 5.004 built using the
> SUN compiler. The following (incredibly simple) code segment:
>
> $self = {};
> bless $self,$class;
>
> occasionally results in the situation where ref($self) ne $class.
> ref($self) is a valid class, but it is not related (in an @ISA sense) to
> the class named $class. This code is being invoked within an AUTOLOAD
> which is within an eval (which actually is within yet another eval). If
> anyone has seen something similar or can shed even a modicum of light on
> this problem, I would be most appreciative.
>
If you run several times this piece of code, I think a "my" in front of "$self"
would prevent the different selves to stomp on each others.
Hope this helps
--
Dominique_Dumont@grenoble.hp.com
------------------------------
Date: Tue, 08 Jul 1997 12:31:41 -0400
From: Patrick J Lim <limpj@sterlingdi.com>
Subject: Re: system call - Never mind
Message-Id: <33C26B6C.4D68@sterlingdi.com>
Thanks so much for all your help. We believe that we found the
problem, and it was something that another developer was doing
that was messing us up. (Something about too many processes,
I suspect, and lack of memory or some such.) We have not completely
nailed the problem down, but we think that we are on its trail.
Once again, thank you for all your help.
Patrick Lim
limpj@sterlingdi.com
Cathy Colavito
colavich@sterlingdi.com
------------------------------
Date: Tue, 8 Jul 1997 09:22:12 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Patrick J Lim <limpj@sterlingdi.com>
Subject: Re: system call
Message-Id: <Pine.GSO.3.96.970708091756.10418C-100000@kelly.teleport.com>
On Tue, 8 Jul 1997, Patrick J Lim wrote:
> We are trying to do a system call from a Perl script.
> However, we are getting a return status of 1, when
> we expect 0. For example, "system(date)" returns 1,
> and we are not getting the output from the date command.
Well, even though that's not the way I'd call it, it works for me. Maybe
your PATH is mis-set? How does this work?
$result = system '/bin/date';
print "System command returned '$result'\n";
But if you only need the date, it's usually better to use Perl's built-in
localtime function.
$date = localtime;
print "Today is $date\n";
> Also, we have a series of system calls being done. If
> one of them returns some non-zero value (usually 1), then
> all the subsequent calls in the script also return a
> non-zero value.
Probably the first failure is trying to tell you something! :-) But most
Perl scripts don't need to do a series of system() calls, since (most of
the time) you can do the same things from within Perl, as I showed with
localtime. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 9 Jul 1997 20:09:24 GMT
From: charldu@mwl8.mwl.tek.com (Charles B Dunn)
Subject: Trouble with returning from a signal handler
Message-Id: <5q0r5k$rb1$1@bvadm.bv.tek.com>
I'm new to Perl but a prof programmer.. I am really stumped on returning from
a signal handler. I don't end up at all where I would expect. I.E. the next
instruction after catching the signal.
Background:
What I'm using:
SunOS Release 4.1.3_U1 (GENERIC) #2: Thu Jan 20 15:58:03 PST 1994
Perl 5.004
I wrote a script that forks a child process to do terminal I/O to a /dev/ttyn terminal.
The dump request
is made by the user and the parent gets the file name from the user console. To signal the
child that its time to start dumping (rather than logging or printing to the console)
a signal USR1 is sent by the parent to the child (via kill). The signal is caught by routine
childUSR1. The child sets up to catch the signal with:
$SIG{USR1} = \&childUSR1;
Here is the entirety of the handler:
sub childUSR1{
$dumpOn = 1;
return;
}
The flag is noticed by the loop doing IO from the target terminal and the dump process begins.
Or at least it should. Looking at the dump from the debugger (which follows),
the break point is at the first line of the handler.
The stack trace shows that the next stack "frame" is for mwltip:428
which is the middle of the target terminal read loop. This is right where I would expect to go back
to when I return from the handler. The return instead returns from the next "frame" up on the
stack and returns from childTask!! Since this is never supposed to return, the child task exits,
and the world goes downhill quickly. Why does a return (leaving off the return and letting it
fall off the end produced the same results) not go back to the next item on the stack? Why do
I go up an extra frame and return there?? The variable $dumpOn is first referenced by the initialization
of the childTask so the handler is not trying to create it (hence allocate memory). I have verified that
this is not an anomoly of the debugger. By adding a print in the right places I verified that in
fact when we return from the handler, we exit the child task just as the debugger shows!
I'm baffled. Any thoughts???
(I bought the LLama (sp?) book and the Camel book (GREAT books BTW).
I use -w. I have been through the
FAQ, and seen some things about keeping handlers simple. But nothing seems to talk about signals
you actually return from. Signals seems to be treated only as terminal events, not as something
a script would use for simple cooperation between a parent and child process...)
-Charlie
------------------------------------------------------------------------------
(Output cut and pasted from a debugging session with the script in question).
235 (~/bin) perl -d mwltip
Loading DB routines from perl5db.pl version 1
Emacs support available.
Enter h or `h h' for help.
main::(mwltip:18): $| = 1; # Enable AUTOFLUSH for output to STDOUT
DB<1> b childUSR1
DB<2> c
mwltip Rev 1.1, 1997/07/07 23:08:29
->
-> pwd
mwl8:
value = 6 = 0x6
-> Name of dump file to create: foo.dmp
Dump file foo.dmp exists, overwrite? (Y/n) y
main::childUSR1(mwltip:440): $dumpOn = 1;
DB<2> T
$ = main::childUSR1('USR1') called from file `mwltip' line 428
$ = main::ChildTask() called from file `mwltip' line 154
DB<2> n
main::childUSR1(mwltip:441): return;
DB<2> Cannot wake child to perform dump, aborted...
main::(mwltip:155): exit(); # Better not get here!!!
DB<2> DB::fake::(/login/charldu/perl5/perl5.004/lib/perl5db.pl:2043):
2043: "Debugged program terminated. Use `q' to quit or `R' to restart.";
DB<2> main::childCatchTerm(mwltip:436): exit(); # Terminate the child process
DB<2> DB::fake::(/login/charldu/perl5/perl5.004/lib/perl5db.pl:2043):
2043: "Debugged program terminated. Use `q' to quit or `R' to restart.";
DB<2> 236 (~/bin)
------------------------------
Date: Wed, 09 Jul 1997 04:33:09 -0600
From: ben@dha.unon.org
Subject: Using ANSIColor in write formatted screen output
Message-Id: <868438357.30223@dejanews.com>
I have a Perl script that updates a screen display about once a second
with a system{'clear'}; write; sequence. The flicker isn't too bad and it
does it does the job (monitoring diald pipe for Linux). I would like to
insert color into the screen output, but format treats the the escapes
strangely. I have used ANSIColor to colorize a scalar variable. I can see
the variable in the screen output, in color, but its at the top left
corner of the screen instead of the bottom. I have read and searched a
lot on the perl sites and dejanews but have not found an answer. I am
hoping not to have to learn curses... I presume I need something other
than STDOUT for the format but otherwise I am at a loss. Or should it be
an esoteric sprintf($scalar) thing?
Thanks,
Ben
Nairobi
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 8 Jul 1997 12:12:15 GMT
From: scott@lighthouse.softbase.com (Scott McMahan)
Subject: Re: Web Architect
Message-Id: <5ptaqv$4dd$4@mainsrv.main.nc.us>
recruiter (recruiter@lds.com) wrote:
: Logical Design Solutions...has an immediate full-time opening...
: for a Web Architect.
You mean a spider?
Scott
------------------------------
Date: 8 Jul 1997 17:32:15 GMT
From: "mashfiel" <ashfield.matthew@miti.nb.ca>
Subject: Why use 'use strict' ???
Message-Id: <01bc8afb$2d0296a0$3e080a0a@mashfiel.miti.nb.ca>
Hi, sorry for the semi-repost, but did not get any responses from the last.
I have since been reading documentation, ie the FAQ and manpage, but am
still unsure of myself. I have seen numerous times recommendations to use
the
'use strict'
command. From my understanding (albeit limited), this will force all my
variable declarations to be prefixed with
my
correct? So my question is this: Won't this make it impossible to use
Global variables? (I hope this doesn't lead to the discussion on the pros
and cons of Globals, hahaha).
So if I can't use globals, then my new question is this, how do I go about
passing all my variables back and forth to different subroutines? I know
you can pass-by value and pass-by reference, but am unsure of the purpose
and use of each, even after reading the manpage (I really have to get that
Camel book).
From my limited understanding, pass-by-value will allow me to get a copy
of the value of the parameter, but will not allow my subroutine to modify
it. And pass-by-reference will allow me to modify it. Is this correct?
Sorry for all the questions, I guess I need to re-read the docs again, but
hopefully someone out there will be able to let me konw if I'm on the right
track or not.
Thanks for your time,
Mat
ashfield.matthew@miti.nb.ca
------------------------------
Date: Tue, 08 Jul 1997 09:21:35 -0500
From: Buxx <buxx@buxx.com>
Subject: Win32 & FTP
Message-Id: <33C24CEF.5F2B@buxx.com>
Need to ftp multi files via Win95/Win32 perl
Using the NET:FTP copied from my Linux box, I get
4 files of 0 length are uploaded then the process
logs out. Same script works on the Linux box.
Unfortunetly, this has to run on Win95 machines.
anyone know of a NET:FTP module for Win32 Perl or
a multi-file ftp upload/download script without
using the FTP module.
--
/_/_/_/ Steve Vandiver Billings, Missouri, USA
_/ _/ mailto:buxx@buxx.com http://www.buxx.com
_/_/_/ _/ _/ _/ _/ _/ _/ "Find out what you
_/ _/ _/ _/ _/ _/ don't do well, then
/_/_/_/ _/_/_/ _/ _/ _/ _/ don't do it" - Alf
------------------------------
Date: 6 Jul 1997 05:12:39 GMT
From: "Troy High" <thigh@mci2000.com>
Subject: WIN32 Perl head aches!
Message-Id: <01bc89cb$49567320$5b3337a6@troy>
I've read all the faqs, and done all my homework (I think so anyway...)
But I still can't figure out a couple of things:
1) On a Win95 machine, what registry entries do I need to enable the
following things
A. File associations for .PL
Is this literally \perl\bin\perl.exe "%s" "%s"
or just \perl\bin\perl.exe %s %s
Is it also, necessary to do a regular file association for ".PL" in file
explorer?
2) How to I enable this shell-wrapper thingie. I've tried putting in a
registry entry
under My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Activeware\Perl5\
String is "WIN95SHELL" value is "c:\perl\bin\cmd32.exe" ??
Please forgive me if this turns out to be something obvious....
Thanks in Advance, - Troy High
thigh@mci2000.com
----------------------------------------------------------------------------
-----------------------------------------------
"Never go to a dentist who says things like: 'Now THIS is going to really
hurt!' "
- Troy
------------------------------
Date: 8 Jul 1997 12:11:05 GMT
From: scott@lighthouse.softbase.com (Scott McMahan)
Subject: Re: WIN32 Perl head aches!
Message-Id: <5ptaop$4dd$3@mainsrv.main.nc.us>
Michael Adams (msadams@netcom.com) wrote:
: This problem is chronic. I am seeing post after post regarding getting
: Perl for Win32 to work with the Personal Web Server and Window 95, yet
: nothing seems to work.
Well, I have just gotten the PWS, and I want to use it for offline CGI
testing, so if I get it to work, I'll let you know how I did it.
Scott
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 715
*************************************