[10950] in Perl-Users-Digest
Perl-Users Digest, Issue: 4551 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 5 07:07:44 1999
Date: Tue, 5 Jan 99 04:00:18 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 5 Jan 1999 Volume: 8 Number: 4551
Today's topics:
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Re: BEGIN { local $/="\n" } clobbers global $/ <dgris@moiraine.dimensional.com>
Re: BEGIN { local $/="\n" } clobbers global $/ (Alan Curry)
Re: Getting at stderr (Alan Curry)
Re: Indirection help please <Richard@nugget.demon.co.uk>
Installtion Problem: Compiler - 'B' for PERL <partha@mihy.mot.com>
Re: Is mod_perl an option? <chatmaster@c-zone.net>
Re: mod_perl and database connections pault12@postoffice.pacbell.net
newline <peter.herger@swisslife.ch>
Re: newline <gmj@netaxis.com>
Re: newline <partha@mihy.mot.com>
Re: News scripts <muskrat@lvnworth.com>
Re: OK I give up (After a WEEK!) (J|rgen P|nter)
Perl and CR+LF <thadden@bbaw.de>
problem with XS <kozo@pobox.sk>
Re: Sync time script??? (John Stanley)
why this doesn't work etrim@my-dejanews.com
working with files <Mike.matton@student.kulak.ac.be>
Re: working with files <gmj@netaxis.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 05 Jan 1999 11:24:11 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage915535441.24490@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 10 Sep 1998
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://cpan.perl.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://cpan.perl.org/
http://www.perl.com/CPAN/
http://cpan.perl.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:
setdir usenet-by-group/news.announce.newusers
send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 05 Jan 1999 01:16:25 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: BEGIN { local $/="\n" } clobbers global $/
Message-Id: <m3pv8u9lt2.fsf@moiraine.dimensional.com>
Andrew Johnson <ajohnson@gatewest.net> writes:
> odd... I don't see with 5.00502:
>
> $ perl -le 'BEGIN{print defined $/}'
> 1
> $ perl -v
>
> This is perl, version 5.005_02 built for i586-linux
Your perl must be unthreaded. I see the problem on
5.005_02-thread, but not 5.005_02-nothread. It does
not occur in either version of 5.005_54, nor does it
occur in either version of the forthcoming 5.005_03.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Tue, 05 Jan 1999 08:36:46 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: BEGIN { local $/="\n" } clobbers global $/
Message-Id: <yakk2.7$pS.39@news6.ispnews.com>
In article <76saik$7sb$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
>
> % perl5.00502 -le 'BEGIN { print defined $/ }'
> 1
>
>What am I missing?
Apparently it's thread-related. Some threading fanatic put a thread-enabled
perl binary package on contrib.redhat.com, and like an idiot I used it.
% ./Configure -des -Dusethreads ; ./perl -le 'BEGIN { print defined $/ }'
% ./Configure -des ; ./perl -le 'BEGIN { print defined $/ }'
1
Luckily I don't want threads, so I'll just leave them turned off.
--
Alan Curry echo cnpzna@pdp.pbz | tr a-z n-za-m
The lbxproxy program has various options, all of which are optional.
-- lbxproxy(1)
------------------------------
Date: Tue, 05 Jan 1999 08:44:01 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Getting at stderr
Message-Id: <lhkk2.5$3k1.159@news7.ispnews.com>
In article <76sbnu$ev2$1@grapevine.lcs.mit.edu>,
David Evans <evs@sds.lcs.mit.edu> wrote:
>I am trying to find a way to use the stderr output in a perl script. For
>example, I want to do:
>
> open(ROUT, "command |")
> while (<ROUT>) {
> print;
> }
>
>But get the command's <stderr> output instead of its stdout.
>
>Any suggestions?
>
open(ROUT, "command 2>&1 |") # stderr and stdout together
open(ROUT, "command 2>&1 >/dev/null |") # stderr only, stdout to /dev/null
man sh
--
Alan Curry echo cnpzna@pdp.pbz | tr a-z n-za-m
The lbxproxy program has various options, all of which are optional.
-- lbxproxy(1)
------------------------------
Date: Mon, 4 Jan 1999 17:44:19 +0000
From: Richard <Richard@nugget.demon.co.uk>
Subject: Re: Indirection help please
Message-Id: <V10MFOAz3Pk2EwQ8@nugget.demon.co.uk>
In article <ebohlmanF4s98F.24L@netcom.com>, Eric Bohlman
<ebohlman@netcom.com> writes
>1) For this to work, your arrays (@Form, etc.) will have to be global
>variables, not lexical ("my") variables.
Ah, that's where I was going wrong.
>
>2) If you've done a "use strict" (highly recommended), you'll need to
>enclose the above code in a block that starts with "no strict refs".
Yes, always use strict as I've seen it recommended so often!
>
>3) You really ought to rethink your data structures so you don't have to
>do this. Rather than having 5 parallel arrays with their own names, why
>not use a hash of arrays, keyed by the parameter names? Take a look at
>the perldata, perlref, perllol and perldsc documents for some hints.
Thank you very much indeed. Further RTFM of these particular documents
revealed how to use a hash of lists and it now works perfectly. You are
a gentleman.
Cheers
Richard
--
Richard Eyles | General techie anorak
Principal Pharmacist Computer Services | DOS Win95 AIX HP-Unix (just)
Queen Alexandra Hospital, Portsmouth | TCPIP IPX Novell
------------------------------
Date: Wed, 06 Jan 1999 15:59:16 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
Subject: Installtion Problem: Compiler - 'B' for PERL
Message-Id: <36933AFC.D39F4FE9@mihy.mot.com>
Hi,
I was trying to install the 'C' compiler for PERL - 'B'. The PERL
version is:5.005_02. The Compiler version is :a3. I got the following
errors when I was trying to 'make':
"B.c", line 313: undefined symbol: main_cv
"B.c", line 313: warning: improper pointer/integer combination: op "="
"B.c", line 330: undefined symbol: main_root
"B.c", line 330: warning: improper pointer/integer combination: op "="
"B.c", line 346: undefined symbol: main_start
"B.c", line 346: warning: improper pointer/integer combination: op "="
"B.c", line 362: undefined symbol: main_cv
"B.c", line 362: left operand of "->" must be pointer to struct/union
"B.c", line 362: undefined symbol: compcv
"B.c", line 362: left operand of "->" must be pointer to struct/union
"B.xs", line 378: undefined symbol: minus_c
"B.c", line 1033: undefined struct/union member: op_pmshort
"B.c", line 1033: warning: improper pointer/integer combination: op "="
"B.c", line 1104: undefined struct/union member: op_pmslen
cc: acomp failed for B.c
*** Error code 2
make: Fatal error: Command failed for target `B.o'
Can anyone help?
Thank you
------------------------------
Date: Tue, 05 Jan 1999 00:38:25 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Is mod_perl an option?
Message-Id: <3691CF81.FB302F8@c-zone.net>
The Smiths wrote:
>
> I am running ActivePerl build 508 and Apache 1.3.3 on Win95. Is mod_perl an
> option in this configuration? I didn't see it available as a module for
> this flavor of Perl but wasn't sure.
>
> Thanks,
> Tim Smith
> CDS Web Services, Inc.
Well, if you have access to NT, then go for it.. But I don't know of
anyone with Win95 that has used this. I will consider it myself if I
know someone has indeed had success, otherwise I'll give install NT. You
may also look into fastcgi and see if that's more possible/stable.
Good luck
--
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application
Copyright ) 1999 TRG Software and The Link Worm.
------------------------------
Date: Tue, 05 Jan 1999 01:04:39 -0800
From: pault12@postoffice.pacbell.net
Subject: Re: mod_perl and database connections
Message-Id: <3691D5A6.BD426D5E@postoffice.pacbell.net>
Exactly.
> ... 'MiddleWare' application servers are quite a
> bit more scalable. They add an extra layer, but often can be
> optimized in ways that web severs can't be.'
There is some example of such 'MiddleWare'. Pre-alpha version of my Perl
Application Server available at http://www.iscusa.com/~paul/home/
Next week I'l place the next version that would show how to use this
technology in combination with Text::BasicTemplate, Text::Template
(and actualy, with any module you'l like). Even incomplete, existing
version already allows you to open one database connection - and use it
forever. Well... You can do many things with that 'middleware'.... For
example,
I'm caching cgi input-output so that backend is bothered only when all data
are
in place... e t.c.
The problem here is that mod_perl provides perl code persistency, but it is
not providing data presistency (well, you can achive it, but it is the
'trick', but
not the original design of mod_perl). Fast-CGI provides both, but also has
some (another) problems. Actualy, when your application grows... for 6 months
or longer... Things are not going better with mod_perl or Fast-CGI.... Even
both
solutions are realy cool.
Rgds.Paul.
PS. I'l be glad to get your feedback on PAS, because my idea was to
place PAS on CPAN ... if I'm not the only person in the world who is
interested in such solutions...
[posted & mailed]
>
> corus <corus@my-dejanews.com> wrote:
> : I was recently reading about mod_perl and the wonders it can do,
> : especially in cases of scripts with high overheads. The text went on to
> : say that mod_perl is particularly beneficial to database accessing
> : scripts, as connections don't need to be closed but are reused through
> : successive invocations, as the script never really dies.
>
> This can be very good or very bad, depending on the application.
>
> : Here's the question:
> : What happens with database connections (or other shared resources) if
> : two invocations take place at the same time?
>
> Each child server has its own copy of the mod_perl script and any
> resources it uses. -This is why the above can be very bad, as if
> your server desides to spawn 50 children (not uncommon at all)
> you've got 50 open database connections under Apache::DBI (even if
> only 1 is ever in use at any given point in time...). Two scripts
> need to use two different logins? Make that 100 connections,and on
and on...
>
> It scales great in some cases, and like mud in many others. Java
> Servlets have similar problems with cached resources inside web
> servers. This is why "MiddleWare" application servers are quite a
> bit more scalable. They add an extra layer, but often can be
> optimized in ways that web severs can't be.
>
> : Would I have to provide some sort of 'database connection' locking
> : mechanism so that the second request doesn't try to use the same
> : connection as the first one is using?
>
> No need. See above about each child server having its own
> copy/connection already. A child (under most web servers) will
> never be handling more then one request at a time.
>
> : Do I in general open a number of database connections on startup and
> : keep them waiting for clients?
>
> No. Under Apache::DBI the first DBI->connect() that happens in a
> script will cause the open. Latter connect() requests will see
> the cached copy and try to ping() it, returning the cached copy if
> it is alive or reconnecting if it's dead/timed out.
>
> : Any advice/sample code is appreciated.
>
> perldoc Apache::DBI
>
> --
> -Zenin (zenin@archive.rhps.org)
------------------------------
Date: Tue, 05 Jan 1999 10:19:50 +0100
From: Herger Peter <peter.herger@swisslife.ch>
Subject: newline
Message-Id: <3691D936.1253AC2F@swisslife.ch>
Hi all
I've wrote a script like the following.
#!/usr/bin/perl -w
######################################################################
# (c) Herger Peter 29.12.98 peter.herger@swisslife.ch
#This script gets the configfiles ones per week from the first
#device on each router and stores it on
su8000/usr/net/routers/rtconfigs/
#
######################################################################
use Net::FTP;
$date = `date '+%m%d'`;
$storedir = `date '+log%m%d'`;
`mkdir /usr/net/routers/rtconfigs/$storedir`;
#**************************** wfhgtv1 ********************************
$dir = "1:";
$host = "wfhgtv1";
$ftp = Net::FTP->new($host, Timeout => 60) ||
die "Cannot connect: $host";
$ftp->login("Manager", "mars97ib") || die "Login failed";
$ftp->cwd($dir) || die "Directory $dir doesn't exist";
$ftp->binary();
$ftp->get("config" ,
"/usr/net/routers/rtconfigs/$storedir/confhgtv1.$date");
$ftp->quit();
#********************************************************************
But in the second last line, there is a problem. The variable $storedir
always includes a \n at the end. How can I suppress this \n ?
Thanks a lot
Peter Herger
------------------------------
Date: Tue, 05 Jan 1999 11:08:36 +0000
From: "Geir Magnusson Jr." <gmj@netaxis.com>
Subject: Re: newline
Message-Id: <3691F2B4.B3B76359@netaxis.com>
Herger Peter wrote:
>
> Hi all
>
> I've wrote a script like the following.
>
> #!/usr/bin/perl -w
> ######################################################################
> # (c) Herger Peter 29.12.98 peter.herger@swisslife.ch
> #This script gets the configfiles ones per week from the first
> #device on each router and stores it on
> su8000/usr/net/routers/rtconfigs/
> #
> ######################################################################
>
> use Net::FTP;
> $date = `date '+%m%d'`;
<snip>
> "/usr/net/routers/rtconfigs/$storedir/confhgtv1.$date");
>
> $ftp->quit();
> #********************************************************************
>
> But in the second last line, there is a problem. The variable $storedir
> always includes a \n at the end. How can I suppress this \n ?
you are getting the extra newline from the date command.
chop $storedir;
You might want to do the same for $date for completeness.
geir
[courtesy cc to peter.herger@swisslife.ch]
--
Geir Magnusson Jr.
gmj@netaxis.com
Perl's garbage collector abhors a naked circularity. -tc
Chase the dream, not the competition.
------------------------------
Date: Wed, 06 Jan 1999 16:09:09 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
To: Herger Peter <peter.herger@swisslife.ch>
Subject: Re: newline
Message-Id: <36933D4D.C7CF73FB@mihy.mot.com>
Use a chomp() - every output you get out of the back-tics from the system
usuallly has a "\n" at the end of the output. So, the following should work
- check it out!
> #!/usr/bin/perl -w
> use Net::FTP;
> $date = `date '+%m%d'`;
chomp($date);
> $storedir = `date '+log%m%d'`;
chomp($storedir);
> `mkdir /usr/net/routers/rtconfigs/$storedir`;
>
> $dir = "1:";
> $host = "wfhgtv1";
>
> $ftp = Net::FTP->new($host, Timeout => 60) ||
> die "Cannot connect: $host";
>
> $ftp->login("Manager", "mars97ib") || die "Login failed";
>
> $ftp->cwd($dir) || die "Directory $dir doesn't exist";
> $ftp->binary();
> $ftp->get("config" ,
> "/usr/net/routers/rtconfigs/$storedir/confhgtv1.$date");
>
> $ftp->quit();
------------------------------
Date: Mon, 04 Jan 1999 07:23:15 -0600
From: Matthew Musgrove <muskrat@lvnworth.com>
Subject: Re: News scripts
Message-Id: <3690C0C3.E14BD56E@lvnworth.com>
Gary Peake wrote:
> stanley@skyking.OCE.ORST.EDU scribed to us about Re: News scripts in
> comp.lang.perl.misc
>
> >In article <MPG.10f5cb251407b257989682@news.slip.net>,
> >Spawn <spawn90@my-dejanews.com> wrote:
>
> >>I need a script that can post time, date, updater
> >>name, and news of course. I've been using News Update 1.1 but I
> >>don't like it. Thanks in advance!
>
> >So you want an NNTP server? INN.
>
> No, he is looking for a cgiprogram as I am that will allow one to post
> a news page on their website and easily update that page from a web
> browser. I have looked at News Update as well as NewsDesk.
>
> Neither does what I want, which is ease of use and a nicely generated
> page.
>
> --
> Gary Peake PLEASE NOTE NEW EMAIL ADDRESS!!
>
> Team AMIGA - OwlNet Net
> gary@owlnet.net
> http://www.owlnet.net (coming soon)
http://www.slashdot.org/code.shtml
--
Amoebit: Amoeba/rabbit cross; it can multiply and divide at the
same time.
Matthew Musgrove - muskrat@lvnworth.com
------------------------------
Date: 5 Jan 1999 10:01:47 GMT
From: Juergen.Puenter@materna.de (J|rgen P|nter)
Subject: Re: OK I give up (After a WEEK!)
Message-Id: <76snub$9u$1@penthesilea.Materna.DE>
In article <placeit-0401992224420001@blv-lx100-ip18.nwnexus.net>,
placeit@easyad.com says...
>
>
>#!/usr/bin/perl
Using perl -w is always a good idea.
>foreach (@keyemail) {
>
>($field1,$field2) = split(/\\t/);
>
> if ($field2 = $email) { #changed this
> $email_found = 1;
> }
>}
Here's the problem. The foreach doesn't stop checking each
line of @keyemail once it has found a match. It just sets
$email_found to 1 and continues with the next line. When
it is done with @keyemail, you have the contents of the last
line in $field1 and $field2 - regardless of where the match
occured.
You could just add something like
$matched_password = $field1;
after
$email_found = 1;
and 'remember' the correct password that way. Modify the
rest of your script accordingly and it should work (didn't
test it).
Oh, BTW, shouldn't that be
if ($field1 = $email) {
^
instead of
if ($field2 = $email) { ?
^
HTH
Juergen Puenter
------------------------------
Date: Tue, 05 Jan 1999 12:45:43 +0100
From: Joachim von Thadden <thadden@bbaw.de>
Subject: Perl and CR+LF
Message-Id: <3691FB67.39CA089@bbaw.de>
Hi!
This is an obsolete problem in the 20th century, but it still exists. I
have users who write perl-cgi-scripts on Win95-Clients and transfer them
by samba to a linux host, where they should be executed. But the perl
version on linux doesn't want to deal with the line endings (CR+LF). Is
there, despite of conversing the scripts, a perl parameter to tell it to
take a different lineending? Otherwise I have to use a wrapper, which is
not a nice solution.
MfG/Sincerely
Joachim von Thadden
________________________________________________________________________
Berlin-Brandenburg Academy of Sciences Joachim von Thadden
Jaegerstrasse 22-23 System Administration
10117 Berlin thadden@bbaw.de
http://www.bbaw.de phone +49 +30 203 70 375
------------------------------
Date: 5 Jan 1999 11:10:41 GMT
From: kozo <kozo@pobox.sk>
Subject: problem with XS
Message-Id: <76srvh$c66@gringo.somi.sk>
I trying write extension in C ..but I have a problem ..
I have in C function
extern int
eparse (char *filename,
HASH* cmds,
FILE *stream)
in typemap I have:
TYPEMAP
HASH * T_PTR
FILE * T_IN
--- eparse.h ---
/* eparse header file */
extern int
eparse (char *filename, HASH* cmds, FILE *stream)
--------------
I made Eparse from h2xs -x -n Eparse eparse.h
and Error after make:
In file included from Eparse.xs:11:
eparse.h:4: parse error before `HASH'
any idea ?
-------------
----------------------------------------------------
posted by WWWNews gateway v1.12
(c) 1997 Somi Systems Ltd. http://www.somi.sk/
somi.sk is NOT the originators of the articles
and are NOT responsible for their content.
------------------------------
Date: 5 Jan 1999 08:00:58 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Sync time script???
Message-Id: <76sgrq$r7u$1@news.NERO.NET>
In article <76s170$4j7$1@nd.eastky.net>,
Webmaster <webmaster@somewhere.com> wrote:
>try this as a crontab command instead.
>
>rdate -e www.fyi.net > /dev/null
Giving someone you don't know control over your system clock is a
foolish thing to do. Setting your clock this way may result in bogus
times.
If you can't find someone to ntpd off of, find someone really close you
trust to rdate from.
------------------------------
Date: Tue, 05 Jan 1999 09:36:40 GMT
From: etrim@my-dejanews.com
Subject: why this doesn't work
Message-Id: <76smf8$n39$1@nnrp1.dejanews.com>
hi, i thought crating a simple perl script (and i have to do it in perl) and
calling it from web site would work but it didn't (i don't know much about
perl).
This is what i want: i want to display an image (only one static image) on the
HTML page by calling a perl script.
HTML page:
<HTML><BODY><IMG SRC="http://host/cgi-bin/myscript.pl"></BODY></HTML>
myscript.pl script:
#!/usr/bin/perl
$image = "http://host/myimage.gif";
print $image;
The script is chmod 755 (tried 777) but it gives me 500 internal server error.
If i execute the script from unix it correctly outputs http://host/myimage.gif
and therefore i think it should correctly put that into HTML: <IMG
SRC="http://host/myimage.gif"> but it doesn't do that.
Any help would be appreciated,
thanx
Erik.
P.S. Later on, the plan is to add something like this: <HTML><BODY><IMG
SRC="http://host/cgi-bin/myscript.pl?ID=myid"></BODY></HTML> which will count
how many times the image myimage.gif was displayed by the page containing ID
myid
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 05 Jan 1999 10:34:06 +0100
From: Mike Matton <Mike.matton@student.kulak.ac.be>
Subject: working with files
Message-Id: <3691DC8E.FBBC0903@student.kulak.ac.be>
Does someone know how you can write text into a file.
If so, please answer this message.
Thanks
------------------------------
Date: Tue, 05 Jan 1999 11:13:54 +0000
From: "Geir Magnusson Jr." <gmj@netaxis.com>
Subject: Re: working with files
Message-Id: <3691F3F2.F24780D5@netaxis.com>
Mike Matton wrote:
>
> Does someone know how you can write text into a file.
> If so, please answer this message.
>
open(MYFILE, ">myfile.txt")|| die "Error opening file : $!";
print MYFILE "Perl and files! Files and Perl!\n"
close(MYFILE);
[cc to Mike.matton@student.kulak.ac.be]
geir
--
Geir Magnusson Jr.
gmj@netaxis.com
Perl's garbage collector abhors a naked circularity. -tc
Chase the dream, not the competition.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4551
**************************************