[13371] in Perl-Users-Digest
Perl-Users Digest, Issue: 781 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 13 16:07:29 1999
Date: Mon, 13 Sep 1999 13:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 13 Sep 1999 Volume: 9 Number: 781
Today's topics:
Re: ATTN: Who would like to write a perl IDE for linux <antoine@pacha.nl>
Re: buying perl book (Help me) (Kragen Sitaker)
Re: copy (Kragen Sitaker)
Creating a File with Username and password dmcp71@my-deja.com
Re: Design Advice needed on Sending Data to Client (Kragen Sitaker)
Re: Desperately searching for perl lint (Alan Curry)
Re: File IO Question (Kragen Sitaker)
hostname translation CGI? tony_r_rice@my-deja.com
How to determine a file or folder on winNT <jonra@hotmail.com>
Re: I need a date function... (Kragen Sitaker)
Re: newbie: need help,LEARNING FROM A BOOK (Larry Rosler)
output of backticks smatta@acm.org
Re: output of backticks (Kragen Sitaker)
Re: Perl and Threads (Kai Henningsen)
Re: Perl Y2k (Kragen Sitaker)
progressiv bar when uploading... <pvinh@claranet.fr>
Re: Question about @_ / $_ <antoine@pacha.nl>
Re: rand questions <aqumsieh@matrox.com>
Re: regexp with variables containing unknown data (Kragen Sitaker)
Re: Removing a line from a text file (Kai Henningsen)
Re: running Perl files on Apache 1.3 running under Wind <barm@aarmstrong.fsbusiness.co.uk>
Re: s/// problem <uri@sysarch.com>
Re: Statistics for comp.lang.perl.misc <gellyfish@gellyfish.com>
Re: UNCRAP project proposal <uri@sysarch.com>
Re: UNCRAP project proposal <uri@sysarch.com>
Re: UNCRAP project proposal (Kai Henningsen)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 13 Sep 1999 21:55:58 +0200
From: "Anthony Adams" <antoine@pacha.nl>
Subject: Re: ATTN: Who would like to write a perl IDE for linux
Message-Id: <37dd5695$0$28771@reader1.casema.net>
Tried tcltk before?
I writes the tk stuff for ya!
Nathan Downey heeft geschreven in bericht
<37DD1B2C.8A264C02@bigfreakinserver.com>...
>I am starting to embark on a great journey. What, you may ask is that
>journey?
>I plan to develop a IDE for perl.
>
>I work with windows alot(ughh), but one thing that Is cool about windows
>is there excellent IDEs, intellisense, smart tool tips for functions...
>etc....
>
>Hmmm I was wondering wouldnt it nice to have something like that for
>perl.
>
>Initially I was thinking about using GTK, in linux.
>and I dont know about a Win32, but well see (I hate MFC)
>Anyway how many of you perl and/or C gurus out there would like to a
>participate in such a product.
>
>Just think of the purty menus (ahhhhhhhhh....) :)
>
>Drop me an email:
>nathan@bigfreakinserver.com
>
>
>
------------------------------
Date: Mon, 13 Sep 1999 19:22:07 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: buying perl book (Help me)
Message-Id: <z9cD3.8413$N77.656061@typ11.nn.bcandid.com>
In article <7rjeeq$c9$1@nnrp1.deja.com>, <mikedel@ix.netcom.com> wrote:
>O reilly books are far and away the best books out there for perl
>reference.
IMHO, the books included in pod format in the Perl distribution might
be better for Perl reference: they're more complete and more
up-to-date, and just as easy to use. (And much easier to grep.)
I think some of the O'Reilly books might be better for a Perl beginner
(who needs a tutorial, not a reference), but I haven't been a Perl
beginner since 4.036. (For 4.036 I read the man page.)
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Mon, 13 Sep 1999 19:26:58 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: copy
Message-Id: <6ecD3.8429$N77.656601@typ11.nn.bcandid.com>
In article <7rjesk$ph$1@nnrp1.deja.com>, <dave_pomeroy4266@my-deja.com> wrote:
>Is this copy actually work in perl 5 for win32? Does anyone
>know?
I can understand:
- you're trying to copy a file on a Win32 system;
- you're trying to rename a file on a Win32 system;
- you are not able to successfully do either, with various results.
In order to try to answer your question, though, I would need to know
what you are actually doing to try to copy the file. Are you using
system()? Are you using rename()? Are you using a Perl module? (I
seem to remember somebody wanted to write a file-copying module with
different implementations on each platform so that programs that needed
to copy files could be portable.)
HTH.
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Mon, 13 Sep 1999 19:07:02 GMT
From: dmcp71@my-deja.com
Subject: Creating a File with Username and password
Message-Id: <7rji0b$39f$1@nnrp1.deja.com>
Hello,
I have searched on many web sites and cannot find any help. What I need
to do is to create a login page with a username, email address and
password. When the user enters their name, username and email address,
a file is created for them using their username and password with
either a unique id number or something similar that will allow them to
enter additional information and retrieve it whenever they want. I am
certain that this is possible, but I am still learning Perl. If anyone
can help or suggest some resources, I would greatly appreciate it.
DC
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 13 Sep 1999 19:51:35 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Design Advice needed on Sending Data to Client
Message-Id: <bBcD3.8502$N77.658637@typ11.nn.bcandid.com>
In article <FDbD3.8333$N77.652041@typ11.nn.bcandid.com>,
Alan Curry <pacman@defiant.cqc.com> wrote:
>In article <5w6D3.7538$N77.609667@typ11.nn.bcandid.com>,
>Kragen Sitaker <kragen@dnaco.net> wrote:
>> [some stuff]
>There are other things in the universe besides HTTP. For text transfers,
>there is the good old "end with dot on a line by itself, and double initial
>dots in the data" method used by SMTP and NNTP.
Good point. :)
>RFC2616 obsoletes 2068 (and no I don't know what the differences are, I just
>happen to have 2616 nearby)
Doh! I need to update my rfc-index.txt :)
Thanks!
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Mon, 13 Sep 1999 19:18:43 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Desperately searching for perl lint
Message-Id: <n6cD3.8403$N77.655723@typ11.nn.bcandid.com>
In article <x3ybtb6g7n8.fsf@tigre.matrox.com>,
Ala Qumsieh <aqumsieh@matrox.com> wrote:
>My view is the following.
>
>1) It is not dangerous if you declare a variable via my(), but don't
> use it anywhere in your program. The reason is that it is probably
> a variable that you once needed, but discarded later and forgot to
> remove its declaration from your program.
So, it's clutter, and I wouldn't mind being told by the compiler that it's
time to clean up.
--
Alan Curry |Declaration of | _../\. ./\.._ ____. ____.
pacman@cqc.com|bigotries (should| [ | | ] / _> / _>
--------------+save some time): | \__/ \__/ \___: \___:
Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman
------------------------------
Date: Mon, 13 Sep 1999 19:17:50 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: File IO Question
Message-Id: <y5cD3.8400$N77.655229@typ11.nn.bcandid.com>
In article <37DD4936.F40B99B8@worldnet.att.net>,
John J. Straumann <jstraumann@worldnet.att.net> wrote:
>Yes, but it doesn't work. Only prints element 0 and then exits...
>> > if ( open( outFile, ">>$dataFile" ) )
>> > {
>> > for ( $r=0; $r<25; $r++ )
>> > {
>> > print outFile ( "$input[ $r ]" );
>> > }
>> > close( outFile );
>> > }
I tried this code and it worked correctly.
#!/usr/bin/perl -w
use strict;
my $dataFile = "xxx";
my $r;
my @input = qw(The loose goose is a moose caboose; the newbie guru
is flameproof; the paragraph of qw is deliciously inviting; and
the moon jumped over my dust balls);
if ( open( outFile, ">>$dataFile" ) )
{
for ( $r=0; $r<25; $r++ )
{
print outFile ( "$input[ $r ]" );
}
close( outFile );
}
else { die "couldn't open $dataFile: $!" }
The output it produces in the file 'xxx' is:
Theloosegooseisamoosecaboose;thenewbieguruisflameproof;theparagraphofqwisdeliciouslyinviting;andthemoonjumpedovermy
Perhaps something else is wrong elsewhere in your script? Or perhaps
what you posted wasn't exactly what you had in your script?
Good luck. :)
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Mon, 13 Sep 1999 19:51:57 GMT
From: tony_r_rice@my-deja.com
Subject: hostname translation CGI?
Message-Id: <7rjkko$5bt$1@nnrp1.deja.com>
I'm looking for a CGI that works similarly to the translation CGI at
bablefish.altavista.com but instead of translating the text, it would
translate the links.
The DNS on our firewall is extremely flakey. I would like to be able to
specify a URL to a CGI, have the CGI fetch the HTML page, parse for host
names in IMG and A tags, convert the hostnames to IP addresses and
display the resulting page. A tags should refer back to the CGI itself
to enable browsing through this CGI.
Is there such an animal out there before I go and write my own?
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 13 Sep 1999 22:27:59 +0200
From: "Jon" <jonra@hotmail.com>
Subject: How to determine a file or folder on winNT
Message-Id: <macD3.2322$rf1.14035@news1.online.no>
Hello.
Is there a way to determin whether an object is a file or a folder without
using the -d $filename. This does not seem to work on winNT.
-jon-
jonra@hotmail[remove this].com
------------------------------
Date: Mon, 13 Sep 1999 19:48:14 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: I need a date function...
Message-Id: <2ycD3.8493$N77.647179@typ11.nn.bcandid.com>
In article <fsbD3.8313$N77.650060@typ11.nn.bcandid.com>,
Jeff Battle <jjbattle@veribest.dot.com> wrote:
>Visual Basic (I'm a newbie, forgive me if it's bad taste to mention VB in
>this group)
It's always bad taste to mention VB, no matter where you are -- even in
a VB newsgroup. The people in the VB newsgroup just don't realize what
bad taste it is ;)
(Just kidding.)
> has a function called Weekday(). Give it a date and it returns
>a number representing the day of the week. I can get the weekday of the
>current day but I need the weekday of any entered date.
>
>What's the easiest way to do this in Perl?
With POSIX::mktime. This program can be run with a date like 1999 09
20 on the command-line.
It produces a warning that I'm not sure how to get rid of without using
obscenely long lines, or storing the list of day names in an array
variable, but that's from theprint statement, not the Weekday function.
#!/usr/bin/perl -w
use strict;
use POSIX 'mktime';
sub Weekday {
my ($y, $m, $d) = @_;
$y -= 1900; # years count from 0 = 1900. (100 == 2000, etc.)
$m -= 1; # months count from 0 = January
my $time = mktime(0, 0, 12, # noon: 12:00:00
$d, $m, $y);
return (localtime($time))[6];
}
print ((qw(Sunday Monday Tuesday Wednesday Thursday Friday
Saturday))[Weekday @ARGV], "\n");
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Mon, 13 Sep 1999 12:14:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: newbie: need help,LEARNING FROM A BOOK
Message-Id: <MPG.1246ed0c573a52cc989f50@nntp.hpl.hp.com>
[Posted and a anti-courtesy copy mailed.]
In article <7rjesd$pe$1@nnrp1.deja.com> on Mon, 13 Sep 1999 18:13:44
GMT, mikedel@ix.netcom.com <mikedel@ix.netcom.com> says...
> Here are other books that may help you on your perl journey. I have
> found them invaluable references:
OK, doofus. Three postings of the same crap within one hour this
morning alone. I will no longer see your postings, and I urge others to
follow suit. The lack of other responses means that they probably have
already. I just refrained from killfiling you as a matter of principle,
but even principles have limits.
My co-religionists will appreciate how appropriate this 'first' act on
my part is on this first workday of the New Year.
*PLONK*
What a satisfying sound that makes!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 13 Sep 1999 18:55:15 GMT
From: smatta@acm.org
Subject: output of backticks
Message-Id: <7rjhab$2p1$1@nnrp1.deja.com>
Folks:
trying a very simple statement that works in shell, but I get the
following error:
sh : test: ] missing
(I am expecting a number out of this command.)
$wcout = `grep -v '^$' $filename | grep -v '^[ ][ ]*$' | wc -l`;
chomp $wcout;
NOTE : each pair fo square brackets contain a space followed by a tab
character.
Essentially, I am trying to count the non blank lines in $filename.
Perl doesnt seem to like the square brackets going out to shell ?
Anyone have any ideas on this simple stmt ?
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 13 Sep 1999 19:56:44 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: output of backticks
Message-Id: <0GcD3.8522$N77.659350@typ11.nn.bcandid.com>
In article <7rjhab$2p1$1@nnrp1.deja.com>, <smatta@acm.org> wrote:
>sh : test: ] missing
>
>$wcout = `grep -v '^$' $filename | grep -v '^[ ][ ]*$' | wc -l`;
^^ ^^
Perl interpolates the special variable $' in these places ^^. What you
actually meant was a literal $ followed by a '. Try \$' instead of $'.
>Essentially, I am trying to count the non blank lines in $filename.
open F, "<$filename" or die "can't open $filename: $!";
my $wcout = 0;
while (<F>) { $wcout++ unless /^\s*$/ }
close F;
HTH.
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 13 Sep 1999 19:20:00 +0200
From: kaih=7OmpB9sHw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Perl and Threads
Message-Id: <7OmpB9sHw-B@khms.westfalen.de>
dan@tuatha.sidhe.org (Dan Sugalski) wrote on 12.09.99 in <RnUC3.5807$wW2.8602@news.rdc1.ct.home.com>:
> In comp.lang.perl.modules Kai Henningsen
> > <kaih=7OhmO-w1w-B@khms.westfalen.de> wrote: dan@tuatha.sidhe.org (Dan
> > Sugalski) wrote on 09.09.99 in <8dTB3.79$wW2.2668@news.rdc1.ct.home.com>:
> > It's also not complete yet; pthreads really want some properties which
> > aren't supported just yet, and there is discussion on how best to do it.
> > (Including "if there's no good way to do it, it may be best to just forget
> > about it - pthreads were a commitee invention anyway".)
>
> Hopefully saner heads will rule, since the way linux implements threads
> now has a few very serious limitations. Taking up slots in the process
> table is the biggest one,
Actually, I agree with the people who claim that that's no limitation at
all. It's a feature, not a bug.
>and that puts a *huge* damper on some of the
> neater things you can do with threads.
Nope.
>(Lots of the cool things involve
> gobs of threads, and, well, how many folks have process tables large
> enough to handle 250k threads? Can you even *have* that many under linux?)
I think the change-#define-maximum on 2.1.12 is 4090, default 512. I also
believe the reason for that number has disappeared in 2.3.<something>, so
that one should be able to do a lot more. I haven't looked, though. (It's
essentially an ix86 limitation, but the other architectures seem to have
accepted the same limit.)
But what on earth are you doing with *that* many threads?
Or do you mean "cool" as in "theoretical CS type solution, unusable under
any realistic circumstances"? (Far too many of those around,
unfortunately.)
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: Mon, 13 Sep 1999 19:28:30 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Perl Y2k
Message-Id: <yfcD3.8434$N77.656614@typ11.nn.bcandid.com>
In article <37DD48B9.464EA908@wg.waii.com>,
Art Haas <arthur.haas@westgeo.com> wrote:
>my $year = (localtime(time))[5];
>$year += 1900;
This is, of course, correct, and works correctly in 2000 and beyond.
localtime's sixth return value is the year, minus 1900 -- NOT the last
two digits of the year, as you might think.
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Mon, 13 Sep 1999 19:21:49 GMT
From: Vinh Philippe <pvinh@claranet.fr>
Subject: progressiv bar when uploading...
Message-Id: <37DD4DCA.FD5CB151@claranet.fr>
Hello
i've made a form which allow uploading file from pc computer.
All goes right...so i'll expect to search lib or script which show a
windows give the average of the uploading like on win95 system when
transfering file...
Is it possible?
Thank and greetings From France :)))
------------------------------
Date: Mon, 13 Sep 1999 21:59:03 +0200
From: "Anthony Adams" <antoine@pacha.nl>
Subject: Re: Question about @_ / $_
Message-Id: <37dd5748$0$28756@reader1.casema.net>
I would do it like this
@array = split(' ',$_);
This will probably work but you do a split on a whitespace. What you get are
all the lose words in the array.
like @array=this is a test
The the split sais: this
is
a
test.
Anthony
Daniel Krajzewicz heeft geschreven in bericht <37DCFF09.60466CC4@inx.de>...
Hello !!!
Ok, I see, you just misunderstood, my english´s propably not the best.
So, what I wanted to know is how can I OMIT the use of \| ???
Is the following possible :
@array = split(´ ´, _$);
$object = $array[0];
$attributes = @array[1];
?????
thanks for help,
Daniel Krajzewicz
Mark Winder wrote:
>
> No This will not work as the string will be passed into the object.
> A good way to do this is to say
>
> ($object,$attributes)=split("|","car|yellow fast low");
>
> so that your subroutine would look like
>
> sub do_things_with_objects
> {
> $p=@_;
> ($object,$attributes)=split("|",$p);
> ....
> }
>
> and this would be called with a single string parameter.
>
> The only time in simple perl that parameters can change with a
> subroutine call is if you supply a list (something with an @ on it) to a
> subroutine. As what is passed to the subroutine is itself a single list
> all of the following do NOT work:
>
> passing more than one list.
> passing a list followed by one or more values.
>
> Note that passing one or more values first and then a list does work
> however.
>
> Hope this is helpful,
>
> Mark Winder.
>
> Daniel Krajzewicz wrote:
> >
> > Dear Friends,
> >
> > I just hav a little question about the use of @_ / $_...
> > When a string is passed to a subroutine which schould hold two
> > parameters,
> > where the second features spaces, for example "car yellow fast low", can
> > I parse it by using the following command into these two parameters :
> > ($object, $attributes) = @_;
> > or what is the correct syntax.
> > By now, I´m using the character ´|´ to seperate between the different
> > parameters,
> > so it would look like : "car|yellow fast low" and would be splitted and
> > the assigned...
> >
> > Thanks for help,
> > Daniel Krajzewicz
> >
> > --
> > __________________________
> > < Daniel Krajzewicz >
> > >------------------------<
> > < krajzewicz@inx.de >
> > >------------------------<
> > < http://www.art-so-far.de >
> > >------------------------<
> > <__________________________>
--
__________________________
< Daniel Krajzewicz >
>------------------------<
< krajzewicz@inx.de >
>------------------------<
< http://www.art-so-far.de >
>------------------------<
<__________________________>
------------------------------
Date: Mon, 13 Sep 1999 14:37:34 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: rand questions
Message-Id: <x3y4sgyfyj5.fsf@tigre.matrox.com>
Gene Senyszyn <scatt@goes.com> writes:
> Is there a way to force rand() to return only integers?
No. But you can use int().
> I have an array, and I get the # of items in it, and call rand() using
> the # of items as the expression (ie $x = rand $count;)
> I then have a print statement that prints the # returned ($x) and the
> corresponding position in the array. (print $ARRAY[$x];)
Checkout perlfaq4:
How do I select a random element from an array?
> The variable $x gets converted to an integer, however the next random
> number can be 4.3333, where the last one was maybe 4.2222, and they both
> print the same lines.
>
> Technically, its a random number, but when I print the array item, they
> are the same.
>
> Any ways around this?
In the case you mention above, what is the "correct" behaviour in your
opinion? It seems to me that Perl is doing the correct thing.
--Ala
------------------------------
Date: Mon, 13 Sep 1999 19:07:34 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: regexp with variables containing unknown data
Message-Id: <WXbD3.8365$N77.650975@typ11.nn.bcandid.com>
In article <37DD44F4.541DD1DD@nospamhere.L8R.net>,
Brad Barnett <bbarnett@nospamhere.L8R.net> wrote:
>Tom Briles wrote:
>> Then before you write *even one* more line of Perl code, read:
>> perldoc perldoc
>> perldoc perltoc
>
>Go away tom, go away home
Your literary allusions amply demonstrate your erudition ("Ladybug,
Ladybug", is it? Or "Rain, Rain, Go Away"?) but I, at least, fail to
grasp your meaning.
Are you trying to say that you disagree with Tom Briles's advice to
read the documentation, and wish he would quit giving people that
advice? Or perhaps you think his manner of giving the advice to this
person was discourteous?
Awaiting clarification,
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 13 Sep 1999 19:28:00 +0200
From: kaih=7OmpBq$1w-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Removing a line from a text file
Message-Id: <7OmpBq$1w-B@khms.westfalen.de>
gellyfish@gellyfish.com (Jonathan Stowe) wrote on 11.09.99 in <7recgm$o2$1@gellyfish.btinternet.com>:
> On 10 Sep 1999 03:56:17 GMT Eric Bohlman wrote:
> > Larry Rosler (lr@hpl.hp.com) wrote:
> > : That is a reasonable analogy. However, in most likelihood those who ask
> > : this question are using a different analogy: adding, deleting, or
> > : modifying lines using a text editor or a word processor. There the
> > : mechanism is hidden.
> >
> > Except that, especially if they're on a GUI system, they're aware that
> > they have to explicitly save the file they're editing, which ought to
> > suggest that the changes are actually done by rewriting the whole file.
> >
> > I'm more inclined to think that it's a result of thinking of files as
> > array-like structures of physical records rather than as streams of
> > bytes. As late as 20 years ago, I could understand why people would be
> > automatically inclined to think that way (22 years ago, *I* had a hard
> > time thinking of a file as anything other than an array of fixed-size
> > records), but I'm not sure why people think that now.
> >
>
> On some systems *still used now* any file is presented as a set of records.
> Not that I would have anything to do with them of course :)
There are two types, here. One were it's simply sequential records;
insertion costs just as much as with stream-type files.
The other has some sort of (usually sparse) record keys, and *that* one
can indeed often insert cheaply.
MVS and CMS are the first type. I've written an (extremely primitive)
editor for the second using VSAM files (on MVS), but that's certainly not
a typical representation for text files - it's the moral equivalent of
putting a text file into a hash. Well, in this case, the effect was a
doubly linked list of lines: every line included a "next key" and a "last
key" subfield. (And getting block move right was a bitch.)
I don't know how the AS/400 does it, except that every file on the AS/400
is an SQL table, and for editing you use the moral equivalent of "select *
from <sourcefile>". (It's also an implementation of persistent memory,
that is, you don't save stuff, the OS does it for you.)
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: Mon, 13 Sep 1999 20:28:23 +0100
From: "Andrew Armstrong" <barm@aarmstrong.fsbusiness.co.uk>
Subject: Re: running Perl files on Apache 1.3 running under Windows 95 ?
Message-Id: <7rjjat$hq6$1@news7.svr.pol.co.uk>
Jon, where is this FAQ ?
ta
Jonanthan Wrote:
>Have you read the section of the Win32 specific FAQ that comes with the
>activestate Perl that discusses the configuration of various Web servers
>to work with Perl.
>
>
------------------------------
Date: 13 Sep 1999 15:42:20 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: s/// problem
Message-Id: <x7lnaalhsz.fsf@home.sysarch.com>
>>>>> "JF" == Jody Fedor <JFedor@datacom-css.com> writes:
JF> Blair Heuer wrote in message <7rf1s0$3r2$1@ash.prod.itd.earthlink.net>...
>> Ok thanks. I only have one book on Perl, "Perl for Dummies
>>
JF> http://www.datacom-css.com/books/perl.htm
what kind of self plug is that? 10 perl books listed, no information about
each book, only o'reilly books (and not all of them either). there are
over 100 books out with major perl content.
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
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: 13 Sep 1999 19:39:32 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <7rjjtk$46t$1@gellyfish.btinternet.com>
On Mon, 13 Sep 1999 17:24:55 GMT Kragen Sitaker wrote:
> In article <7rj8ga$f70$1@info2.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>> 69 107.0 ( 51.4/ 43.7/ 23.2) Jonathan Stowe <gellyfish@gellyfish.com>
>> 46 89.8 ( 32.9/ 47.5/ 31.8) kragen@dnaco.net (Kragen Sitaker)
>> 43 57.9 ( 26.6/ 27.6/ 16.6) moseley@best.com (Bill Moseley)
>> 42 74.3 ( 39.7/ 29.7/ 20.5) Tom Phoenix <rootbeer@redcat.com>
>> 35 55.1 ( 21.7/ 29.4/ 17.4) lr@hpl.hp.com (Larry Rosler)
>> 35 79.3 ( 40.6/ 23.3/ 21.8) abigail@delanet.com
>
> Unbelievable. I posted more than anybody except Jonathan Stowe! Maybe
> I need to get a life. :)
>
Well you're not having mine OK ....
I'd recommend Mavis Beacon's Typing Tutor if your having trouble posting
enough :)
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 13 Sep 1999 15:17:02 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: UNCRAP project proposal
Message-Id: <x7r9k2liz5.fsf@home.sysarch.com>
>>>>> "JS" == Jonathan Stowe <gellyfish@gellyfish.com> writes:
JS> On 11 Sep 1999 10:44:30 -0700 Randal L. Schwartz wrote:
>>>>>>> "Uri" == Uri Guttman <uri@sysarch.com> writes:
>>
Uri> the basic needs of the search engine is to search for some keywords in a
Uri> set of directory trees. it returns the file names of hits in a nice
Uri> htmlish way. here are some of the design rules:
>>
>> You could certainly start with my search engine from WT, which
>> does much of what you ask already. See
>>
>> http://www.stonehenge.com/merlyn/WebTechniques/
>>
JS> Oh you just gone spoiled Uri's fun :)
no, i like to steal code. and i can rip randal's stuff as easily as
anyone's. i actually don't like the way he does some coding (from
reading this column a few times and others in unix review (i can't stand
the name performance computing). but that part of the fun too.
now to find time to peruse this column.
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
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: 13 Sep 1999 15:23:59 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: UNCRAP project proposal
Message-Id: <x7ogf6link.fsf@home.sysarch.com>
>>>>> "A" == Abigail <abigail@delanet.com> writes:
A> Uri Guttman (uri@sysarch.com) wrote on MMCCI September MCMXCIII in
A> <URL:news:x7zoyul8pz.fsf@home.sysarch.com>:
A> //
A> // here are some of the design rules:
A> //
A> // uses CGI.pm for parsing and for some/most of the html output
A> Oh gosh, I could never do the second part. I just fail to understand
A> why people prefer endless method calls over
A> print <<END_OF_HTML;
A> ...
A> END_OF_HTML
A> and just typing out what you want. CGI.pm's set of methods that output
A> html tags seems to me as useful as an English.pm module with a method
A> for every word, and using that instead of writing plain text. It's all
A> too much 'oh-golly-this-looks-like-I-am-doing-OOP' just for the sake of
A> looking like you're doing OOP.
sorry to disagree with you abigail, but using those functions has
advantages. in fact i actually mix html text and CGI html functions in
various places.
the functions are very useful if you are processing a list of items
(including other sub calls) which can't be nicely done in a here doc (i
don't like to use the expression interpolation tricks). also it makes
factoring some attributes over a list of items much easer, e.g. an
alignment value can be applied to all columns of a table row without
duplicating it for each column. if it changes you only have one change
to make. also using the html functions make sure you have correct html
syntax and your script will break at the perl compile time which is
easier to debug than waiting to see what the browser shows.
also i do not use the object form, but the exported subs which makes it
look like regular code. in most cases only one query object is needed
and this technique uses it behind the scenes so it looks fine.
it is just another tool and i find it helpfule at time. i don't use it
for all html output but for much of it.
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
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: 13 Sep 1999 20:49:00 +0200
From: kaih=7OmpGtK1w-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: UNCRAP project proposal
Message-Id: <7OmpGtK1w-B@khms.westfalen.de>
abigail@delanet.com (Abigail) wrote on 12.09.99 in <slrn7tnq2a.e8k.abigail@alexandra.delanet.com>:
> Ken MacLeod (ken@bitsko.slc.ut.us) wrote on MMCCIII September MCMXCIII in
> <URL:news:m33dwkrqd9.fsf@biff.bitsko.slc.ut.us>:
> && "Alan J. Flavell" <flavell@mail.cern.ch> writes:
> &&
> && > but still the original assertion remains
> && > untouched.
> &&
> && My apologies, Alan.
> &&
> && Maybe you'd like to take a crack at explaining why requiring closing
> && tags in a version of HTML suddenly makes that version no longer HTML
> && when the HTML specifications and existing parsers both allow them and
> && assume that they are there if they are missing?
>
> Because that would invalidate hundreds of millions of documents out there.
And how many of those are valid today?
I know *I* validate my webpages. I know that Georg does. *No* other page
I've ever tested has been valid.
Not one.
Now, obviously, I haven't tested every page. But given this record, valid
pages must be an extremely small minority.
> You could make a language that resembles Perl, but that requires you to
> always use parenthesis when calling functions. You could call it Perl,
> and programs written to that specification could be run by Perl, but it
> isn't Perl as it fails to run millions of valid Perl programs.
I think from a linguistic point of view, you'll find that you're wrong -
it would still be Perl.
It's not that hard to prove, either. Say you take Perl, and take out some
features - say, pseudo hashes, INIT, threads, (?<=, (?<!, \z, qr//,
keyword overriding, stuff like that. By your reasoning, that would no
longer be Perl, right?
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 781
*************************************