[17921] in Perl-Users-Digest
Perl-Users Digest, Issue: 81 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 17 14:10:41 2001
Date: Wed, 17 Jan 2001 11:10: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: <979758614-v10-i81@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 17 Jan 2001 Volume: 10 Number: 81
Today's topics:
No such a file or directory <bhendriks@home.nl>
Re: No such a file or directory (Rich Lafferty)
Re: No such a file or directory <a.v.a@home.nl>
Re: OT: .htpasswd on Win32 build (Reini Urban)
Re: OT: .htpasswd on Win32 build <flavell@mail.cern.ch>
Re: overload not autogenerating as expected (Honza Pazdziora)
Re: Passing a parameter to a "sort" sub? (Honza Pazdziora)
passing a variable... what am i doing wrong??? pape_98@my-deja.com
Re: Perl and AOL. How is this possible? rbfitzpa@my-deja.com
problems with waitfor in Net::Telnet when accessing rou <neil@alaweb.com>
Re: Quick Problem dtbaker_dejanews@my-deja.com
TNEF, What is it? Need ver Redhat 6.0 metacomputer1239@my-deja.com
Re: UK PERL PROGRAMMER REQ (David H. Adler)
volume id <eiben@my-deja.com>
Re: volume id mike_solomon@lineone.net
Re: What do you call the => operator? (David H. Adler)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 17 Jan 2001 17:38:16 GMT
From: "Bram Hendriks" <bhendriks@home.nl>
Subject: No such a file or directory
Message-Id: <cMk96.29562$PW5.140550@dbsch1.home.nl>
Hi,
I am a very newbie to CGI-BIN via perl.
I have a problem, I have a red hat linux 6.1 pc with perl etc.
When I'm writing a very simple script (write's ony hello)
and I save it, do chmod 755 script.pl.
But when I start the script for testing
./script.pl
then linux says: No such a file or directory.
but when i do: perl -cw script.pl linux says: syntax OK
then i started the webbrowser and go to
192.168.1.1/cgi-bin/script.pl
I get an error 500 (internal server error)
Could someone help me ??
brhe@dds.nl
------------------------------
Date: 17 Jan 2001 18:24:56 GMT
From: rich@bofh.concordia.ca (Rich Lafferty)
Subject: Re: No such a file or directory
Message-Id: <slrn96boro.rb2.rich@bofh.concordia.ca>
In comp.lang.perl.misc,
Bram Hendriks <bhendriks@home.nl> wrote:
> Hi,
> I am a very newbie to CGI-BIN via perl.
"cgi-bin" is usually the name of a directory. "CGI" is the name of a
gateway interface, and is not Perl. You're new to Perl, though. :-)
> When I'm writing a very simple script (write's ony hello)
>
> and I save it, do chmod 755 script.pl.
>
> But when I start the script for testing
> ./script.pl
> then linux says: No such a file or directory.
At the top of your file, you'll have a line similar to
#!/usr/bin/perl -w
which tells the kernel what to run the program with. The "No such file
or directory" is referring to that line, which is pointing to
somewhere that perl *isn't*.
> but when i do: perl -cw script.pl linux says: syntax OK
This verifies the above; you're explicitly asking Perl to run the
program in this case.
> then i started the webbrowser and go to
> 192.168.1.1/cgi-bin/script.pl
>
> I get an error 500 (internal server error)
Walk, then run.
-Rich
--
Rich Lafferty ----------------------------------------
Nocturnal Aviation Division, IITS Computing Services
Concordia University, Montreal, QC
rich@bofh.concordia.ca -------------------------------
------------------------------
Date: Wed, 17 Jan 2001 18:26:24 GMT
From: AvA <a.v.a@home.nl>
Subject: Re: No such a file or directory
Message-Id: <3A65E574.84D0B00D@home.nl>
--------------DF7D4A232BADD1258C6721A6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Bram Hendriks wrote:
> Hi,
> I am a very newbie to CGI-BIN via perl.
>
> I have a problem, I have a red hat linux 6.1 pc with perl etc.
>
> When I'm writing a very simple script (write's ony hello)
>
> and I save it, do chmod 755 script.pl.
>
> But when I start the script for testing
> ./script.pl
> then linux says: No such a file or directory.
be sure to be in the right directory
>
>
> but when i do: perl -cw script.pl linux says: syntax OK
>
> then i started the webbrowser and go to
> 192.168.1.1/cgi-bin/script.pl
did u save script.pl in : /home/httpd/cgi-bin?
>
>
> I get an error 500 (internal server error)
> Could someone help me ??
>
Could be that the path to perl is wrong (in redhat 6.1 it should read
#!/usr/bin/perl i believe)
and check your httpd.conf file (addhandler cgi is disabled by default)
The latter is more of a server problem then a perl problem.
--
AvA
irc.xchat.org #perl
--------------DF7D4A232BADD1258C6721A6
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Bram Hendriks wrote:
<blockquote TYPE=CITE>Hi,
<br>I am a very newbie to CGI-BIN via perl.
<p>I have a problem, I have a red hat linux 6.1 pc with perl etc.
<p>When I'm writing a very simple script (write's ony hello)
<p>and I save it, do chmod 755 script.pl.
<p>But when I start the script for testing
<br>./script.pl
<br>then linux says: No such a file or directory.</blockquote>
be sure to be in the right directory
<blockquote TYPE=CITE>
<p>but when i do: perl -cw script.pl linux says: syntax OK
<p>then i started the webbrowser and go to
<br>192.168.1.1/cgi-bin/script.pl</blockquote>
did u save script.pl in : /home/httpd/cgi-bin?
<blockquote TYPE=CITE>
<p>I get an error 500 (internal server error)
<br>Could someone help me ??
<br> </blockquote>
Could be that the path to perl is wrong (in redhat 6.1 it should read #!/usr/bin/perl
i believe)
<br>and check your httpd.conf file (addhandler cgi is disabled by default)
<br>The latter is more of a server problem then a perl problem.
<br>
<pre>--
AvA
irc.xchat.org #perl</pre>
</html>
--------------DF7D4A232BADD1258C6721A6--
------------------------------
Date: Wed, 17 Jan 2001 16:59:50 GMT
From: rurban@sbox.tu-graz.ac.at (Reini Urban)
Subject: Re: OT: .htpasswd on Win32 build
Message-Id: <3a65cf05.2968857791@judy>
try@try.com wrote:
>> I dont think you can... I am not aware of any win32 webserver that
>> recognizes the .htaccess construct. It is ignored on win32 machines. If
>> you have code in place that checks for REMOTE_USER, one thing you can do
>> is check the OS, and step around it if you are running on win32.
wrong.
is is completely the same on my win32 and linux machines.
even the same apache "bugs".
I just have to take care with the #! cgi paths.
regardless if the apache is compiled with msvc or cygwin.
------------------------------
Date: Wed, 17 Jan 2001 19:10:49 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: OT: .htpasswd on Win32 build
Message-Id: <Pine.LNX.4.30.0101171900440.23243-100000@lxplus003.cern.ch>
On Thu, 11 Jan 2001 dtbaker_dejanews@my-deja.com wrote:
(in answer to an off-topic question about Apache)
> I am not aware of any win32 webserver that
> recognizes the .htaccess construct.
Which only goes to show what rubbish answers are to be expected by
posting off-topic.
Get thee to comp.infosystems.www.servers.ms-windows (crossposted and
f'ups set) where the issue can be more usefully explored. If the
original poster doesn't have access to that group then _that_ is their
first priority to solve: meantime they can be directed to the tender
mercies of www.deja.com/usenet ; posting on ludicrously off-topic
groups is no substitute, as this pointless exchange has demonstrated.
> It is ignored on win32 machines.
Drivel. Read the Apache Win32 documentation.
> If
> you have code in place that checks for REMOTE_USER, one thing you can do
> is check the OS, and step around it if you are running on win32.
[turns eyes heavenward and prays for some kind of relief...]
xpost and f'up.
------------------------------
Date: Mon, 15 Jan 2001 10:11:56 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: overload not autogenerating as expected
Message-Id: <G778Bw.LKI@news.muni.cz>
On Sun, 14 Jan 2001 21:40:07 GMT, mintcake@my-deja.com <mintcake@my-deja.com> wrote:
> I wasn't going to dignify Art's last message with a reply. However, I
> really do want an intelligent response to my original query and I can
> see it slipping down the list. Is there anybody really serious out
> there?
???
You got three responses explaining that you either stringify
explicitely or use fallback => 1. What else do you expect?
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
.project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------
------------------------------
Date: Mon, 15 Jan 2001 18:32:31 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Passing a parameter to a "sort" sub?
Message-Id: <G77vI7.Ewp@news.muni.cz>
On 15 Jan 2001 17:27:51 GMT, Mary Ellen Foster <mef@cogsci.ed.ac.uk> wrote:
>
> Non-compiling code below:
>
> # The next line is line 31:
> foreach my $key ( sort bytime('total') ( keys %results )) {
> print $key . ': ' . $results{$key}->{name} . "\n";
> }
>
> sub bytime {
> my $field = shift;
> @afields = split /:/, $results{$a}->{$field};
> @bfields = split /:/, $results{$b}->{$field};
[...]
> Result of trying to run the above:
> syntax error at ./process-results.pl line 31, near ") ("
> Execution of ./process-results.pl aborted due to compilation errors.
>
> Given what it says in "perldoc -f sort" about the subroutine-calling
> mechanism being munged for use in sort, I suspect that something like the
> above isn't possible. But just in case I'm doing something stupid, I
You should specify a block and you need to access the magic $a and $b
in that block. Along the lines of
foreach my $key ( sort { bytime('total', $a, $b) } ( keys %results )) {
[...]
sub bytime {
my ($field, $a, $b) = @_;
[...]
Your way may also work but I suspect when you specify the parameter,
it is not recognized as a subroutine name and so the special calling
procedures described in the man page don't apply.
Hope this helps,
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
.project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------
------------------------------
Date: Wed, 17 Jan 2001 18:42:12 GMT
From: pape_98@my-deja.com
Subject: passing a variable... what am i doing wrong???
Message-Id: <944p22$aql$1@nnrp1.deja.com>
Hi all,
I know this is something minor, but hopefully you guys can see this and
let me know cause i sure can't.
OK. I have a script in which i'm tryin to pass a variable through a
form. Here's what the form looks like:
$dir is a variable that's used throughout the script, and I want to
pass it to another script.
print OUT1 ("
<td ALIGN=LEFT WIDTH=\"84\" BGCOLOR=\"#FFFFFF\" rowspan=\"4\">
<form method=\"POST\" style=\"float:
left\"action=\"http://zeus.nhlbi.nih.gov/cgi-bin/pape/save.pl\">
<p><input type=\"submit\" value=\"Save Changes\" name=\"$dir\"
style=\"border-style: solid; border-width: 1\"></p>
<input type=\"hidden\" name=\"$dir\" value=\"$dir\"></form>
<form method=\"POST\" style=\"float: left\"
action=\"http://zeus.nhlbi.nih.gov/cgi-bin/pape/delete.pl\">
<p><input type=\"submit\" value=\"Delete\" name=\"$dir\" style=\"border-
style: solid; border-width: 1\"></p>
<input type=\"hidden\" name=\"$dir\" value=\"$dir\"></form>
</td> \n
");
Now this is the script i want to pass it to:
#!/usr/local/bin/perl -w
use File::Copy;
use CGI qw(:standard);
print header, start_html("DELETE");
my $dir = param("$dir");
$tail = "p.html";
$bak = "p.bak";
$original ="/applications/apache/htdocs/dl/publications/html/$dir$tail";
$bakfile ="/applications/apache/htdocs/dl/publications/html/$dir$bak";
printf "$bakfile\n";
printf $original;
copy ("$bakfile", "$original");
I know there are 2 forms in the first statement, but i want to pass the
variable to both of them. I thought that this was the way to do it
because i've done it in a way similar to this, but now it's not working.
can anyone tell me why?
Thanks,
Peace
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 17 Jan 2001 16:39:08 GMT
From: rbfitzpa@my-deja.com
Subject: Re: Perl and AOL. How is this possible?
Message-Id: <944hra$3ou$1@nnrp1.deja.com>
G.A.D.Miles,
It seems like Abigail is correct in this situation, I can understand the
frustration. First off, you need to understand how the banner exchange
program was designed and you should include some piece of code when
posting here so someone can explain how it works.
Perl does not run in a browser and in most cases the server does not do
the redirect. If you wrote custom scripts then your on your own until
you share at least part of them so someone can help analyze them for
you. If you are in fact using the server to redirect pages then you need
to familiarize yourself with http0.9 - http1.1 protocols and actually
analyze what the AOL browser is sending (POSTing) to your scripts - I'm
sure you only need to modify your parsing method to get this working.
Most banner pages are dynamically created on the server and when you
click on the ad via a browser a response never gets sent back to the
server (at least not without some special coding - javascript etc.). I
believe this is where the confusion lies but it's up to you to clarify
your situation.
In article <3a605397.7747790@news.newsguy.com>,
usad1@gadnet.com (G.A.D.Miles) wrote:
> I have written some perl scripts for running your own banner exchange.
> When you click on a banner it takes you to the appropriate site. This
> works fine in all browsers. However, if you right click on a banner
> and opt to open the page in a new browser window, it works fine in IE
> and Netscape, but in AOL the script cannot find the site and returns
> the default URL location.
>
> How can this be possible since it is the server, not the browser that
> is running the code?
>
> Regards,
>
> Drummond Miles
> BannerPlus
> http://www.gadnet.com/bplus
>
>
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 17 Jan 2001 10:55:11 -0600
From: "Neil" <neil@alaweb.com>
Subject: problems with waitfor in Net::Telnet when accessing routers
Message-Id: <t6bjilgoe2005f@corp.supernews.com>
Hi !
I am using Net::Telnet to login to Cisco and 3Com routers and retrieve
certain info from them. Because of the length of the info, I am forced to
turn the page length off on the Ciscos or set it to max on the 3Coms
before I retrieve this info ... otherwise I have a --More-- appear that I
have
not been able to get around. However, when I change the page lengths, it
appears to break the output of the waitfor, as in
($prematch,$match)=$obj->waitfor ($prompt);
For example....
# code begin
$ok = $core_router->print("who");
($prematch,$match) = $core_router->waitfor($box_prompt);
print $prematch;
#code end
prints out (\n's expanded for clarity)
who
Line User Host(s) Idle Location
1 tty 1 julanjak Async interface 00:00:08
3 tty 3 adams Async interface 00:00:02
4 tty 4 tcw Async interface 00:00:00
cs52-4c
just as expected, all the output of the "who" command is captured in the
$prematch,match combo
however
# code begin
$ok = $core_router->print("term len 0");
$ok = $core_router->print("who");
($prematch,$match) = $core_router->waitfor($box_prompt);
print $prematch;
#code end
prints out (\n's expanded for clarity)
term len 0
cs52-4c
unfortunately, here, $prematch and $match have only captured up to the
"who" command....
Somehow, it seems like setting a new page length, on either brand of
router, affects the scripts ability to capture the input from the router in
the
waitfor command.
All the in/output does appear in the dump_log and the input_log .... so
something is capturing it.
Any help is greatly appreciated !
Sincerely,
Neil
PS - Any help on getting around the --More-- would be appreciated as well
... it shows in the logs .... but I can't seem to capture it internally !
------------------------------
Date: Wed, 17 Jan 2001 16:08:42 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: Quick Problem
Message-Id: <944g23$23d$1@nnrp1.deja.com>
In article <944eok$uh$1@nnrp1.deja.com>,
contact@stevencoutts.org.uk wrote:
> OK I need to make a quick change to a script. What I have is a form
> processing script that emails the contents of a form. I want to edit
> this script so that if for example the name filled in on the form was
> equal to 'letmein' then it would re-direct to another page.
>
> Can anyone give me an example of how I would structure the if
> statements etc with some example code? Perl is not my strong point!!
----------
if ( $name eq 'letmein' ) { print "Location: http://www.yoururl.com
\n\n" }
however, if you are not very familiar with perl, you might want to hire
someone to take a look at what you are doing to check for security
problems and other common issues with forms that email things. ;)
D
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 17 Jan 2001 17:01:01 GMT
From: metacomputer1239@my-deja.com
Subject: TNEF, What is it? Need ver Redhat 6.0
Message-Id: <944j46$519$1@nnrp1.deja.com>
Does anyone know were I can get TNEF for Red Hat 6.0? Is this a Perl
script or module?
Thank You
Bob
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 17 Jan 2001 18:29:48 GMT
From: dha@panix2.panix.com (David H. Adler)
Subject: Re: UK PERL PROGRAMMER REQ
Message-Id: <slrn96bp4s.jo8.dha@panix2.panix.com>
On Wed, 17 Jan 2001 10:54:31 +0000, roadsweeperman@hotmail.com wrote:
>We are a mobile phone mail order company looking for a reliable
>freelance perl specialist to adapt off the shelf e-commerce scripts to
>our needs.
They you should do so in an apropriate forum.
You have posted a job posting or a resume in a technical group.
Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.
Had you read and understood the Usenet user manual posted frequently
to "news.announce.newusers", you might have already known this. :) (If
n.a.n is quieter than it should be, the relevent FAQs are available at
http://www.faqs.org/faqs/by-newsgroup/news/news.announce.newusers.html)
Please do not explain your posting by saying "but I saw other job
postings here". Just because one person jumps off a bridge, doesn't
mean everyone does. Those postings are also in error, and I've
probably already notified them as well.
If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.
There is a Perl Jobs Announce list that may be more helpful to you. See
<http://www.pm.org/mailing_lists.shtml> for details.
Yours for a better usenet,
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Naturally, like you, I was incensed, and immediately used my
U.S. Second Amendment rights to buy a duffel bag full of machine guns
for a shooting spree at the office. - Jon Orwant
------------------------------
Date: Wed, 17 Jan 2001 17:47:30 GMT
From: Henning Eiben <eiben@my-deja.com>
Subject: volume id
Message-Id: <944lre$7o6$1@nnrp1.deja.com>
Hi,
is there a way I can read the volume id (aka serial number in DOS/Win
when I do a "dir") using perl?
--
Henning Eiben
Application Engineer busitec GmbH
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 17 Jan 2001 18:20:58 GMT
From: mike_solomon@lineone.net
Subject: Re: volume id
Message-Id: <944npu$9ji$1@nnrp1.deja.com>
In article <944lre$7o6$1@nnrp1.deja.com>,
Henning Eiben <eiben@my-deja.com> wrote:
> Hi,
>
> is there a way I can read the volume id (aka serial number in DOS/Win
> when I do a "dir") using perl?
>
> --
> Henning Eiben
> Application Engineer busitec GmbH
>
> Sent via Deja.com
> http://www.deja.com/
This is a bit of a brute force and ignorance way but it works
use strict;
#get volume number
my $vol = `vol`;
#strip unnecessary information from vol command
$vol =~ s/^.+\n.+is //g;
print $vol;
I hope this helps
There may well be a more elegant way of doing it
Regards
Mike Solomon
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 17 Jan 2001 18:32:25 GMT
From: dha@panix2.panix.com (David H. Adler)
Subject: Re: What do you call the => operator?
Message-Id: <slrn96bp9p.jo8.dha@panix2.panix.com>
On Wed, 17 Jan 2001 19:15:33 +1100, Martien Verbruggen
<mgjv@tradingpost.com.au> wrote:
>tiny little bit of research [1], you could have found out that Tad is a
>well respected poster here, who has been around a bit longer than you
>have.
The use of the phrase "a bit" here gets my vote for understatement of
the month. Congratulations Martien! ;-)
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"...for all you know we're a bunch of malcontents who couldn't get
sci.corned-beef, and are going to reject all the submitted articles
that aren't about corned beef." - Mark-Jason Dominus
------------------------------
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 V10 Issue 81
*************************************