[12251] in Perl-Users-Digest
Perl-Users Digest, Issue: 5851 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 1 16:07:27 1999
Date: Tue, 1 Jun 99 13:00:23 -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 Tue, 1 Jun 1999 Volume: 8 Number: 5851
Today's topics:
Re: An Efficient Split Function <uri@sysarch.com>
Re: answering my own question (Clinton Pierce)
Re: answering my own question <jbc@shell2.la.best.com>
Re: Artistic License <nobody@newsfeeds.com>
Re: Better than Perl (I R A Aggie)
Re: Can I do this with an "if" statement? (Larry Rosler)
Cryptic error message <collin.starkweather@colorado.edu>
Digital Signatures in PERL/Win32 <crockett@uic.edu>
Re: Expire a Page <donny@impulsesoftware.com>
Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe <dhenders@cpsgroup.com>
HELP!!!!!!!! <john@revotek.com>
Re: hey p5p! Bug w/proto (\@)? <bhuston@eden.com>
Re: how to eliminate double counting for hit counter <garethr@cre.canon.co.uk>
Implementing a MSNBC-like Voting mechanism <lewie@leland.Stanford.EDU>
Re: Implementing a MSNBC-like Voting mechanism <revjack@radix.net>
Re: Is 'Global symbol "%s" requires...' Fatal? (Ilya Zakharevich)
Re: Is split (surprisingly, amazingly) slow? (J. Moreno)
Re: Making Perl Wait <cassell@mail.cor.epa.gov>
Re: Making Perl Wait (Greg Bacon)
Re: manipulating text file... (Larry Rosler)
Re: manipulating text file... (Dave Cross)
Newbie Q: how to build html table w/ cgi.pm (Ken Bass)
Re: perl application help needed (Dave Cross)
Re: Perl, Y2K, and idiots (Dave Cross)
Re Better than Perl <CybdaNony@nym.alias.net>
Re Better than Perl <CybdaNony@nym.alias.net>
Re: Sybperl (Dave Cross)
system() 'n' stuff... <mdw190@psu.edu>
system() 'n' stuff... <mdw190@psu.edu>
Re: system() 'n' stuff... (Jozxyqk)
Re: Time Error <emschwar@rmi.net>
Re: Time Error <cassell@mail.cor.epa.gov>
Re: What's wrong with this hit counter? (Michel Dalle)
Re: Y2K infected Perl code ()
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 01 Jun 1999 15:04:32 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: An Efficient Split Function
Message-Id: <x7k8tneo8v.fsf@home.sysarch.com>
>>>>> "WSL" == William S Lear <rael@see.sig> writes:
WSL> I am reposting this to comp.lang.perl.misc since there seems to be
WSL> some confusion (and, I must say, some surprising anger) over the
WSL> contents of this post.
WSL> Let me outline my motivation for this posting to try to avert any
WSL> flame wars: we have a Perl program that processes log files that are
WSL> fairly regular --- they have lines split by a field separator
WSL> character; the fields are fixed in number; the fields are of a
WSL> predictable length. This Perl program is taking nearly 20 hours to
how predictable are the field lengths? are they fixed? if so, then
perl's unpack function is much faster than split. try benchmarking it
against your split code.
and if you want the fastest way to do it, try a c loop that looks for
the separator char and replaces it with \0. keep track of the start of
each field with a char * array. this is a single pass over the string
and probably couldn't get much faster. it modifies the string in place
so it is destructive.
<untested c code >
char *field_ptrs[10] ;
char **curr_fld_ptr = field_ptrs ;
char string[] = "test:data:full:of:fields" ;
char *cp ;
cp = string ;
*curr_fld_ptr++ = cp ;
while( *cp ) {
if ( *cp == ':' ) {
*cp++ = '\0' ;
*curr_fld_ptr++ = cp ;
}
else {
cp++ ;
}
}
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Tue, 01 Jun 1999 17:44:47 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: answering my own question
Message-Id: <37541bba.1567965004@news.ford.com>
On Tue, 01 Jun 1999 10:30:41 -0400, Greg Bartels <gbartels@xli.com> wrote:
>public domain - no copyright, can be copyrighted
> thereby taking what was once public domain
> out of the public domain. **not good**
Tell me how I can copyright Shakespeare, please! I'll give you a cookie.
--
Clinton A. Pierce "If you rush a Miracle Man, you get rotten
clintp@geeksalad.org Miracles." -- Miracle Max, The Princess Bride
http://www.geeksalad.org
------------------------------
Date: 01 Jun 1999 18:39:39 GMT
From: John Callender <jbc@shell2.la.best.com>
Subject: Re: answering my own question
Message-Id: <375428eb$0$229@nntp1.ba.best.com>
Greg Bartels <gbartels@xli.com> wrote:
> As it happend, I was at the bookstore
> this weekend, browsing for a copy of
> "The Mythical Man-Month" when I happened
> across an O'Reilly book with the title
> "Open Sources", with a big sticker
> saying it was a "New Release".
> if it isn't a book for everyone on this list,
> it is at the very least a book anyone should
> read before evangilizing for or against
> open source.
The full book is now available online, by the way. See:
http://www.oreilly.com/catalog/opensources/book/toc.html
--
John Callender
jbc@west.net
http://www.west.net/~jbc/
------------------------------
Date: Tue, 1 Jun 1999 12:05:15 -0700
From: Anonymous <nobody@newsfeeds.com>
Subject: Re: Artistic License
Message-Id: <37542c84@anonymous.newsfeeds.com>
Tad:
> I have 2 unpacked perl tarballs here.
> They both have a file named 'Artistic' at the top level.
> The tarball you looked at doesn't have that file?
I only installed binaries and someone else has my fsf disk now. I
didn't want to download the whole thing at 28.8k...
Matt:
>held some poor sysadmin at gun point while typing in the
following:
hahaha! I put the gun to my own head ;-)
>http://www.activestate.com/corporate/artistic_license.htm
thanks :-)
--
David
dchristensen@california.com
--------== Posted Anonymously via Newsfeeds.Com ==-------
Featuring the worlds only Anonymous Usenet Server
-----------== http://www.newsfeeds.com ==----------
------------------------------
Date: 1 Jun 1999 19:27:20 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Better than Perl
Message-Id: <slrn7l8d6r.d5p.fl_aggie@thepentagon.com>
On 01 Jun 1999 10:49:19 -0700, Randal L. Schwartz <merlyn@stonehenge.com>, in
<m1ogiz6cbk.fsf@halfdome.holdit.com> wrote:
+ >>>>> "Anony" == Anony Mail <AnnonyMai1@nym.alias.net> writes:
+
+ Anony> Try Unicon, its more powerful.
+ I might even believe you better if you'd come out from behind that
+ anonymous mask.
Well, if he would use more of a hook...like how this "unicon" is better,
and why I should burn my perl books to pick this up...
James
------------------------------
Date: Tue, 1 Jun 1999 11:54:45 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Can I do this with an "if" statement?
Message-Id: <MPG.11bdcc52776de76e989b4c@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <x3ybtez536w.fsf@tigre.matrox.com> on Tue, 1 Jun 1999
11:51:51 -0400 , Ala Qumsieh <aqumsieh@matrox.com> says...
> lr@hpl.hp.com (Larry Rosler) writes:
> > if (1 <= $ans && $ans <= 60) {
> > ...
> >
> > No shorthand available for that.
>
> In cases like these, Python has a very useful, and intuitive
> feature. It allows you to do something like:
>
> if 1 <= ans <= 60:
> # bla bla
>
> Is this a tough thing to add to Perl? I'll try to investigate this
> myself, but maybe someone else (more knowledgable with Perl's guts)
> would be able to elaborate more on this.
>
> Comments anyone?
In the C family,
if (1 <= ans <= 60) ...
means compare 60 against the Boolean value of (1 <= ans). Needless to
say, this is very unlikely to be what the programmer really intends, but
it is consistent with the syntax and semantics of the language in
general, so that's what you get -- tough noogies. 'lint' gives a
warning:
precedence confusion possible: parenthesize!
By the way, it could have associated this way:
1 <= (ans <= 60)
(and I thought it did before I tested it :-) but I don't care because I
would never ever write such a thing in C without explicit parentheses.
Perl, in its wisdom (i.e., coming later :-), has made that
unparenthesized expression a syntax error.
As there is no existing code to break by ascribing semantics to the
unparenthesized expression, you could probably get away with
implementing it. But the idea of a ternary operator like that is a bit
bizarre. What if the two operators were different? inconsistent?
unrelated? I guess TRUE simply means that both Booleans are true.
The benefit of such a syntax is clear -- one evaluation of the operand.
But to me, it seems like opening a proverbial can of worms, when one
isn't particularly hungry. Maybe others will cheer for it.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 01 Jun 1999 12:31:27 -0600
From: Collin Starkweather <collin.starkweather@colorado.edu>
Subject: Cryptic error message
Message-Id: <375426FF.A68A5890@colorado.edu>
When I close an app, I receive the message
Attempt to free unreferenced scalar during global destruction.
I've tried doing just about everything, including imposing use strict
vars on my code and all of the modules I've written, to figure out where
the scalar comes from.
Any suggestions? I'd be happy to do as much digging as is required if
someone will point me in the right direction.
Of note: I'm using quite a few Perl/Tk modules.
Thanks in advance,
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Collin Starkweather (303) 492-4784
University of Colorado collin.starkweather@colorado.edu
Department of Economics http://ucsu.colorado.edu/~olsonco
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Tue, 1 Jun 1999 12:35:19 -0400
From: "Mark D. Crockett, MD" <crockett@uic.edu>
Subject: Digital Signatures in PERL/Win32
Message-Id: <7j15lr$1nr6$1@piglet.cc.uic.edu>
Is anyone out there using perl to do digital signatures in a win32
environment? I could use some help with this. Please reply or email me if
you know how to do this!
Mark
tox911@hotmail.com
------------------------------
Date: Tue, 01 Jun 1999 18:01:18 GMT
From: Donny Widjaja <donny@impulsesoftware.com>
Subject: Re: Expire a Page
Message-Id: <37542166.24C6A16A@impulsesoftware.com>
You can use cookie and set the timeout to immediate. If you are running
your own server, you might want to use cron to delete the old files.
Matt wrote:
>
> Objective: I want to make a page expire after x minutes or seconds.
>
> Details: I have to create a new page, write HTML to it, send the user
> there, then after the user is done with that page the page would expire so
> no one could go back to it. How would this be done?
------------------------------
Date: 01 Jun 1999 13:37:50 -0500
From: Dale Henderson <dhenders@cpsgroup.com>
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <87aeuj3gxt.fsf@camel.cpsgroup.com>
>>>>> "Eric" == Eric Bohlman <ebohlman@netcom.com> writes:
Eric> : www.hollycole.com/WWWboard/wwwboard.html
Eric> : # get information
Eric> : local($string) = @_;
Eric> : ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
Eric> : localtime(time);
Eric> : # calculate useful values
Eric> : $cent = ($year < 70) ? 20 :19;
Eric> : $lyear = $year + $cent*100;
Eric> So Daniel Johns should have titled his song "Anthem for the
Eric> Year 10100"?
um that would actually work for all years past 1970. ofc it would
look like 2001..2068,2069,1970,1971..2038
(for $year=100, $cent=19, $lyear=100+19*100=1900)
stupid and buggy, but it does work for the intended range.
ofc $year+=1900 works much better ;)
------------------------------
Date: Tue, 1 Jun 1999 12:16:39 -0700
From: "John Espinosa" <john@revotek.com>
Subject: HELP!!!!!!!!
Message-Id: <928264621.535.44@news.remarQ.com>
I am looking for a cgi script which makes a clientside console to modify a
web page.If someone has a core script or knows where I might find one I
would really appreciate. I haven't worked with perl too much and I don't
have time to write up a complete script from scratch.
Thank you very much,
John Espinosa
------------------------------
Date: Tue, 01 Jun 1999 19:47:57 GMT
From: Bill Huston <bhuston@eden.com>
Subject: Re: hey p5p! Bug w/proto (\@)?
Message-Id: <NNW43.3158$T7.263388@typhoon-sf.snfc21.pbi.net>
Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
: Bill Huston <bhuston@eden.com> wrote:
: > mysub ( @a1, @opts ); # array
: > mysub ( (1,2,3), @opts); # literal list
: > mysub ( returns_list(), @opts); # sub() returns list
: > mysub ( keys %h, @opts); # perlfunc returns list
: There is no way to cleanly do this.
I was afraid of that. I'm still playing with (\*) ...
: No. Not even Perl builtins can do this. I'm not even sure what
: "builtin behavior" you refer to above.
I'm refering to how when passing a list-like thing to most perlfuncs
which take such, one can use an array, a literal list, a sub (or another
perlfunc) which returns a list. Examples:
join (":", @list); # all
join (":", returns_list()); # these
join (":", qw(literal list)); # work
join (":", ("literal", "list2")); # just
join (":", keys %h); # fine
There are other cases when a list and and an array seem to be
interchangable:
@a=(1,2,3);
$b=$a[0]; # $b is 1
$b=(1,2,3)[0]; # same thing
So... if these can be called identically...
sub s1 (@) {
...play with @_
}
sub s2 (\@) {
... play with ref to array
}
That is...
s1(@foo); # works
s2(@foo); # works
(Note: These seem to work identically, except for the
syntax inside the sub. Both can even change calling array!!!)
So, (because of the builtin behavior... see above) it makes me want
to believe that these would work too:
s1( (1,2,3) ); # works
s2( (1,2,3) ); # Bzzzzz... compile error
s1( returns_list() ); # works
s2( returns_list() ); # compile error
s1( keys %somehash ); # works
s2( keys %somehash ); # compile error
One thing I love about perl is that when just learning it,
things that *seem* likely to work, often do. Once you get started,
Perl becomes very intuitave. You try something... it works!
Just the way that you expect it to.
I think if the behavior of (\@) [or some new proto character]
could be enhanced to provide the sub a reference to any list-like
thing passed into it (perhaps read-only), it would make subs much
more powerful.
--- Bill
------------------------------
Date: Tue, 1 Jun 1999 19:39:07 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: how to eliminate double counting for hit counter
Message-Id: <siwvxnyalg.fsf@cre.canon.co.uk>
Lewis Lin <lewie@leland.Stanford.EDU> wrote:
> I'm creating a script for website hits. Everytime someone clicks on a
> particular page, I want to register it as a hit. However, if this
> person comes back and tries to click again, it shouldn't register.
As others have explained, you can't identify individuals. But you can
get a count of the number of different IP addresses that have accessed
your page by examining your web server's access log. Apache's default
access log format places the IP address in the first field of each line,
so you can get a count like this:
$ACCESS_LOG = "/usr/local/apache/logs/access_log";
$PAGE = "/cgi-bin/my-script";
open ACCESS_LOG or die "Can't open $ACCESS_LOG: $!";
$hits = keys %{{map {(split)[0,1]} grep /$PAGE/, <ACCESS_LOG>}};
close ACCESS_LOG;
--
Gareth Rees
------------------------------
Date: Tue, 1 Jun 1999 10:51:31 -0700
From: Lewis Lin <lewie@leland.Stanford.EDU>
Subject: Implementing a MSNBC-like Voting mechanism
Message-Id: <Pine.GSO.3.96.990601104728.4138A-100000@tree0.Stanford.EDU>
Sorry to re-kindle the debate on hit counters. Let me rephrase my
question.
What I really want to do is creating a voting mechanism using Perl. A
good example is http://www.msnbc.com, where they allow readers to vote on
an article on a scale of 1-10 at the bottom of each story. When a user
tries to vote again, a pleasant message says, "Sorry you've already voted
on this story."
I would like to replicate this mechanism using Perl. What is the best way
of doing this? SQL Database which keeps track of all user IP addresses
and a bit which keeps track if they've voted on a particular story? Or is
there something I can do with cookies?
Thanks for your help!
Lewis
------------------------------
Date: 1 Jun 1999 18:43:00 GMT
From: Floyd Lithuania <revjack@radix.net>
Subject: Re: Implementing a MSNBC-like Voting mechanism
Message-Id: <7j19jk$7ci$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
Lewis Lin explains it all:
:Sorry to re-kindle the debate on hit counters. Let me rephrase my
:question.
:What I really want to do is creating a voting mechanism using Perl. A
:good example is http://www.msnbc.com, where they allow readers to vote on
:an article on a scale of 1-10 at the bottom of each story. When a user
:tries to vote again, a pleasant message says, "Sorry you've already voted
:on this story."
Just keep in mind that it's not hard to subvert that sort of thing. I just
went to the msnbc site you cited and voted twice for the same story (gave
it a 1 and a 7). If someone is even modestly determined to stuff your
e-ballot box, they'll succeed.
:I would like to replicate this mechanism using Perl. What is the best way
:of doing this? SQL Database which keeps track of all user IP addresses
:and a bit which keeps track if they've voted on a particular story?
You can't really track on IP addresses - some proxies make 10,000
widget.com employees all look like the same person, while others can
shuffle the IP addresses around so as to make one visitor look like
twenty.
:Or is there something I can do with cookies?
The msnbc site is doing it with cookies. (no less than *5* cookies dealt
from two page requests, urgh). Try voting with your browser set to disable
cookies, you'll see what I mean.
--
/~\ subversive mustache disseminate merchandise Maya Mynheer tic lo
C oo Balkan chancellor Oliver Harris alliance Armco preamble steppe
_( ^) 1 , 0 0 0 , 0 0 0 m o n k e y s c a n ' t b e w r o n g
/___~\ http://www.radix.net/~revjack/mnj revjack@radix.net
------------------------------
Date: 1 Jun 1999 18:01:15 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Is 'Global symbol "%s" requires...' Fatal?
Message-Id: <7j175b$i6t$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to M.J.T. Guy
<mjtg@cus.cam.ac.uk>],
who wrote in article <7j12c3$5pf$1@pegasus.csx.cam.ac.uk>:
> >Would you prefer to see only one syntax error per compilation?
>
> No, I wouldn't. When will this be fixed for regexes? :-)
Probably when there is anyone who is interested in this at least a
tiny bit...
Ilya
------------------------------
Date: Tue, 1 Jun 1999 15:04:36 -0400
From: planb@newsreaders.com (J. Moreno)
Subject: Re: Is split (surprisingly, amazingly) slow?
Message-Id: <1dsq5x8.1lzsr4fk7y7d7N@roxboro0-0013.dyn.interpath.net>
Jonathan <jonathan@meanwhile.freeserve.co.uk> wrote:
> 3/ I assumed that any reader who wanted more details would have the
> intelligence, wit, savvy etc to dejanews the original posts.
> That's why I quoted the exact subject line. Seems I was wrong. I apologize
> for over-estimating your resourcefulness.
Messages aren't referred to by subject except locally and haphazardly.
They are referenced by message id. You can even put it into a form that
will bring up the article in dejanews, like so:
<http://www.deja.com/=dnc/msgid.xp?MID=%3C87k8uf459h.fsf@lisa.zopyra.com%3E>
Also,
In article <7iuu05$fq7$1@news8.svr.pol.co.uk> Jonathan wrote:
> The author of the post was surprised because the Python version ran **4**
> times as fast as the Perl code above on large files. And with fairly
> minimal effort he was able to write C++ and STL code that ran more than 30
> times faster than the Perl above. (And generally STL code can be replaced
> with C several times faster on current compilers.)
Unless he posted new numbers elsewhere, Python did about 2.5 times better,
not 4 times. As for the rest -- I'll leave that to other people.
--
John Moreno
------------------------------
Date: Tue, 01 Jun 1999 11:23:18 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Making Perl Wait
Message-Id: <37542516.3482E998@mail.cor.epa.gov>
Greg Bacon wrote:
>
> In article <therzog-0106990214050001@therzog-host105.dsl.visi.com>,
> therzog@knotech.com (Tim Herzog) writes:
> : which of course is plenty for anyone with a Unix or programming
> : background, but to anyone else sounds like:
>
> If someone doesn't have a programming background, what is he doing using
> a programming language?
Heh.
But seriously folks, I don't see how one can cover all the
possible permutations of function names and (mis)features
when someone moves to a new language.. say, Perl. Not
everyone learns programming on a unix system. And it seems
like most of the people who visit this ng are self-taught..
and usually on win32 boxes. Which isn't their fault when
they're still trying to *learn*. Only later when they should
have learned better. :-)
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 1 Jun 1999 19:11:51 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Making Perl Wait
Message-Id: <7j1b9n$554$1@info2.uah.edu>
In article <37542516.3482E998@mail.cor.epa.gov>,
David Cassell <cassell@mail.cor.epa.gov> writes:
: But seriously folks, I don't see how one can cover all the
: possible permutations of function names and (mis)features
: when someone moves to a new language.. say, Perl. Not
: everyone learns programming on a unix system. And it seems
: like most of the people who visit this ng are self-taught..
: and usually on win32 boxes. Which isn't their fault when
: they're still trying to *learn*. Only later when they should
: have learned better. :-)
sleep() is specific to neither Unix nor Perl.
Greg
--
A wise man speaks because he has something to say, a fool because he has to
say something.
-- Plato
------------------------------
Date: Tue, 1 Jun 1999 12:44:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: manipulating text file...
Message-Id: <MPG.11bdd7e569b9a7fa989b4d@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <3753A3BC.4F887AB8@home.com> on Tue, 01 Jun 1999 17:08:32
GMT, Mitch <portboy@home.com> says...
> Okay, I am able to easily remove and edit fields in a text file,
> however, I still have a quick question. I have a config file that looks
> something like;
>
<SNIP data reproduced below>
>
> What I would like to be able to do is, if a user enters an input of "foo
> schnicken", I'd like to able to put that right after "foo haha" or the
> last seen "foo" entry. How can I do this?
My minimal-line solution:
#!usr/local/bin/perl -w
use strict;
my $input = 'foo schnicken';
for (my $was_a_foo; <DATA>; print) {
print "$input\n" if
!(my $is_a_foo = substr($_, 0, 4) eq 'foo ') && $was_a_foo;
$was_a_foo = $is_a_foo;
}
__END__
blah
blah blah
blah blah
blah
foo this you freak
foo me
foo bar
foo haha
blah
blah
blah
blah
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 01 Jun 1999 20:00:37 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: manipulating text file...
Message-Id: <37563bbc.705611@news.demon.co.uk>
On Tue, 01 Jun 1999 17:08:32 GMT, Mitch <portboy@home.com> wrote:
>Okay, I am able to easily remove and edit fields in a text file,
>however, I still have a quick question. I have a config file that looks
>something like;
>
>blah
>blah blah
>blah blah
>blah
>foo this you freak
>foo me
>foo bar
>foo haha
>blah
>blah
>blah
>blah
>
>What I would like to be able to do is, if a user enters an input of "foo
>schnicken", I'd like to able to put that right after "foo haha" or the
>last seen "foo" entry. How can I do this?
There's a question in perlfaq5 which asks:
How do I change one line in a file/delete a line in a file/insert a
line in the middle of a file/append to the beginning of a file?
Spounds like it might help you with your problem.
Dave...
--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>
------------------------------
Date: Tue, 01 Jun 1999 18:26:02 GMT
From: Barista@End.Of.Universe (Ken Bass)
Subject: Newbie Q: how to build html table w/ cgi.pm
Message-Id: <3754226a.13701681@nntp1.ba.best.com>
This has got to be a simple question:
I want to output a table, where each row in the table is generated at
run time. I have looked through the docs, and found the "table"
function. But it seems (at least to me) that each row has to be
specified individually.
Did I miss something? Do I need to just generate the tags myself? Can
(should?) this be done with some format statements?
Could someone give me some sample code to just spit out a table
(possibly with a header) that has, say, three columns ( 'a', 'b', 'c')
and a few rows of dummy values? I would be much obliged.
TIA
ken bass
kbb@SoftSteps.com
------------------------------
Date: Tue, 01 Jun 1999 19:54:59 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: perl application help needed
Message-Id: <37553a5e.356216@news.demon.co.uk>
On 1 Jun 1999 14:22:19 GMT, vroomzr@aol.com (VROOMZR) wrote:
>Hello,
> I'm trying to create a cgi application that will take input from my own htm
>form and then send it off to another person's cgi application, take the return
>output and use that along with some other stuff as input for another cgi
>application. Can this be done using perl and cgi, or should I use java
>servlets. The rest of this site has been written with perl and I would like to
>keep it that way. Any help or urls with help on this subject would be greatly
>appreciated. Thank you, ryan.
Yep. It can be done with Perl. Look at the LWP::Simple module from
CPAN, <http://www.cpan.org>
Dave...
--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>
------------------------------
Date: Tue, 01 Jun 1999 19:33:21 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: Perl, Y2K, and idiots
Message-Id: <37563473.4300992@news.demon.co.uk>
On Mon, 31 May 1999 17:20:50 -0700, Kristina
<kristina@greatbasin.net> wrote:
>
>By the way, I recall at some point seeing a nice FAQ/tutorial on several
>common things to check in a Perl program. For instance, check system calls
>and file opens, make sure that any user input is what you expected, etc.
>I thought it was in the main FAQ, but I don't seem to see it there.
That's the automated posting that you get the first time you post to
comp.lang.perl.misc.
Dave...
--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>
------------------------------
Date: 1 Jun 1999 18:58:47 -0000
From: John Q Public <CybdaNony@nym.alias.net>
Subject: Re Better than Perl
Message-Id: <19990601185847.17144.qmail@nym.alias.net>
We are doing a service to the Unix community.
Unicon and Icon are free, we stand to make no profit by them. We are taking our precious time to notify Unix users of a fantastic and little-known tool which can eliminate their Perly worries. Posting to 4 Unix groups without any profit motive does not qualify as spam, kid.
In fact our major discovery is that the Unix related newsgroups are heavily censored, in general, by people whose fat petards sit in plush sysadmin seats where their pay is tied to knowledge of esoteric script languages that should be replaced with modern software technology. The more newsgroups hear about Unicon, the better.
The only ID you will get is that we are not the authors of Unicon nor their representatives.
We hope other anonymous newsgroup posters will provide links to other interesting and useful tools like Unicon. We certainly thank the team of programmers that notified us about Unicon.
Anony == Anony Mail AnnonyMai1@nym.alias.net writes
Anony Try Unicon, its more powerful.
Besides spamming this to at least a few newsgroups over the past week,
like the hpux group? what does that have to do with icon? which
already makes me wonder about you, I might even believe you better if
youd come out from behind that anonymous mask.
So, reveal yourself, or be gone.
------------------------------
Date: 1 Jun 1999 19:35:39 -0000
From: John Q Public <CybdaNony@nym.alias.net>
Subject: Re Better than Perl
Message-Id: <19990601193539.24668.qmail@nym.alias.net>
Look at you, Schwartz, selling your Perl books and your Perl training and then insulting any group that threatens your livelihood with better stuff. Id say youre the spammer, if anyone.
Sincerely,
Another anonymous dude
------------------------------
Date: Tue, 01 Jun 1999 19:52:40 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: Sybperl
Message-Id: <375439e5.234776@news.demon.co.uk>
On Tue, 1 Jun 1999 08:29:54 +0800, "Mozart" <zarmo@altavista.net>
wrote:
>Hi,
>
>I am planning to use the package Sybperl.
>Anybody can send me or tell me where to find some scripting example.
>It will help me to start quicker.
The best placce for all things SybPerly is Michael Peppler's home page
at <http://www.mbay.net/~mpeppler>
hth,
Dave...
--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>
------------------------------
Date: Tue, 01 Jun 1999 14:52:15 -0400
From: Michael Willhide <mdw190@psu.edu>
Subject: system() 'n' stuff...
Message-Id: <37542BDF.3CE961C7@psu.edu>
Hello.
I need to run ftp from a script and then enter commands at the ftp
prompt from the script. Is there a way to do this with system()?
Thanks.
mike
------------------------------
Date: Tue, 01 Jun 1999 14:49:49 -0400
From: Michael Willhide <mdw190@psu.edu>
Subject: system() 'n' stuff...
Message-Id: <37542B4C.53A29CAD@psu.edu>
Hello.
I need to run ftp from a script and then enter commands at the ftp
prompt from the script. Is there a way to do this with system()?
Thanks.
mike
------------------------------
Date: 1 Jun 1999 18:59:06 GMT
From: jfeuerst@allegro.cs.tufts.edu (Jozxyqk)
Subject: Re: system() 'n' stuff...
Message-Id: <7j1ahq$1hd$1@news3.tufts.edu>
Michael Willhide (mdw190@psu.edu) wrote:
-> Hello.
-> I need to run ftp from a script and then enter commands at the ftp
-> prompt from the script. Is there a way to do this with system()?
-> Thanks.
Might I suggest that you use Net::FTP instead?
--
Josh "Jozxyqk" Feuerstein
jfeuerst@eecs.tufts.edu || joshf@quickbuy.com
"We cannot choose what we are - yet what are we, but the sum of our choices?"
-- Rob Grant, Bac>\wards
------------------------------
Date: 01 Jun 1999 12:33:02 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Time Error
Message-Id: <xkfzp2jdb4x.fsf@valdemar.col.hp.com>
Frank de Bot <debot@xs4all.nl> writes:
> I've some little trouble with the time. Today it's 1 june . But my
> script thinks it's 2 june.
<snip>
> if ($mday <10) { $mday = "0$wday"; }
^^^^^ ^^^^^ ^^^^^
Do you think perhaps that might be the problem?
And you should probably be using s?printf, anyhow. Though that wouldn't
help you here.
Oh, and please trim that painfully long .signature. 4 lines or less,
please.
-=Eric
------------------------------
Date: Tue, 01 Jun 1999 11:36:13 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Time Error
Message-Id: <3754281D.3FEDE2CD@mail.cor.epa.gov>
Frank de Bot wrote:
>
> I've some little trouble with the time. Today it's 1 june . But my
> script thinks it's 2 june. It has the same problem with other dates at
> the start of each month. Here's the script I use. If you have a better
> one, I would love to hear from it.
>
> ($sec,$min,$hour,$mday,$mon,$year,$wday) =
> (gmtime(time))[0,1,2,3,4,5,6];
> @months = ('January','February','March','April','May','June',
> 'July','August','September','October','November','December');
> @days =
> ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturdat');
>
> if ($sec < 10) { $sec = "0$sec"; }
> if ($min < 10) { $min = "0$min"; }
> if ($hour < 10) { $hour = "0$hour"; }
> if ($mday <10) { $mday = "0$wday"; }
^^^^
Hmmmm. Are you *sure* this should be $wday instead of $mday ??
> if ($mon <10) { $mon = "0$mon"; }
Just a few other comments. You might prefer to use qw// to
define @months and @days, so you can drop the quotes and commas.
You might prefer to use (s)printf instead of prepending '0'
on all those vars. I would use localtime() instead of gmtime(),
and I'd leave the time() function out of there since that's
the default.
Now then, where does your program think that the day is one off?
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 01 Jun 1999 18:01:47 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: What's wrong with this hit counter?
Message-Id: <7j176k$b71$1@news.mch.sbs.de>
In article <7j11rd$2ep$2@info2.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>In article <3753C475.EA3A96E6@sergeant.org>,
> Matt Sergeant <matt-news@sergeant.org> writes:
[snip]
>: So meaningless only applies to meaningless counters. More meaningfull
>: counters do exist and should be used if you don't have access to a
>: server log.
>
>Access to the server logs still won't let one count unique visitors,
>so they're still meaningless. Hit counters are meaningless because
>they can be artificially inflated.
Well, it all depends on what is 'meaningful' for you, no ?
If from the logfiles you can see that 80% of the "visitors" (however they are
defined) go from one particular page to another page (based on the sequence
in the logfile), this will 'mean' something for web designers.
Statisticians may argue that this is meaningless, OK, but the guy trying to
improve his website will still be happy to know that.
And if by analysing your logfiles you notice that 95% of the "visitors" seem
to keep their IP address over a period of time, you'll "know" that using IP
addresses are not such a bad identifier after all, for your environment.
(this is an intranet, with 5% traffic from proxy servers)
And suppose only 50% keep their IP address over a certain period of
time ? You still get "something" significant out of these numbers...
even half a fact is better than no fact at all, to base your decisions on.
But I agree that interpretation should not be done 'blindly'.
Michel.
P.S.: I've left my signature here just for fun :-)
--
aWebVisit - extracts visitor information from WWW logfiles and shows
the top entry, transit, exit and 'hit&run' pages, the links followed
inside your website, the time spent per page, the visit duration etc.
For more details, see http://gallery.uunet.be/Michel.Dalle/awv.html
------------------------------
Date: Tue, 01 Jun 1999 18:24:58 GMT
From: docdwarf@clark.net ()
Subject: Re: Y2K infected Perl code
Message-Id: <_zV43.340$K2.12931@iad-read.news.verio.net>
In article <3753ffd3.16977983@news.insnet.net>,
David Cantrell <NukeEmUp@ThePentagon.com> wrote:
>On Tue, 01 Jun 1999 14:19:07 GMT, docdwarf@clark.net () said:
>
>>In article <3757b388.7478603@news.insnet.net>,
>>David Cantrell <NukeEmUp@ThePentagon.com> wrote:
>>>On Fri, 28 May 1999 18:41:46 GMT, docdwarf@clark.net () said:
>>>
>>>>Please be so kind, then, as to address the situation posed and not my
>>>>responses to it... what happens if a person writing code is not a 'retard'
>>>>but the specs demand the adherance to certain standards?
>>>
>>>If standards say "thou shalt write buggy code" then anyone who is
>>>still working to those standards is a "retard". If they knew better
>>>they would either have got the standards changed or gone elsewhere.
>>>It's not as if there is an unemployment problem for perl programmers.
>>
>>It is not as though my statement was restricted to perl programmers,
>>either... if you wish to think that this particular subset of the
>>code-slinging trade is the Alpha and Omega of work-environments then
>>perhaps you might learn to post within a newsgroup limited to such coders.
>>Before there was perl there were... other languages, these have left their
>>imprints in a small supply of what is quaintly referred to as 'legacy
>>code'.
>
>Your statement would be relevant if this message was posted elsewhere.
>Unfortunately for you, it is posted only to comp.lang.perl.misc and to
>comp.software.year-2000. The intersection of those two groups could
>only be Y2K issues connected with perl.
Perhaps this might be the only intersection which you are capable of
recognising... if so, you have my sympathies. At the point where I joined
into the thread references were being made to 'programmers', not
specifically 'perl programmers'... but threads *do* wander on the UseNet,
last I looked.
>Not issues connected with
>COBOL, or Java, or Pascal. Therefore I think I was quite correct to
>assume we were only talking about perl coders.
'We'? Plural majestatus est. I read a thread in comp.software.year-2000
which, while beginning with Perl, soon expanded to the more generalised
'programmer'... and at that point I made comment.
>
>Or are you suggesting that your post to which I replied was off-topic?
>If it was, why did you bother posting it in the first place?
There's no need to worry about my motives, they are only Pure.
DD
------------------------------
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 5851
**************************************