[8906] in Perl-Users-Digest
Perl-Users Digest, Issue: 2523 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 7 00:07:56 1998
Date: Wed, 6 May 98 21: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, 6 May 1998 Volume: 8 Number: 2523
Today's topics:
Re: "URGENT!" requests (-)
Re: CPAN & Module gripes (was Re: Ever Wonder...?) (Bart Lateur)
Dylan Song Title Generator (was Re: Rainy Day Women #12 (David Faciane)
Re: Ever Wonder Why Not Everyone Uses Modules? <tchrist@mox.perl.com>
Field Checking in NT <donh@solutions.mb.ca>
Re: from module, how to access vars from main's namespa <tchrist@mox.perl.com>
Re: How old is Perl? (brian d foy)
How to add a space to a variable after 'x' many charact <bravo@bravodesign.com>
Re: how to create name for temporary file (-)
Re: how to run Perl script on remote server not having (Martien Verbruggen)
Re: HTTP server written in perl? (-)
Re: I need to delete temp files after 24 hours... (-)
It works now! <pezhead@cheerful.com>
Re: linux, perl, and microsoft access (-)
Re: Looking for ANY Suggestions on parsing this line!! (-)
Re: perl linux database program? (-)
Re: Perl Win NT (Martien Verbruggen)
Re: Perl/Wall lingo question (brian d foy)
Re: Random Banner Problem (-)
Re: Rotating HTML using Perl (-)
Re: Strange parsing problem with perl5.004_04 <lanier@shell6.ba.best.com>
Re: Strange parsing problem with perl5.004_04 (Martien Verbruggen)
Re: Using executable pathname to define include path (Bart Lateur)
What is wrong with this? <pezhead@cheerful.com>
Re: What is wrong with this? <quentin@shaddam.amd.com>
Re: What is wrong with this? (Mark Maurer)
Re: What it perl? (Martien Verbruggen)
Re: Win95 Perl scripts DONT WORK on UNIX (Alex Dong Li)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 07 May 1998 03:29:27 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: "URGENT!" requests
Message-Id: <35512a94.101576776@nntp.idsonline.com>
petdance@maxx.mc.net (Andy Lester) Said this:
>I have an idea: Anybody who posts an URGENT! or EMERGENCY! request should
>post the circumstances behind the urgency. "I was having sex with my
>mistress in the server room and I knocked the Linux box over and the hard
>drive crashed and so I've reinstalled everything but I still can't get
>5_004_03 to build!"
>
>This would inspire me to action far more than the implied subtext of "I
>have no patience."
>
No, the implied subtext is that these people view the world a bit
differently (actually, I'm starting to believe they are the norm, we
are the aberration) - that all the other messages in the newsgroup are
just "noise" posted by non-existant entities. These people, on the
other hand, are important, and they want to make sure that the
non-existant entity that is required to answer their questions will
see how important they are and will answer it within milliseconds of
their hitting the "send" button.
It's called "center of the fucking universe" and this planet is full
of them.
------------------------------
Date: Wed, 06 May 1998 09:37:35 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: CPAN & Module gripes (was Re: Ever Wonder...?)
Message-Id: <35592a2c.6568700@news.tornado.be>
Birgitt Funk wrote:
>Don't worry, even if CPAN should be a mess (what I seriously
>doubt) we clueless will figure it out and leave the clueful
>in their parlor.
DOn't worry, it isn't. The stuff that is there is well worth looking
into.
It's just a bit difficult to find exactly what you need using CPAN on
it's own (my Perl has no access to the net). Which is the main gripe in
this whole thread!(!!!!)
Bart.
------------------------------
Date: 7 May 1998 03:07:50 GMT
From: dave@nws.fsu.edu (David Faciane)
Subject: Dylan Song Title Generator (was Re: Rainy Day Women #12 & 35 question)
Message-Id: <6ir8i6$fv6$1@news.fsu.edu>
In article <howells.894376052@shell4.ba.best.com>,
John Howells <howells@best.com> wrote:
>My opinion: the title means absolutely nothing. It's just some
>nonsense he thought up on the spur of the moment, like "Alcatraz
>to the 9th Power". That's just the way his mind works.
Indeed. Here's a quick little hack. Ever notice, during the mid-60s,
how Bob was fond of prefacing a rather mundane song title with an
adjective to kind of spice it up, as in
Positively Fourth Street
Obviously Five Believers
Absolutely Sweet Marie
well now you can Bob-ify any dreary song title. Just copy the program below
and run it on your system.
For fun, here's what happens when you run the TOOM song titles through it:
Obnoxiously Love Sick
Familiarly Dirt Road Blues
Surely Standing In The Doorway
Superbly Million Miles
Obviously Tryin To Get To Heaven
Mercilessly Til I Fell In Love With You
Amply Not Dark Yet
Eerily Cold Irons Bound
Simply Make You Feel My Love
Positively Cant Wait
Otherworldly Highlands
Here's the program. Save it as 'bobify' on your UNIX system (you
are running unix or linux, riiiight?). If you are trapped in Mr. Bill's
Funhouse, it should still work as long as you have the perl programming
language interpreter installed.
Just feed it a song title and it will bob-ify it!
$ bobify 'Spinach Salad'
Superbly Spinach Salad
#!/usr/local/bin/perl
#
# bobify: absolutely dylan title generator
#
#
# usage: bobify <song title>
#
require 5.000;
srand;
my @words= qw/ obviously positively absolutely surely certainly amply eerily
familiarly fondly fully ghastly ghostly grizzly mercilessly ornately
otherworldly pitilessly scraggly simply summarily superbly truly wholly
pitifully obnoxiously/;
print ucfirst($words[int(rand($#words))]), " @ARGV \n";
--
David Faciane |web: http://www.nws.fsu.edu/
NOAA National Weather Service |Real-Time Worldwide Marine Weather Reports
Tallahassee, FL | http://www.nws.fsu.edu/buoy
------------------------------
Date: 7 May 1998 02:58:39 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <6ir80v$am6$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
:Porting would be easier by *tons* if there were no *nix around.
Of course it would -- because Perl wouldn't exist. Not merely because
Larry wouldn't have written it, but rather because the very glory of
the Unix philosophy is incarnated in Perl.
Who wants to read poetry translated? To what purpose? To translate
poetry carries with it the inevitable doom that its allusions and
metaphors, its delicate aesthetics and pleasing symmetry, that shall be
thus destroyed, reduced to a palimpsest--nay, a caricature--of true art.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"I think I'll side with the pissheads on this one." --Larry Wall
------------------------------
Date: Thu, 07 May 1998 02:35:25 GMT
From: "Don H." <donh@solutions.mb.ca>
Subject: Field Checking in NT
Message-Id: <35511D35.DDD65734@solutions.mb.ca>
This is a multi-part message in MIME format.
--------------ECCEF4BE98EB405DADAE1DCC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I coded a Perl program to check on text fields, radio buttons, and check
boxes to make sure these fields are being filled in. The Perl program
works perfect with a UNIX server, but when I upload it onto a Windows NT
4.0 server, none of the checking code works.
ex. if ($in{'fname'} eq "")
{
code to display error message
}
I've tried putting a space between the double quotes ( " " ), tried to
say; eq null, tried to move it into a variable and then check it's
length;
$name = $in{'fname'}
if (lenght($name) == 0)
and nothing works!
How does Windows NT want me to code this to let me check to see if the
fields are filled in properly?
Thanks for any help anyone can pass my way.
--------------ECCEF4BE98EB405DADAE1DCC
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Don H.
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Don H.
n: ;Don H.
email;internet: donh@solutions.mb.ca
note: My computer never has bugs, it just develops random features!!!
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard
--------------ECCEF4BE98EB405DADAE1DCC--
------------------------------
Date: 7 May 1998 03:01:04 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: from module, how to access vars from main's namespace
Message-Id: <6ir85g$am6$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Aaron Kushner <akushner@cup.hp.com> writes:
You sent me a stealth CC. I wasted my time giving an
inadvertently private reply to your unannounced public response.
:*lfile = \$main::logfile;
: # main program
:my $lfile = "/tmp/gunk";
And what, pray tell, does symbol table manipulation have
to do with lexically scoped variables?
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
All language designers are arrogant. Goes with the territory... :-)
--Larry Wall in <1991Jul13.010945.19157@netlabs.com
------------------------------
Date: Wed, 06 May 1998 23:54:09 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: How old is Perl?
Message-Id: <comdog-ya02408000R0605982354090001@news.panix.com>
Keywords: from just another new york perl hacker
In article <3550DE76.B410C9BA@gulf.uvic.ca>, "K. Viggers" <kviggers@gulf.uvic.ca> posted:
> I was just hoping that someone could tell me when Perl began its
>exsistence.
Perl is around 10, and on the occasion of its birthday, Randal
and NY.pm called Larry Wall (who wasn't home) to sing Happy
Birthday to Perl (recorded on an answering machine).
<URL:http://www.computerdog.com/brian/happy_bday_perl.html>
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
there's more than what you see
------------------------------
Date: Wed, 06 May 1998 22:44:39 -0500
From: Darrick Wolfe <bravo@bravodesign.com>
Subject: How to add a space to a variable after 'x' many characters??
Message-Id: <35512E27.7C1D@bravodesign.com>
Hi!
There is probably a very simple solution to this, and if you know where
I can learn more about this, please show me the way!
I'm wanting to add a space after, say 20 characters in a variable
(inputed from a form: $IN{'stuff'} ), so that if someone submits
something like:
ttttttttttttthhhhhhhhhhhhhhhhhhhhhhiiiiiiiiiiiiiiiiiiiiiiiissssssssssssssssssssssssssssss
it will place a blank space after every 20th character.
please help!!
Also, how do you count the actual characters in a variable?
please cc the response to my e-mail if you wouldn't mind, sometimes this
news server is funny!
Thanks!!
Darrick
------------------------------
Date: Thu, 07 May 1998 03:29:18 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: how to create name for temporary file
Message-Id: <35512a8a.101567591@nntp.idsonline.com>
Jonathan Feinberg <jdf@pobox.com> Said this:
>Jeff Trawick <trawick@ibm.net> writes:
>
>> Are there any functions in the standard Perl 5.004
>> distribution to create names for temporary files
>> (like tmpnam() in C Standard Library)?
>
>A quick search through the docs reveals: POSIX::tmpnam()
>
This sounds unnecessary. This is the reason Microsoft succeeds in the
computer business - people are indecisive and can't make decisions on
their own, they need someone (or something) else to do it for them.
Just use $$ or some variant. Make up your own temporary file, it's
not that hard. You don't need someone else to do it for you.
Here........
srand($$^TIME);
$num = int(rand(1000);
$tempfile = $num * $$;
$tempfile .= ".tmp";
Now you have a nice temporary file. No loading of some huge module
just to do something you were afraid to do on your own.
If you like things neat and orderly, substr $tempfile before appending
the .tmp onto it, say at 8 characters for you dos-nuts.
------------------------------
Date: 7 May 1998 01:43:02 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: how to run Perl script on remote server not having Perl interpretor
Message-Id: <6ir3j6$gfq$7@comdyn.comdyn.com.au>
In article <6imuld$rkl$1@nnrp1.dejanews.com>,
venkat5@hotmail.com writes:
> can anyone please tell me how to run a Perl script on a remote
> server which is not having Perl interpretor.
Install perl on it. Install your script on it. Execute it.
Alternatively you might try the experimental perl compiler that is
mentioned in perlfaq3.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I think I think, therefore I think I
Commercial Dynamics Pty. Ltd. | am.
NSW, Australia |
------------------------------
Date: Thu, 07 May 1998 03:29:38 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: HTTP server written in perl?
Message-Id: <35512a9f.101588171@nntp.idsonline.com>
Mcoe NT <root@mail.mcoe.k12.ca.us> Said this:
>Hello group,
>
>Has anyone seen a HTTP server written only in perl?
>
Plexus
ftp://ftp.earth.com/plexus
May be outdated by now...... the book I found this in is about a year
old.
------------------------------
Date: Thu, 07 May 1998 03:29:48 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: I need to delete temp files after 24 hours...
Message-Id: <35512aa9.101597740@nntp.idsonline.com>
"David" <kupid@ecom.net> Said this:
>Firstly, you would post the time that the filename is created.
>
>time ()
>
>Secondly you would would compare the filename ($time), with the current
>($CurrentTime). If it's greater than 24 hours, then delete then open up the
>file and delete it. Simply doing a "open(File, ">$thefile");" would do the
>job, as this simply overwrites the old info.
>
>I know of 2 easy methods of doing this automatically:
>
>1. via crontab
>
>2. via any of your other scripts... simply attach the code to a script., and
>when the script executes, it automatically goes thru the code.
>
>The Servant of the Lord,
>
>David
Your answer is fine and dandy, but (and I'm not trying to be rude) the
question is "how do I find out if "file" is older than 24 hours?" -
which is the step prior to your explanation ;)
Here's the easiest way to do it all.......
($dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
$size, $atime, $mtime, $ctime, $blksize, $blocks) =
stat(FILE_HANDLE);
$current_time = time;
$seconds_to_save = 86400; # 24 hours, in seconds
$age_of_file = $current_time - $mtime;
if ($age_of_file > $seconds_to_save)
{
unlink("$file");
}
>
>Drake Cleary wrote in message <352fc9bc.15261175@news.peterboro.net>...
>>How do i ask the question:
>>
>>is $filename older than 24 hours?
>>
>>
>>Thanks.
>
>
------------------------------
Date: Wed, 6 May 1998 22:04:03 -0500
From: "Ian Sergeant" <pezhead@cheerful.com>
Subject: It works now!
Message-Id: <35512436.0@newsread.cioe.com>
The only thing i had missing was a semicolon.. thanks anyway. you will be
hearing from me again. :-)
Ian Sergeant wrote in message <355117f7.0@newsread.cioe.com>...
>I got this from the perl book called Learning Perl. I am trying to learn
>Perl and i can't get this to work. What is the problem?
>
>
>
>#!/usr/bin/perl -w
>$secretword = "llama"; # the secret word
>print "What is you name?";
>$name = <STDIN>;
>chomp $name
>if ($name eq "Randal") {
> print "Hello, Randal! How good of you to be here!\n";
>} else {
> print "Hello, $name!\n"; # ordindary greeting
> print "What is the secret word? ";
> $guess = <STDIN>;
> chomp ($guess);
> while ($guess ne $secretword) {
> print "Wrong, try again. What is the secret word? ";
> $guess = <STDIN>;
> chomp ($guess);
> }
>}
>
>
>
>
------------------------------
Date: Thu, 07 May 1998 03:29:13 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: linux, perl, and microsoft access
Message-Id: <35512a86.101563018@nntp.idsonline.com>
aml@world.std.com (Andrew M. Langmead) Said this:
>jaws@atl.mindspring.com (John Armsby) writes:
>
>>Is there any reason why I can't access microsoft access via the win32
>>perl module from Linux? Linux sees the dos partition.
>
>The Win32 modules contain code that calls operating sytem calls
>specific to Windows and do not exist in Linux. Just being able to see
>the files would not be enough.
>
And furthermore, the files wouldn't need to reside on a "dos" drive.
A file is a file, no matter where it resides. If you know the file
structure of an access .mdb file you could open it on a linux machine
(from a linux volume) and read it and process it. Check out the
Xbase.pm module for an example of reading foxpro/dbase files. It
works pretty nicely, I've used it to open foxpro tables that I know
were created on a windows machine. I imagine somebody somewhere has
done with access files what Xbase does with foxpro files.
------------------------------
Date: Thu, 07 May 1998 03:29:08 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Looking for ANY Suggestions on parsing this line!!
Message-Id: <35512a81.101558246@nntp.idsonline.com>
mgjv@comdyn.com.au (Martien Verbruggen) Said this:
>In article <6g0u85$jbe$1@nnrp1.dejanews.com>,
> randy.paries@avex.com writes:
>
>> the problem is that the program that does the export(that I do not have
>> control over) does not put quotes around word 2 and word 8. Even though it is
>> suppose to be a csv, they put comma's in the values if over 1000. ARG!@!
>
>That is a serious bug. Contact the author of that program and yell at
>him/her.
>
>> does anyone have any ideas of how to parse this line into words. The values of
>> course will be of the same type but different values.
>>
>> "MGORDON",$1,860.65,"STAR","$539.35","$1,139.35","$1,739.35",0,$1,860.65
>> "LE GRAVES",$1,822.43,"STAR","$577.57","$1,177.57","$1,777.57",0,$822.43
>
This looks like something from Microsoft Access (the worst db product
on the planet).
The problem isn't in the size of the value, it's that it doesn't quote
any fields unless they are text or memo fields. Number, currency, etc
are not quoted.
just make all your fields text, and you shouldn't have this problem to
begin with.
One more reason why microsoft SUCKS.
------------------------------
Date: Thu, 07 May 1998 03:29:22 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: perl linux database program?
Message-Id: <35512a8f.101572295@nntp.idsonline.com>
maurice@localhost.localdomain (Maurice Aubrey) Said this:
>On Tue, 07 Apr 1998 05:09:40 GMT, Paul Wilson <prw@vanitydomain.net> wrote:
>>On Sat, 4 Apr 1998 07:34:47 -0500, "Greg Waters" <gwaters@dorsai.org>
>>wrote:
>>
>>>Does anybody know resource information and help files on how to create perl
>>>databases for linux? Did someone write a program?
>>>
>>
>>Creating a perl database would be a pain. Why not just use mSQL
>>(http://www.hughes.com.au) , get a copy of MSQL.pm, and you're all
>
>Or MySQL (http://www.tcx.se/) which, in my opinion, is much better.
>
>--
Just go to http://www.perl.com, and look for the CPAN link, and
there's all kinds of database modules.
put if all you want is to be able to search a text file in perl, and
you want to call that a database, then do this:
open (IN, "my_database_file.db");
while (<IN>)
{
next unless $search_term eq ""
|| $_ =~ /$search_term/i;
# do whatever you want here, this is a "match"
}
------------------------------
Date: 7 May 1998 01:41:25 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl Win NT
Message-Id: <6ir3g5$gfq$6@comdyn.comdyn.com.au>
In article <354EFE05.298503BE@thekitchen.nl>,
Zoran Kovacevic <zoran@geof.ruu.nl> writes:
> I'm using Perl on NT (with IIS) and I'm trying to use packages (with the
> use clause).
> When I'm executing my perl script directly on the machine it works but
> when I am executing the SAME perl (cgi) script form the browser, the
> following error occurs:
>
> Can't locate packagename.pm in @INC
If you have problems like this with CGI stuff, you should first check
out the following documentation, and follow the steps in there:
Perl CGI FAQ and (no offense) Idiot's guide:
http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.com/CPAN/doc/FAQs/cgi/perl-cgi-faq.html
Section 9 of the perl FAQ:
# perldoc perlfaq9
If you still cannot figure it out with the help of that, please come
back and ask again.
In your case it might be permission problems, a difference in
environment, your server might chroot() or do something equivalent,
you might accidentally be calling another perl version, the modules
that you try to include might not be installed on that machine, the
cgi script might not actually be executed in the directory where you
think it is, and probably a few others.
All we can tell you is that perl cannot find the modules you're trying
to include, but you already knew that.
Martien
PS. You are NOT executing anything from your browser. You are pointing
your browser to a URL, which probably points to a CGI program on your
web server, which then proceeds to execute that program in its own
peculiar little way. Please, let's at least get that straightened out.
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: Wed, 06 May 1998 23:58:56 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl/Wall lingo question
Message-Id: <comdog-ya02408000R0605982358560001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6ir1at$e8u@fidoii.cc.Lehigh.EDU>, lusol@turkey.cc.Lehigh.EDU (Stephen O. Lidie) posted:
>Hmm. A computer nerd by trade but a biologist by degree, I've always
>held this hierarchy, in Makefile terminology:
>
>biology: chemistry
>chemistry: physics
>physics: mathematics
>
>e.g., the world view is described by mathematics.
well, i guess i'm a computer need by choice, but a chemist and physicist
by degrees, and my Makefile looks like
chemistry: physics
physics: mathematics
mathematics: religion
religion: philosophy
philosophy: art
art: Perl
:)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
after my physics degree, my advisor told me it was time for religion :)
------------------------------
Date: Thu, 07 May 1998 03:29:34 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Random Banner Problem
Message-Id: <35512a98.101581332@nntp.idsonline.com>
Jeremy Hill <hilljere@pilot.msu.edu> Said this:
>Someone Please help me!
>
>I need a way to display random banners on a web page
>whenever someone goes to the page. I thought that
>I could just say
>
><img src="MyScript.cgi">
>
>where MyScript.cgi would return the name of the
>banner. I don't need any banner rotation, I just
>want a random banner each time the page is loaded
>or re-loaded. Any help would be GREATLY appreciated.
>Thanking you in advance,
>
MyScript.cgi actually does exist, right?
You say you can take care of selecting the banner from wherever.... so
what you probably need is the way to get it into the user's browser.
There's two ways. Both are fairly easy, but the first way has an
extra "hit" on the server, so on busy servers isn't the best way.
Method one:
((process to select your banner))
print "Location: http://blahblah.com/path/banner.gif\n\n";
Method two:
((process to select your banner))
$| = 1;
open (GIF, "/path/to/banner.gif");
while (<GIF>)
{
print $_;
}
close GIF;
Yes, you can actually open and read the gif file and print it right to
stdout, and onward to the web browser. That will save you the cost of
having to redirect to yet another httpd connection.
------------------------------
Date: Thu, 07 May 1998 03:29:05 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Rotating HTML using Perl
Message-Id: <35512a7c.101552716@nntp.idsonline.com>
Fain <mindmore@mindless.com> Said this:
>Franco Finstad wrote:
>
>> I'd would like to have different text displayed each time my homepage is
>> loaded. I need the text to be read from a text file that I'm constantly
>> updating. Is this possible using Perl?
>>
>> Any help is appreciated.
>>
>> Thanks
>> Franco Finstad
>
> Yes it is very possible.
>
>here is what will have to happen.
>You make your web page a cgi script instead of a HTML page (unless you yes
>SSI which I am not as familiar with).
>
>All that you would need in the CGI script something that writes to a file
>and reads from a file each time someone comes to the site.
>
It doesn't have to be a CGI script. You can simply cron a perl script
that opens the home page and replaces text every minute, or whatever
interval you want....
The easiest way is to make a "template" file, which is just the page
you want displayed with a <!--REPLACE TEXT HERE--> comment where you
want the replaced text to go. Then you open the template file for
reading, and open the "home page" for writing. In the while loop you
do
if ($_ eq "<!--REPLACE TEXT HERE-->")
{
print $textfile_stuff; # print stuff from other file
}
else
(
print $_; # print the normal page contents
}
------------------------------
Date: Wed, 6 May 1998 18:59:17 -0700
From: "matthew d. p. k. lanier" <lanier@shell6.ba.best.com>
To: "Charles J. Leslie" <cjl@c1003798-a.frmt1.sfba.home.com>
Subject: Re: Strange parsing problem with perl5.004_04
Message-Id: <Pine.BSF.3.96.980506185836.5071A-100000@shell6.ba.best.com>
i believe that, on the #! line, perl only allows one option. you can
bundle options like
#!/usr/bin/perl -twp for example, but
#!/usr/bin/perl -t -w is invalid.
later-
matt =)
matthew d. p. k. lanier / professional hugger and empath / matt@lanier.org - i web, therefore i am / matt@saturn5.com - i read too many mailing lists / +1-415-505-4450 - i cell way too much / +1-415-863-2932 - i'm never home, but try it anyway /
_______
/ \
/ o o \
| ^ |
| |
___ \ \_/ / ___
__(___\ \__ __/ /___)__
(______ \________\ /_________/ ______)
(_______ ____________________ _______)
(______ / \ ______)
(_____/ \_____)
On Thu, 7 May 1998, Charles J. Leslie wrote:
> I have compiled perl 5.004_04 for Irix 6.4 and for some strange reason
> whenever, I use the '-T -w' switches on the invocation line, I get the
> following error:
>
> Unrecognized switch: - -w (-h will show valid options).
>
> My the first line in my script is #!/usr/local/bin/perl -T -w
>
> According to 'perl -h', the switches are valid. Therefore, I tried
> different permutations of '-T -w'. Below are my results:
>
> if I use, -Tw without a space after the 'w', perl parses the
> switches just fine.
>
> '-Tw ' I get an error
>
> '-T -w' also gets an error
>
>
> I wasn't able to find any information in the FAQ or on CPAN.
> Has anyone came across this problem on an Irix 6.4 system?
>
> Thanks
>
> -charles
>
>
>
>
------------------------------
Date: 7 May 1998 03:34:26 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Strange parsing problem with perl5.004_04
Message-Id: <6ira42$hks$1@comdyn.comdyn.com.au>
In article <Pine.BSF.3.96.980506185836.5071A-100000@shell6.ba.best.com>,
"matthew d. p. k. lanier" <lanier@shell6.ba.best.com> writes:
> i believe that, on the #! line, perl only allows one option. you can
> bundle options like
perl doesn't restrict anything on that line. You system might.
> #!/usr/bin/perl -twp for example, but
> #!/usr/bin/perl -t -w is invalid.
Actually, straight from the perlrun man page:
# perldoc perlrun
[snip]
The #! line is always examined for switches as the line is
being parsed. Thus, if you're on a machine that allows only
one argument with the #! line, or worse, doesn't even
recognize the #! line, you still can get consistent switch
behavior regardless of how Perl was invoked, even if -x was
used to find the beginning of the script.
[snip]
See the 'always' in the first line?
[snip of incredibly large ridiculous signature. Please get rid of it]
>> I have compiled perl 5.004_04 for Irix 6.4 and for some strange reason
>> whenever, I use the '-T -w' switches on the invocation line, I get the
>> following error:
>>
>> Unrecognized switch: - -w (-h will show valid options).
Looks like for some reason, your system passes '- -w' as an option to
perl. I would consider this broken behaviour. I've seens systems that
pass nothing. I have seen systems that only pass one argument. I've
had the #! line be chopped off after 32 characters, but I haven't
seen this. Mind you, I've never had to work on IRIX.
You can recreate the error by doing something like:
# perl -T '- -w'
Unrecognized switch: - -w (-h will show valid options).
What happens if you feed the script directly into perl, without
letting the system make a decision based on the #! line?
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | We are born naked, wet and hungry. Then
Commercial Dynamics Pty. Ltd. | things get worse.
NSW, Australia |
------------------------------
Date: Wed, 06 May 1998 09:37:33 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Using executable pathname to define include path
Message-Id: <355a2b16.6803010@news.tornado.be>
David Boyce wrote:
>> David: your post was of absolutely no use to me,
>> since I do not read this newsgroup.
>
>Come to think of it, answering your question was of absolutely no use to
>me either. Hmmm.
Whoops, here we go again.
I appears to me that most of the clpm posts are of this type.
Please please please give me some more *interesting* "how do I do..."
kind of questions, even if they're not Perl-specific! Then *I* might
learn something from the answers. :-)
Bart.
------------------------------
Date: Wed, 6 May 1998 21:11:53 -0500
From: "Ian Sergeant" <pezhead@cheerful.com>
Subject: What is wrong with this?
Message-Id: <355117f7.0@newsread.cioe.com>
I got this from the perl book called Learning Perl. I am trying to learn
Perl and i can't get this to work. What is the problem?
#!/usr/bin/perl -w
$secretword = "llama"; # the secret word
print "What is you name?";
$name = <STDIN>;
chomp $name
if ($name eq "Randal") {
print "Hello, Randal! How good of you to be here!\n";
} else {
print "Hello, $name!\n"; # ordindary greeting
print "What is the secret word? ";
$guess = <STDIN>;
chomp ($guess);
while ($guess ne $secretword) {
print "Wrong, try again. What is the secret word? ";
$guess = <STDIN>;
chomp ($guess);
}
}
------------------------------
Date: 06 May 1998 22:34:17 -0500
From: Quentin Fennessy <quentin@shaddam.amd.com>
Subject: Re: What is wrong with this?
Message-Id: <ximaf8ug3eu.fsf@shaddam.amd.com>
>>>>> "Ian" == Ian Sergeant <pezhead@cheerful.com> writes:
Ian> I got this from the perl book called Learning Perl. I am
Ian> trying to learn Perl and i can't get this to work. What is
Ian> the problem?
Ian - please provide us with more context. Describe what you did
to run the program, the output you saw and the output you expected.
We'll be glad to help!
--
Quentin Fennessy AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals
------------------------------
Date: 6 May 1998 23:36:11 -0400
From: mwmaurer@mtu.edu (Mark Maurer)
Subject: Re: What is wrong with this?
Message-Id: <6ira7b$ke7$1@pace1.cts.mtu.edu>
Ian Sergeant (pezhead@cheerful.com) wrote:
: I got this from the perl book called Learning Perl. I am trying to learn
: Perl and i can't get this to work. What is the problem?
:
: #!/usr/bin/perl -w
: $secretword = "llama"; # the secret word
: print "What is you name?";
: $name = <STDIN>;
: chomp $name
: if ($name eq "Randal") {
: print "Hello, Randal! How good of you to be here!\n";
: } else {
: print "Hello, $name!\n"; # ordindary greeting
: print "What is the secret word? ";
: $guess = <STDIN>;
: chomp ($guess);
: while ($guess ne $secretword) {
: print "Wrong, try again. What is the secret word? ";
: $guess = <STDIN>;
: chomp ($guess);
: }
: }
Well, a quick cursory glance says nothing. Question: where exactly is your
perl executable. And what exactly is the program NOT doing?
--
Mark Maurer markm@dct.com mwmaurer@mtu.edu
Programmer, Digital Magic Interactive http://www.dminteractive.com
Senior, Michigan Technological University Houghton, MI
-- Views do not represent those of my employer or school
------------------------------
Date: 7 May 1998 02:19:36 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: What it perl?
Message-Id: <6ir5no$h0c$1@comdyn.comdyn.com.au>
In article <354F024B.6EC5@but.auc.dk>,
Lars Chr Hausmann <36haus@but.auc.dk> writes:
> Hello!
>
> I have to write something about, what Perl is.
>
> I need some crystal clear info about, what perl is. So if any of you
> would be so kind just to mail. Then I would be grateful!
Do you also need us to spellcheck it? Any language preferences? How
many words? Do you really want us to do your work? Why are they asking
you to write about perl if you don't know? And email it to you as
well? You of course don't want anyone else to see it.
Check
http://www.perl.com/
http://www.perl.org/
Buy a book about perl.
That is where you get information
Martien
PS. Be careful when you copy things verbatim that you find there. Most
of it is copyrighted.
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: Thu, 07 May 1998 03:06:20 GMT
From: lidong@globalserve.net (Alex Dong Li)
Subject: Re: Win95 Perl scripts DONT WORK on UNIX
Message-Id: <6irbuh$i9p$1@titan.globalserve.net>
In article <6ir18l$flv@dfw-ixnews8.ix.netcom.com>, "edepot" <phlin@ix.netcom.com> wrote:
>
>Hello. I found out that perl scripts written to run
>on Windows 95 Perl DOES NOT WORK
>on unix Perl.
>
>The reason is that Windows (or DOS) puts a
>character "^M" after a line, and UNIX perl
>does NOT understand this character.
Try this:
## add a os flag: set $os to 1 if unix, 0 if PC:
## after you have just opened your file
if ($os) { binmode(YOUR_FILE_VARIBLE); }
This would force scripts to open file in binary mode in unix system, other
than text mode, which causes your problem.
------------------------------
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 2523
**************************************