[13838] in Perl-Users-Digest
Perl-Users Digest, Issue: 1248 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 1 21:05:31 1999
Date: Mon, 1 Nov 1999 18:05:12 -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: <941508312-v9-i1248@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 1 Nov 1999 Volume: 9 Number: 1248
Today's topics:
Re: -w (Alan Barclay)
Re: -w <jeffp@crusoe.net>
Re: -w <cassell@mail.cor.epa.gov>
Re: -w <cassell@mail.cor.epa.gov>
Re: <STDIN> to a @ (Craig Berry)
Re: Book suggestions (Martien Verbruggen)
Re: Card shuffling <lr@hpl.hp.com>
Cookies ? z28pwr@my-deja.com
Re: Database script help <cassell@mail.cor.epa.gov>
Re: FAQ 1.7: Is Perl difficult to learn? <cassell@mail.cor.epa.gov>
Find::File problem (Rory C-L)
Re: fork() <rootbeer@redcat.com>
Re: help with if,elsif (Kragen Sitaker)
Re: I'm a bit lost with this LWP problem <rootbeer@redcat.com>
making a variable length string (Jim Matzdorff)
Re: making a variable length string <lr@hpl.hp.com>
Re: New Modules: Conversion of C-structs to Perl <randy@theory.uwinnipeg.ca>
Re: Perl4 and Y2K <rootbeer@redcat.com>
Premature End Of Script Headers <martin@mert.globalnet.co.uk>
Re: Premature End Of Script Headers <amwalker@gate.net>
Report pagebreak & page-count <dvoon@my-deja.com>
Something like FLY except for JPGs (Markus Svilans)
Re: Something like FLY except for JPGs (Martien Verbruggen)
Re: Strange Bus error problem <rootbeer@redcat.com>
Re: string number conversion <rootbeer@redcat.com>
Re: system commands <jeffp@crusoe.net>
Re: What makes the web go? (Martien Verbruggen)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 01 Nov 1999 23:32:55 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: -w
Message-Id: <941499510.831917@elaine.drink.com>
In article <MPG.1287a5dc7c6f70af98a171@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>Ahem. The legal drinking age is now 21, everywhere in the USA, as far
>as I know. Don't give the (still a) minor any bad ideas, or any alcohol
>for that matter.
The USA isn't the whole world. Most of the rest of the world has more
sensible drinking age limits.
------------------------------
Date: Mon, 1 Nov 1999 19:10:38 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: -w
Message-Id: <Pine.GSO.4.10.9911011909520.2694-100000@crusoe.crusoe.net>
On Nov 1, Alan Barclay blah blah blah:
> In article <MPG.1287a5dc7c6f70af98a171@nntp.hpl.hp.com>,
> Larry Rosler <lr@hpl.hp.com> wrote:
> >Ahem. The legal drinking age is now 21, everywhere in the USA, as far
> >as I know. Don't give the (still a) minor any bad ideas, or any alcohol
> >for that matter.
>
> The USA isn't the whole world. Most of the rest of the world has more
> sensible drinking age limits.
I am an American citizen. Perhaps, when I am 18, I shall drink legally in
Canada.
--
MIDN 4/C PINYAN, USNR, NROTCURPI
jeff pinyan japhy@pobox.com
perl stuff japhy+perl@pobox.com
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
------------------------------
Date: Mon, 01 Nov 1999 17:22:34 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: -w
Message-Id: <381E3CDA.146DE06B@mail.cor.epa.gov>
Uri Guttman wrote:
>
> >>>>> "DC" == David Cassell <cassell@mail.cor.epa.gov> writes:
>
> DC> [emailed also]
> DC> Jeff Pinyan wrote:
> DC> [snip]
> >> On a totally unrelated note, November 9th shall be my undoing. For I
> >> shall be 18 years of age. Look out.
>
> DC> Mazel tov. We eagerly await your posts after Nov 9. Probably
> DC> lots of drunken posts after midnight, and then lots of really
> DC> surly hangover-laden posts on the subsequent mornings. Should
> DC> liven things up considerably. :-)
>
> don't know what planet you're from,
Krypton. Oops, I wasn't supposed to admit that...
> but min drinking age is 21 all over
> the .us. but now japhy can vote and create all sorts of nasty perl
> voting scripts to elect his favorite politician.
Nah, I'm just so old I got to drink legally at age 18.
Heck, I have t-shirts older than Jeff.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 01 Nov 1999 17:24:08 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: -w
Message-Id: <381E3D38.A5C8E862@mail.cor.epa.gov>
Alan Barclay wrote:
>
> In article <MPG.1287a5dc7c6f70af98a171@nntp.hpl.hp.com>,
> Larry Rosler <lr@hpl.hp.com> wrote:
> >Ahem. The legal drinking age is now 21, everywhere in the USA, as far
> >as I know. Don't give the (still a) minor any bad ideas, or any alcohol
> >for that matter.
>
> The USA isn't the whole world. Most of the rest of the world has more
> sensible drinking age limits.
True. But Uri knows that both Jeff and I live in the USA.
and I think he knows Jeff doesn't need me to come up with bad
ideas on his own. Witness Jeff's post in this thread. :-)
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 01 Nov 1999 23:23:28 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: <STDIN> to a @
Message-Id: <s1s87gt7qof35@corp.supernews.com>
Larry Rosler (lr@hpl.hp.com) wrote:
: In article <s1s0ttb5qof47@corp.supernews.com> on Mon, 01 Nov 1999
: 21:18:53 GMT, Craig Berry <cberry@cinenet.net> says...
: > I can't defend any alternative, but this special case does bother me.
: > Ordinarily, an empty regex means "match on last regex encountered" (see
: > another currently active thread on this issue). Giving it yet another
: > special meaning in the context of split is a little too magical for my
: > taste.
:
: So what would you do about it? The magic is there willy-nilly. That's
: the way it was, is, and always will be.
I was just whining about it, not trying to fix it. Perl sometimes reminds
me of that Monty Python sketch about the apartment building held up by
hypnosis (paraphrasing)...
Interviewer: But doesn't it ever bother you, knowing that the entire
building is supported only by your belief in it?
Resident: Hmmmmm...well, actually, now that you mention it...
[Building begins to shake and lean to one side]
Resident: No! No! Doesn't bother me at all! Not one bit!
[Building stops shaking]
Consider the above my own short-lived moment of doubt.
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: 1 Nov 1999 23:09:14 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Book suggestions
Message-Id: <slrn81s7kv.2o9.mgjv@wobbie.heliotrope.home>
On Mon, 01 Nov 1999 12:09:37 -0800,
David Cassell <cassell@mail.cor.epa.gov> wrote:
> Do not go to books like "Perl for Dummies" unless you want
> a book which will try to convince you programming is hard
> and scary. Get a book which doesn't treat you like a dummy.
Hey! I've been trying to convince managers for ages that programming is
hard and scary. Don't ruin it for me.
Martien
PS. Just so everyone understands I am not being serious: I have never
tried to convince any manager that programming is hard and scary. I don't
have to.
--
Martien Verbruggen |
Interactive Media Division |
Commercial Dynamics Pty. Ltd. | What's another word for Thesaurus?
NSW, Australia |
------------------------------
Date: Mon, 1 Nov 1999 15:00:06 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Card shuffling
Message-Id: <MPG.1287bb526e073d9a98a17b@nntp.hpl.hp.com>
In article <slrn81s1m5.njb.bet@localhost.localdomain> on Mon, 01 Nov
1999 21:31:49 GMT, Bennett Todd <bet@network.rahul.net> says...
> 1999-10-20-09:10:39 Mikko Saari:
> >I need a perl script to handle decks of cards. My first and most obvious
> >problem is shuffling, a problem which has bothered me previously. How do I
> >arrange an array in random order?
>
> There are a lot of answers to that question. In fact, I doubt any two people
> will answer the same way. Here's my favourite:
>
> for my $i (0..$#deck-1){@deck[$i, $_]=@deck[$_, $i] for $i+rand($#deck-$i+1)}
>
> That shuffles an N-card deck using N-1 calls to rand() and swaps. If the
> performance edge of doing an in-place swapping shuffle isn't important, it
> might be more understandable as
>
> @shuffled = ();
> push @shuffled, splice(@deck, rand(@deck), 1) while @deck;
What is wrong with the discussion in perlfaq4: "How do I shuffle an
array randomly?" It gives both of these methods (improving on the first
one slightly), and describes the latter one as 'bad'.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 01 Nov 1999 23:47:57 GMT
From: z28pwr@my-deja.com
Subject: Cookies ?
Message-Id: <7vl8rd$rfg$1@nnrp1.deja.com>
If I want to set the cookie expire time to 15
minutes i would use the +15m option and that
would take the servers time add 15 minutes to it
then send the cookie. The problem with that is
that if the clients PC Time is 30 Minutes ahead
then the Cookie will not set since it already
passed that time. Is there anyway to grab the
users time add 15 minutes to it and send it as
the cookie expiration time ??
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 01 Nov 1999 17:30:01 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Database script help
Message-Id: <381E3E99.10542F18@mail.cor.epa.gov>
Jim wrote:
>
> Hello,
>
> Can you help ?
>
> We have written a perl script to read/write to a dbm database.
>
> We now need to "hold" the user name when a user logs on to our website
> to enable us to identify them.
>
> How do we retain the user name once the scrips has finished executing
> ?
> If the user needs to update his details within the database and not
> have to logon again something must retain his user name.
Off-topic part:
do it with cookies.
On-topic part:
use the CGI.pm module to do the webwork, and follow its docs on
cookie-making.
Extra hint:
do *not* use Abigail's cookie recipe provided in this ng.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 01 Nov 1999 17:26:53 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 1.7: Is Perl difficult to learn?
Message-Id: <381E3DDD.5F880E03@mail.cor.epa.gov>
Bart Lateur wrote:
>
> Tom Christiansen wrote:
>
> > Is Perl difficult to learn?
> >
> > No, Perl is easy to start learning -- and easy to keep learning.
>
> Oh no! Don't say that! Say it's difficult to learn!
>
> ;-)
>
> How else are we going to deter script kiddies?
It's okay to say Perl is easy to learn. He just needs to add:
"But the comp.lang.perl.misc newsgroup is filled with mean
people who will hurt your widdle feelings if you don't do
your homework first. Be afraid. Be very afraid."
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 02 Nov 1999 00:27:50 +0000
From: campbell-lange@easynet.co.uk (Rory C-L)
Subject: Find::File problem
Message-Id: <campbell-lange-0211990027500001@campbell-lange.easynet.co.uk>
I've been having problems with File::Find. I've had some help from Paul
Schinder on the MacPerl mailing list (thanks, Paul!), but I still can't
get my code to work. Sorry if this is because of a foolish error.
#!perl -w
use File::Find;
find(sub {
my $file = $File::Find::name;
return if (-d $_);
open (IN, $file) or die "Can't open $file";
while (<IN>) {
while ( s/([^\s]+@[^\s]+)// ) {print "$file $1 \n"}
}
close IN;
}, @ARGV);
I've also been trying:
#!perl -w
use File::Find;
find(sub {
my $file = $File::Find::name;
if (-d $file) {
$file = $file . ':'; # (macintosh folders)
print $file, "\n"
} else { # this test seems to be failing
for directories ?
open (IN, $file) or die "Can't open $file";
while (<IN>) {
while ( s/([^\s]+@[^\s]+)// ) {print "$file $1 \n"}
}
close IN;
}
}, @ARGV);
Test case with folder structure
outer:
inner:
t2
t1
(t1 is in folder outer)
I get the correct output until I hit the end of the results for file t2, then a
set of errors in File::Find is recorded:
HD:Desktop Folder:outer:
HD:Desktop Folder:outer:inner:
HD:Desktop Folder:outer:inner:t2 awilk@ucl.edu
HD:Desktop Folder:outer:inner:t2 gal@mcm.com
HD:Desktop Folder:outer:inner:t2 andy@a.com
HD:Desktop Folder:outer:inner:t2 bcl@hop.co.uk
HD:Desktop Folder:outer:inner:t2 custservice@barebones.com
# Use of uninitialized value.
File 'HD:My apps:programming:MacPerlŸ:lib:File:Find.pm'; Line 151
# Use of uninitialized value.
File 'HD:My apps:programming:MacPerlŸ:lib:File:Find.pm'; Line 158
# Can't open HD:Desktop Folder:outer:inner:t2:t2.
File 'HD:Desktop Folder:changer'; Line 9
The wierd stuff is on the last line, whiere Perl tries to open file
HD:Desktop Folder:outer:inner:t2:t2 (found where?)
If die is changed to warn the error messages go on and on, with HD:Desktop
Folder:outer:inner:t2:t2 getting bigger and bigger (...t2:t2:t2:t2:t2:t2
etc). What puzzles me is that after opening inner:t2 it should go on to
outer:t1.
Help much appreciated.
Rory
--
Rory Campbell-Lange
The Campbell-Lange Workshop, London
------------------------------
Date: Mon, 1 Nov 1999 17:51:54 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: fork()
Message-Id: <Pine.GSO.4.10.9911011747130.29670-100000@user2.teleport.com>
On Sun, 31 Oct 1999, Tim Judd wrote:
> I'm using a single perl script to run on a webserver as a cgi. within
> this cgi, i'm trying to open a second "edition" of this perl executable.
Maybe I'm misunderstanding you. If you're trying to run a CGI program
(even the one currently running), you need to implement the server's side
of the CGI protocol. This is not trivial.
http://hoohoo.ncsa.uiuc.edu/cgi/
> and I heard about fork, but I don't know how to work it.. can i get some
> syntax?
See any good book on programming on Unix systems and the Unix process
model.
> i'd ultimately like to:
>
> /usr/local/lib/perl -cw file.pl
>
> as a HTTP protocol to check file syntax.
Are you wanting your program to check its own syntax? But if you're
wanting to run that command, you should be able to do so. Be sure to
capture its error output.
my $result = `/usr/local/lib/perl -cw file.pl 2>&1`;
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 01 Nov 1999 23:17:19 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: help with if,elsif
Message-Id: <3cpT3.18066$23.981779@typ11.nn.bcandid.com>
In article <7vkdkt$6bk$1@nnrp1.deja.com>, <pooh23@my-deja.com> wrote:
>Hi,
>I'm trying to convert asp code to perl. I have a webpage
><http://www.uwex.edu/ces/shwec/specialist.htm> that uses the drop down
>box. Based on what the user selects, it displays a webpage. It was
>working find on a MIIS, but when we move the site to a unix server, the
>asp didn't work.
Do you have an ASP interpreter in the Unix web server?
>this is what the code looks like so far in perl:
>#!/usr/bin/perl
This should have a -Tw on it. Then you should use strict, and probably
use CGI.
>if ($varname eq "0") {
. . .
>}
>elsif ($varname eq "11") {
> ...do other stuff
>}
>else {
> ...do this if none of the other conditions are met
>}
Syntax looks good.
>I'm a beginner at this. I'm not sure how to say display this page. I
>use the redirect response in asp.
To redirect in a CGI, you should send back a Location: header instead
of the Content-Type: header. To display stuff in a CGI program, you
can print it.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Nov 01 1999
7 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Mon, 1 Nov 1999 16:55:30 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: I'm a bit lost with this LWP problem
Message-Id: <Pine.GSO.4.10.9911011652210.29670-100000@user2.teleport.com>
On Thu, 28 Oct 1999, Bill Moseley wrote:
> I'm passing it www.test.com:44991/test and I get the error:
> Can't locate URI/www_Otest_Ocom.pm in @INC (@INC contains: /home/....)
> at (eval 21) line 3.
>
> What are those "_0" doing there?
I don't see any "_0", but I see "_O". I wonder whether the error message
might have included some control characters which caused something weird
on your monitor.
> If I add http:// to the URL it works fine. If I remove the port number
> then it gives me the "400 URL must be absolute" error.
Proxy?
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 02 Nov 1999 00:42:27 GMT
From: syran@best.com (Jim Matzdorff)
Subject: making a variable length string
Message-Id: <381e3373$0$218@nntp1.ba.best.com>
Good day,
Synopsis: I am curious what's the best way to make a variable length
string full of 0's, and to boot, prepend that with a number of of 1's
and 0's.
Specifics:
I have a string that can be any length, but the entire string must be
composed (initially) of 0's. Thereafter, I need to prepend this string
with 1-5 '1'es, depending on yet another variable, padding the end with
0's. Err, perhaps an example is a better illustration
For instance,
given the number 10 for the length of the initial string, i would wind
up with:
'0000000000'
and give a number 3 for the number of '1's to prepend, i would end up
prepending the string:
'11100' for an end result of
'111000000000000'
(essentially, the number of 1's to prepend, up to 5, is the second
variable, padded until the 5th char with 0's).
ex.2: given 8 for length, and 4 for 1's, i would end up with
1111000000000'
So far, I have ugly code that does this:
#!/usr/local/bin/perl -w
use strict
$::initial_length = $ARGV[0];
$::num_ones = $ARGV[1];
my $string = "";
my $loop = 0;
my $one = "";
foreach (1..$::initial_length) { $string .= '0' }
while ($loop < 5)
{
$one .= (($loop++ < $::num_ones) ? "1" : "0");
}
$string = $one . $string;
print "here ya go: $string\n";
exit;
#yo!> icky 5 3
here ya go: 1110000000
#yo!> icky 10 2
here ya go: 110000000000
which does the job, but is seems like it's really ugly. Since there are
lots of people who know how to do funky perl things out there, i thought
to get someone else's advice.
feel free to make assumptions for area's i have not specified, as i end
up learning more that way anyhow :)
thanks in advance,
--jim
--
--
If life is a waste of time, and time is a waste of life,
then let's all get wasted together and have the time of our lives.
------------------------------
Date: Mon, 1 Nov 1999 17:18:56 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: making a variable length string
Message-Id: <MPG.1287dbd8c678339698a17c@nntp.hpl.hp.com>
In article <381e3373$0$218@nntp1.ba.best.com> on 02 Nov 1999 00:42:27
GMT, Jim Matzdorff <syran@best.com> says...
> Synopsis: I am curious what's the best way to make a variable length
> string full of 0's, and to boot, prepend that with a number of of 1's
> and 0's.
Immediately, I think of the 'x' operator.
> Specifics:
> I have a string that can be any length, but the entire string must be
> composed (initially) of 0's. Thereafter, I need to prepend this string
> with 1-5 '1'es, depending on yet another variable, padding the end with
> 0's. Err, perhaps an example is a better illustration
>
> For instance,
> given the number 10 for the length of the initial string, i would wind
> up with:
>
> '0000000000'
>
> and give a number 3 for the number of '1's to prepend, i would end up
> prepending the string:
>
> '11100' for an end result of
>
> '111000000000000'
>
> (essentially, the number of 1's to prepend, up to 5, is the second
> variable, padded until the 5th char with 0's).
>
> ex.2: given 8 for length, and 4 for 1's, i would end up with
> 1111000000000'
>
> So far, I have ugly code that does this:
<SNIP> of agreedly ugly code, which doesn't even compile because of a
missing semicolon after 'use strict'. :-)
> #yo!> icky 5 3
> here ya go: 1110000000
> #yo!> icky 10 2
> here ya go: 110000000000
This doesn't conform to your spec or to your first example. It should
be two 1's followed by 13 0's.
> which does the job, but is seems like it's really ugly. Since there are
> lots of people who know how to do funky perl things out there, i thought
> to get someone else's advice.
>
> feel free to make assumptions for area's i have not specified, as i end
> up learning more that way anyhow :)
All you really need to know about is the 'x' operator.
#!/usr/local/bin/perl -w
use strict;
my ($initial_length, $num_ones) = @ARGV;
my $string = 1 x $num_ones . 0 x ($initial_length + 5 - $num_ones);
print "here ya go: $string\n";
__END__
Around these here parts, that's called a 'one-liner', pardner!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 1 Nov 1999 19:45:53 -0600
From: "Randy Kobes" <randy@theory.uwinnipeg.ca>
Subject: Re: New Modules: Conversion of C-structs to Perl
Message-Id: <7vlfm6$a9j$1@canopus.cc.umanitoba.ca>
Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
wrote in message news:381D7E46.42C37F29@ife.ee.ethz.ch...
> I did not find any documented method to convert a C/C++ struct to Perl.
Hi,
I haven't looked to compare these to what you have, but there's a
couple of modules that handle structs in perl - C::DynaLib::Struct in
$CPAN/authors/id/JTOBEY/C-DynaLib-0.54.tar.gz, and Class::Template
in $CPAN/authors/id/DMR/Class-Eroot-19960603.tar.gz.
best regards,
Randy Kobes
------------------------------
Date: Mon, 1 Nov 1999 18:02:33 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl4 and Y2K
Message-Id: <Pine.GSO.4.10.9911011757140.29670-100000@user2.teleport.com>
On Mon, 1 Nov 1999, Kragen Sitaker wrote:
> It almost looks as if you're deliberately trying to mislead people into
> thinking perl4 has Y2K bugs in it so they will upgrade, but I can't
> imagine you'd stoop to that kind of manipulative dishonesty.
I wonder how many people have heard yet that old versions of Perl have Y2K
bugs. I'm sure that there are many managers who haven't heard this, and it
might do some good if someone were to tell them. Of course, it has often
been clearly stated that Larry Wall has no intention of working on Perl4
to make it Y2K compliant. In fact, the Perl4 sources haven't been
maintained for many years now, and it may be that no one will be able to
find and fix any Y2K bugs in the time remaining.
Don't you think that anyone who is worried about Y2K bugs in that old
version of Perl should upgrade at once?
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 1 Nov 1999 23:08:42 -0000
From: "Martin Elliott" <martin@mert.globalnet.co.uk>
Subject: Premature End Of Script Headers
Message-Id: <7vl6n1$et6$1@gxsn.com>
When I run my Perl CGI on server, having tested it with Perl Builder
off-line, I get a 'Premature End Of Script Header' error in the error log.
Does anyone know what this means and how to fix it as I am still learning
Perl and trying to get to grips with it?
Thanks for your time,
Martin
p.s. sorry for the cgi content, but I can't approve any messages to
comp.infosystems...cgi.
------------------------------
Date: Mon, 01 Nov 1999 19:17:47 -0500
From: Aaron Walker <amwalker@gate.net>
Subject: Re: Premature End Of Script Headers
Message-Id: <381E2DAB.3DD05AC1@gate.net>
Martin Elliott wrote:
> When I run my Perl CGI on server, having tested it with Perl Builder
> off-line, I get a 'Premature End Of Script Header' error in the error log.
>
> Does anyone know what this means and how to fix it as I am still learning
> Perl and trying to get to grips with it?
>
> Thanks for your time,
>
> Martin
>
> p.s. sorry for the cgi content, but I can't approve any messages to
> comp.infosystems...cgi.
well, if you are sure there is nothing wrong with the script that one or all
of the following things need to be done:
1) make sure that the script has the proper file permissions (it needs to be
executable).
2) make sure you upload the perl script in ASCII mode and not binary
3) make sure you have the proper path to the perl executable:
#!/usr/bin/perl
Hope this helps,
Aaron
------------------------------
Date: Tue, 02 Nov 1999 00:57:17 GMT
From: dVoon <dvoon@my-deja.com>
Subject: Report pagebreak & page-count
Message-Id: <7vlctc$uf9$1@nnrp1.deja.com>
Hi all,
I have a series of reports to print. Each report resites in a different
subroutine, has its own format and top-of-page-format and so on. What I
want is to force a page-break and reset the page count after every
report. I have this subroutine below:
sub linefeed{
$~ = "LINEFEED";
write( STDOUT );
$% = 0;
$- = 0;
format LINEFEED =
.
}
so that I can do something like:
&report1();
&linefeed();
&report2();
&linefeed();
&report3();
:
The problem is, if I set the $% to 0, it won't linefeed. If I remove the
line $%=0, it linefeeds but page-count won't be correct. I knew the
problem is that the next linefeed won't be triggered unless
top-of-page-format is triggered with a page-count not equal to 0. But I
just don't know how to solve the problem. Any idea? Thanks.
Daniel
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 02 Nov 1999 00:55:24 GMT
From: bh447@freenet.carleton.ca (Markus Svilans)
Subject: Something like FLY except for JPGs
Message-Id: <381e360a.6191314@news.ncf.carleton.ca>
Does anybody know where I could get my hands on a command line
graphical program similar to Fly (available at
http://www.unimelb.edu.au/fly/fly.html) except that it can process
JPGs? At the very least I need something that can take Jpegs as input
files, resize them to thumbnail size and save the output to a GIF.
If anyone can help me out, I'd be very grateful. Please reply both by
email and to the newsgroup, thanks!!
-Markus
--
Rainy days and automatic weapons always get me down.s
------------------------------
Date: 2 Nov 1999 01:08:21 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Something like FLY except for JPGs
Message-Id: <slrn81sekc.314.mgjv@wobbie.heliotrope.home>
On Tue, 02 Nov 1999 00:55:24 GMT,
Markus Svilans <bh447@freenet.carleton.ca> wrote:
> Does anybody know where I could get my hands on a command line
> graphical program similar to Fly (available at
> http://www.unimelb.edu.au/fly/fly.html) except that it can process
> JPGs? At the very least I need something that can take Jpegs as input
> files, resize them to thumbnail size and save the output to a GIF.
PerlMagick will do what you want, but it may be a bit overkill. On the
other hand, it may not.
http://www.wizards.dupont.com/cristy/ImageMagick.html
Martien
--
Martien Verbruggen |
Interactive Media Division | Little girls, like butterflies, need
Commercial Dynamics Pty. Ltd. | no excuse - Lazarus Long
NSW, Australia |
------------------------------
Date: Mon, 1 Nov 1999 16:38:42 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Strange Bus error problem
Message-Id: <Pine.GSO.4.10.9911011637000.29670-100000@user2.teleport.com>
On 28 Oct 1999, James Porritt wrote:
> I'm currently experiencing a very awkward perl problem. A Bus error is being
> produced after my perl code has finished running.
It sounds as if your perl binary may be miscompiled. Try rebuilding it. If
it still has this problem, you may get some help by filing a report via
the perlbug utility. Then again, you may not. :-)
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 1 Nov 1999 17:25:43 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: string number conversion
Message-Id: <Pine.GSO.4.10.9911011723580.29670-100000@user2.teleport.com>
On Fri, 29 Oct 1999, Brett W. McCoy wrote:
> sub frac2dec {
> my $fracnum = shift;
> (my $int, my $frac) = split(' ', $fracnum);
> my $decimal = eval $frac;
> return $int + $decimal;
> }
>
> print frac2dec('4 2/5');
That's an evil eval. Wouldn't this be better without it?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 1 Nov 1999 19:15:49 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: system commands
Message-Id: <Pine.GSO.4.10.9911011910500.2694-100000@crusoe.crusoe.net>
[posted & mailed]
On Nov 1, Aaron Walker blah blah blah:
> #!/usr/bin/perl -w
>
> require("cgi-lib.pl");
> &ReadParse;
You might consider using CGI.pm, available with most modern distributions
of Perl 5.
> @output = `perl $in{'file'}`;
That only captures STDOUT from the command, and the warnings and die()
messages are sent on STDERR. Consider using IPC::Open3, available on CPAN
(http://www.perl.com/CPAN). Also, this is WAY too insecure for my tastes.
If someone finds the URL of this program, they could enter this as the
filename: "0; rm -rf /". That would make your command:
@output = `perl 0; rm -rf /`;
That's a terrible thing to do.
> print "Content-type: text/html\n\n";
You might consider just making this text/plain...
> print "Output of \"perl $in{'file'}\":\n<br><br>\n";
> print "@output";
You probably don't want quotes around that array. In fact, why not just
store the return value in a scalar (but you won't do that, since you'll be
using IPC::Open3, like I suggested).
--
MIDN 4/C PINYAN, USNR, NROTCURPI
jeff pinyan japhy@pobox.com
perl stuff japhy+perl@pobox.com
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
------------------------------
Date: 1 Nov 1999 23:28:34 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: What makes the web go?
Message-Id: <slrn81s8p7.2o9.mgjv@wobbie.heliotrope.home>
On 28 Oct 1999 03:33:51 -0500,
Abigail <abigail@delanet.com> wrote:
> Martien Verbruggen (mgjv@comdyn.com.au) wrote on MMCCXLIX September
> MCMXCIII in <URL:news:gUOR3.184$z73.4674@nsw.nnrp.telstra.net>:
> __
> __ *nod* They may be able to handle Yahoo. I don't know whether, given
> __ enough hardware, MS SQL could perform well enough. But I know a few
> __ things: The system would not be nearly as stable as Sybase on Solaris,
> __ for example. And given the same investment, the latter would probably
> __ outperform the MS solution by far. And if you then look at ASE on
> __ Linux, which is a possibility as well nowadays,
>
> *cough* On _Linux_? No, thanks.
>
> To run a database in a large production environment, you need several
> things. Good support for many processors. Technical support for your
> server. And in the case of Sybase, raw devices.
\begin[more-and-more]{offtopic}
Yep. I agree with you there. I was more suggesting that running sybase
on Linux is at least as good as the MS solution. And as of version 12 of
Sybase, the necessity for raw devices for data integrity will not be
there anymore on most platforms (although I don't know about Linux, like
you say, it's pretty unsupported).
Good support for many processors is only necessary if you know you
will need many processors, which of course, you almost always will, some
time. But Linux does support at least the same level of SMP as NT, or
better, not?
Personally, I'd shell out the money for anything that needs to run in a
production sense, and has anything valuable on it. However, the choice
for MS/Intel is often made by managers who only see the perceived bottom
line, which tells them that it's cheaper to buy that solution than a
SunOS/Sparc solution. What they don't see is the extra cost of
maintenance, downtime, data corruption, administration etc that comes
for free with a MS system.
> AFAIK, Sybase 11.9.x isn't available on Linux yet - and for the 11.0.3.3
> version, you cannot get support. Support that'll be dropped on other
> platforms next year anyway (except VMS - they get another 4 years).
It is available. I have it on a CD here, and you can get it from sybase
as well. I believe they've got something like linux.sybase.com up.
\end{offtopic}
Martien
--
Martien Verbruggen |
Interactive Media Division | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd. | from a rich salesperson.
NSW, Australia |
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1248
**************************************