[11961] in Perl-Users-Digest
Perl-Users Digest, Issue: 5561 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 4 16:07:21 1999
Date: Tue, 4 May 99 13:00:17 -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, 4 May 1999 Volume: 8 Number: 5561
Today's topics:
Re: "learning perl" does not seem to be written well birgitt@my-dejanews.com
Re: "learning perl" does not seem to be written well (Andrew Johnson)
Re: "learning perl" does not seem to be written well <uri@ibnets.com>
[Question] 'use' and 'require' trouble <skine@ark-works.com>
Re: [Question] 'use' and 'require' trouble (Andrew Allen)
Accelerated Perl Programming <info@itte.org>
Re: Answer: RegEx for the "From " mbox DE-LIMIT-ER (John Stanley)
Re: Books birgitt@my-dejanews.com
Re: Fractional numbers..? <c97775@apsc.com>
Re: Generate more than one page with one script (Steve Linberg)
Re: Generate more than one page with one script <e.pavis@silicomp.com>
How to change CPAN ftp location in config.pm <bstickel@dot.state.oh.us>
Re: How to change CPAN ftp location in config.pm <wells@cedarnet.org>
Re: installing APi507e.exe on Win 95 <tonylabb@infonline.net>
Managing NT Workstations with PERL mclaughlinj@leaders.ccl.org
Mapping Question <jim.ray@west.boeing.com>
Perl 5: The Complete Reference, Martin Brown vepxistqaosani@my-dejanews.com
Re: Perl Beginner <jwarner@tivoli.com>
Re: Question: Updating an Array... <uri@ibnets.com>
Re: Question: Updating an Array... (Larry Rosler)
Re: Question: Updating an Array... <dboorstein@ixl.com>
Re: Question: Updating an Array... (Larry Rosler)
WebEvent 3.1 BETA released - Web / CGI/ WWW Calendar So <WebEvent@MatadorDesign.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 04 May 1999 17:37:47 GMT
From: birgitt@my-dejanews.com
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <7gnb9b$jbb$1@nnrp1.dejanews.com>
In article <x3y7lqqnn75.fsf@tigre.matrox.com>,
Ala Qumsieh <aqumsieh@matrox.com> wrote:
>
> dha@panix.com (David H. Adler) writes:
>
> > >Therefore a Perl book which addresses the non-programmer has not
> > >been written yet, AFAIK.
> >
> > This, however is *quite* true.
>
> Well, maybe. I really thought the Perl5 Interactive book (by Jon
> Orwant, published by Waite Group) was pretty good, and simple. It
> showed you lots of examples *WITH THEIR OUTPUTS* and an explanation of
> each. This is something which the Camel lacks (hint hint).
>
> But, I had quite some programming experience before I read it, so I
> can't really make a definitive statement. But I found it very simple
> and clear (except for some typos here and there).
>
> my $input = $0.02;
>
There are more than enough pretty good "simple" books out there. I was
more thinking in lines of a comprehensive programming textbook,
which doesn't have to be simple and easy, just suitable to be used as
"the" textbook for incoming undergraduates to learn programming. For people
who never have written any program and don't know what an algorithm, loop,
hash, stack, handler, pointer etc is.
But I might have been misunderstood. I actually think there are already
a couple of too many Perl books out. And the online documentation addresses
beginner questions very well.
Birgitt Funk
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 04 May 1999 18:15:56 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <wPGX2.814$vk3.125704@news1.rdc1.on.wave.home.com>
In article <7gnb9b$jbb$1@nnrp1.dejanews.com>,
birgitt@my-dejanews.com <birgitt@my-dejanews.com> wrote:
In article <x3y7lqqnn75.fsf@tigre.matrox.com>,
! There are more than enough pretty good "simple" books out there. I was
! more thinking in lines of a comprehensive programming textbook,
! which doesn't have to be simple and easy, just suitable to be used as
! "the" textbook for incoming undergraduates to learn programming. For people
! who never have written any program and don't know what an algorithm, loop,
! hash, stack, handler, pointer etc is.
<shameless plug>
One book rather like that should be out sometime in August:
http://www.manning.com/Johnson/
</shameless plug>
regards
andrew
------------------------------
Date: 04 May 1999 15:10:29 -0400
From: Uri Guttman <uri@ibnets.com>
To: andrew-johnson@home.com
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <39pv4gbqhm.fsf@ibnets.com>
>>>>> "AJ" == Andrew Johnson <andrew-johnson@home.com> writes:
AJ> <shameless plug>
AJ> One book rather like that should be out sometime in August:
AJ> http://www.manning.com/Johnson/
AJ> </shameless plug>
i won't judge this book until i see it, but the publisher has left me
cold. they spammed this group and various perl hackers via email about
their books, never sent any followup information, and in general
seemed to be unsavory fellows.
the proof will be in the editing and publishing quality of manning's
perl books. they have an amazing standard (o'reilly of course) to live
up to. most other perl book publishers fail miserably. not that o'reilly
perl books are perfect (the nutshell one is lousy and buggy), but their
overall formatting, editing and authorship have been shown to be by far
the best in this industry. some of the others are so badly done it is
laughable to see them mentioned by newbies in this group.
i hope your book is good because its title seems to fill a void. but i
am crossing my fingers.
uri
--
Uri Guttman Hacking Perl for Ironbridge Networks
uri@sysarch.com uri@ironbridgenetworks.com
------------------------------
Date: 04 May 1999 17:57:46 GMT
From: skine <skine@ark-works.com>
Subject: [Question] 'use' and 'require' trouble
Message-Id: <19990505025746.93195788.1467832526@nn-tk003.ocn.ad.jp>
Hi, all!
I face an 'use' and 'require' related trouble.
First, type in or cut and paste the following code fragments.
test.pl:
use Test2;
require "help.pl";
print "in test.pl: $help\n";
Test1.pm:
package Test1;
require "help.pl";
print "in Test1.pm: $help\n";
Test2.pm:
package Test2;
use Test1;
require "help.pl";
print "in Test2.pm: $help\n";
help.pl:
$help = "HELP ME!";
Then, type in these. You will get the following results.
$ perl test.pl
in Test1.pm: HELP ME!
in Test2.pm:
in test.pl:
But I expect the following results...
$ perl test.pl
in Test1.pm: HELP ME!
in Test2.pm: HELP ME!
in test.pl: HELP ME!
Why? I locate these files all in the same directory and
have excuted "export PERL5LIB=." (I use BASH).
I use perl 5.005pl02. Was there something wrong or misunderstanding?
Please save me!
Thank you,
****************************
Satoshi Kinebuchi
<skine@ark-works.com>
------------------------------
Date: 4 May 1999 19:28:40 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: [Question] 'use' and 'require' trouble
Message-Id: <7gnhp8$hpe$1@fcnews.fc.hp.com>
skine (skine@ark-works.com) wrote:
: Hi, all!
: I face an 'use' and 'require' related trouble.
Actually, you're facing namespace troubles. Read all about it in
perlmod...
: test.pl:
--
: use Test2;
: require "help.pl";
: print "in test.pl: $help\n";
$help here refers to $main::help
: Test1.pm:
--
: package Test1;
: require "help.pl";
: print "in Test1.pm: $help\n";
$help here refers to $Test1::help
: Test2.pm:
--
: package Test2;
: use Test1;
: require "help.pl";
: print "in Test2.pm: $help\n";
$help here refers to $main::help
: help.pl:
: $help = "HELP ME!";
this is a little more tricky. Since help.pl is "first" required by
Test1.pm, and require will only bring in a file once, $help here (in
the context of the above scripts) refers to $Test1::help.
: Then, type in these. You will get the following results.
: $ perl test.pl
: in Test1.pm: HELP ME!
: in Test2.pm:
: in test.pl:
which is exactly correct. If you want to refer to the same variable in
all packages, call it $main::help (or the synonym) $::help. Or read
about the Exporter package, which may help you with what you're trying
to do.
Andrew
------------------------------
Date: Tue, 04 May 1999 18:24:52 GMT
From: "ITTE" <info@itte.org>
Subject: Accelerated Perl Programming
Message-Id: <01be965b$6e876570$ef7de8d0@debhome>
Accelerated Perl Programming, (Intro-Interm.)
May 13-14, 1999 * San Jose, CA
Tuition: $799. Register by May 7, save $100.
Group rates: register 3 individuals from the same organization and the 3rd
registrant is complimentary --- subject to availability.
View the full course description @ http://www.itte.org/TRAIN.perl.html
This hands-on technical workshop is accomplishment-oriented providing
attendees with real-life examples. This workshop teaches the foundations
Perl programming through a series of case studies and practical examples.
Upon completion, attendees will be able to write Perl programs of their
own. To our knowledge, no other workshop provides as much learning in
such a brief time.
------------------------------
Date: 4 May 1999 17:15:25 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Answer: RegEx for the "From " mbox DE-LIMIT-ER
Message-Id: <7gn9vd$473$1@news.NERO.NET>
In article <372F0E5C.74AAAB0F@yale.edu>,
Nicholas Brenckle <nmb9@email.med.yale.edu> wrote:
>Little did I know there was a man(5) page for mbox format.
>" The From_ line always looks like From envsender date
> moreinfo. envsender is one word, without spaces or tabs; it
>
>The key is that the envelope sender may be blank (according to Innosoft
>PMDF)
No. If Innosoft is leaving the envelope sender blank, then get a better
piece of software. The "key" doesn't fit the lock.
>It was harder to parse then I first thought. (If anyone has any
>suggestions, please share.)
/^From\s+(\S+)\s+(.+)/;
------------------------------
Date: Tue, 04 May 1999 17:23:55 GMT
From: birgitt@my-dejanews.com
Subject: Re: Books
Message-Id: <7gnaf5$iku$1@nnrp1.dejanews.com>
In article <371A8F3A.21A4CF64@prodigy.net>,
Ken Robbins <puyrebel@prodigy.net> wrote:
> Uri Guttman wrote:
> [snip snip]
> > so what i
> > do is use amazon or B&N for searching and reviews, etc. and then buy
> > from bookpool.
>
> Yes, Amazon.com has the most reviews by readers of any site, so that is
> what I probably will do.
>
> > someone else said they can be out of stock sometimes but
> > at least they don't list a book until they have it. amazon and the other
> > biggies will list a book weeks in advance which can be very annoying.
>
hmm, I wonder why that is annoying. In Germany they list for example any
forthcoming book on their catalogs as soon as the bookstore (NOT amazon.de
...) gets the information from the publishers.
The announcements are e-mailed also to their hard-core customers who
immediately order them in advance so that they get them sent out
automatically as soon as they arrive in the stores.
This service of announcing forthcoming books in advance has been very
successful and is loved by many customers. And a good way to beat Amazon.com
too at times for smaller specialty bookstores. 8-).
It is basically careless from the online catalog designer, not to be clear
or honest about which book is really in stock, not out yet or sold out. A lot
of work to keep your online database current. Nice job for you guys to
come up with some good open source programs to make it easier for smaller
bookstores. 8-)
Birgitt Funk
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 4 May 1999 09:58:47 -0700
From: "Wiley, Leroy " <c97775@apsc.com>
Subject: Re: Fractional numbers..?
Message-Id: <7gn903$461@news.apsc.com>
Matthew Tillett wrote in message <372E10DF.21F40B02@clara.net>...
>Hi,
>
> Does anyone know of a simple way of returning the fractional part of a
>number? E.g., if x=2.34, how could I return the .34 part?
>
How about:
$y=$x-int($x);
------------------------------
Date: Tue, 04 May 1999 13:27:17 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Generate more than one page with one script
Message-Id: <linberg-0405991327170001@ltl1.literacy.upenn.edu>
In article <372F273F.2841F0C1@silicomp.com>, e.pavis@silicomp.com wrote:
> The second party never appear in my browser
Of course not. How is your browser supposed to handle this second page?
What happens to the first?
You can't do what you're trying to do, at least as I understand your
post. Maybe you can explain why you want to do this.
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>
------------------------------
Date: Tue, 04 May 1999 20:29:51 +0200
From: Edouard PAVIS <e.pavis@silicomp.com>
Subject: Re: Generate more than one page with one script
Message-Id: <372F3C9F.DDE76223@silicomp.com>
Script's Goal:
A user must be identified (login, passwd) in order to send a cookie to him
with the second page.
Script's summary :
**********************************
$page1=new CGI;
$page1->form(...)....submit
analysis of the submit information
if it's ok, I put 1 in $Var
if($Var=1)
{
$page2=new CGI;
$page2->header(cookie(...));
}
****************************
The page2 is never create, perharps because the 1 is never delete...
Thangs,
Edouard
<e.pavis@silicomp.fr>
Steve Linberg wrote:
> In article <372F273F.2841F0C1@silicomp.com>, e.pavis@silicomp.com wrote:
>
> > The second party never appear in my browser
>
> Of course not. How is your browser supposed to handle this second page?
> What happens to the first?
>
> You can't do what you're trying to do, at least as I understand your
> post. Maybe you can explain why you want to do this.
>
> --
> Steve Linberg, Systems Programmer &c.
> National Center on Adult Literacy, University of Pennsylvania
> email: <linberg@literacy.upenn.edu>
> WWW: <http://www.literacyonline.org>
------------------------------
Date: Tue, 4 May 1999 13:54:54 -0400
From: "Bob Stickel" <bstickel@dot.state.oh.us>
Subject: How to change CPAN ftp location in config.pm
Message-Id: <372f3eaf.0@socnm002.dot.state.oh.us>
If I have one the ftp sites here in the US that I'd like to use, do I use
this in the config.pm file to change it:
'wait_list' => [q[wait://ftp.sitename/dir/CPAN:nnnn]],
and, if so, how do I determine the port number for such site?
My default to the cpan site in Germany is really slow....
Thanks
Bob
------------------------------
Date: Tue, 04 May 1999 19:19:43 +0000
From: Steve Wells <wells@cedarnet.org>
Subject: Re: How to change CPAN ftp location in config.pm
Message-Id: <372F484F.9E198ABF@cedarnet.org>
Bob Stickel wrote:
> If I have one the ftp sites here in the US that I'd like to use, do I use
> this in the config.pm file to change it:
> 'wait_list' => [q[wait://ftp.sitename/dir/CPAN:nnnn]],
> and, if so, how do I determine the port number for such site?
> My default to the cpan site in Germany is really slow....
Why not 'perl -MCPAN -e shell'
cpan> o conf
and change the configuration file?
STEVE
-------
Stephen D. Wells
http://www.iren.net/wellss/
http://expert.cc.purdue.edu/~bgannon/booksearch/
------------------------------
Date: Tue, 04 May 1999 14:31:15 -0400
From: Tony Labbiento <tonylabb@infonline.net>
Subject: Re: installing APi507e.exe on Win 95
Message-Id: <372F3CF3.44F042A7@infonline.net>
I've seen this happen before. The only way I could get it to run
properly was to check the windows/temp directory and remove all perl
related files from any previous installs of perl.
Matija Exel wrote:
>
> hello,
>
> towards the end of the installation of APi507e.exe on a Win 95 PC (I
> checked with several PCs),
> I get the following message:
>
> _INS0432 a causi une difaillance de page dans (_INS0432 caused a page
> fault within the module...)
> le module PERLEZ.DLL ` 014f:00f5106e.
> Registres :
> EAX=00000001 CS=014f EIP=00f5106e EFLGS=00010213
> EBX=bff8bac6 SS=0157 ESP=006df1d4 EBP=00000001
> ECX=c3b05074 DS=0157 ESI=010de280 FS=395f
> EDX=815ab2cc ES=0157 EDI=00000000 GS=0000
> Octets ` CS : EIP :
> 8b 46 08 50 e8 d9 87 00 00 83 c4 04 56 e8 d0 87
> Etat de la pile : (stack:)
> 00f50000 00000000 01080460 00f59a13 00000000 00f59aca 00f50000 00000000
> 00000000 00f50000 815ae344 006df3d0 815ab7cc bff7b9ce 00f50000 00000000
>
> The installation apparently completes without problems, and my CGI
> scripts are running OK, so far...
> So, do I have to worry?
--
****************************************
* Tony Labbiento *
* Infinity Online, Inc. *
****************************************
------------------------------
Date: Tue, 04 May 1999 18:38:10 GMT
From: mclaughlinj@leaders.ccl.org
Subject: Managing NT Workstations with PERL
Message-Id: <7gneqi$mk6$1@nnrp1.dejanews.com>
Okay, I don't get it. I've read the manual including tie:registry, search the
perl ring and must be totally missing it.
How do I run a Perl script on 300 workstations as each user logs in? I want to
somehow hook the login script to call the perl script and have it run.
-or-
How do I remotely manage NT workstations including registry changes and
general administration using Perl?
dazed and confused ... jeff
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 4 May 1999 16:44:52 GMT
From: "news.boeing.com" <jim.ray@west.boeing.com>
Subject: Mapping Question
Message-Id: <FB7vu2.3n2@news.boeing.com>
I have 2 computers. Computer is the IIS Server with all my CGIs and HTMLS,
the other is where the data is stored. I can now create a dynamic page of
the files on the data server but I can not figure out how to do the URL
links.
Example.
Server.
"http://myserver.com/index.cgi?DirecotryName" will produce a list of files
of "DirectoryName"
Data Server
"//NT-SERVER/Dir1/DirectoryName"
When I create the link to the other server, how does the URL read.
http://???? or is it file://????
Thanks for the help.
--
Jim Ray
Delta Program NT Administrator
The Boeing Company
714-896-2038
jim.ray@west.boeing.com
------------------------------
Date: Tue, 04 May 1999 17:53:52 GMT
From: vepxistqaosani@my-dejanews.com
Subject: Perl 5: The Complete Reference, Martin Brown
Message-Id: <7gnc7e$k9i$1@nnrp1.dejanews.com>
Some chapters from this book are available at
http://www.books.mcgraw-hill.com/betabooks/brown/index.html
It'll be in the bookstores in June; does anyone have any advance word about
it?
Randal, at the Boston tutorial last week, you said that you did technical
reviews of new Perl books -- is this one of them?
Fred
$_ = "ustJay notherAay ewNay erlPay ackerHay";
s/(\w+?)(\w)ay/$2$1/g;
print;
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 04 May 1999 10:35:57 -0500
From: John Warner <jwarner@tivoli.com>
Subject: Re: Perl Beginner
Message-Id: <372F13DD.CD8D0AB4@tivoli.com>
Since you are a beginner, I'll take it easy as it is likely other, more
experienced Perl programmers will rip you a new asshole over a question like
this. The very first place to check for an answer is the FAQ pages that came
with your copy of Perl. In the case of manipulating data from a file, check
out FAQs 4 and 6. FAQ 4 covers data manipulation and FAQ 6 covers regular
expressions (a technique that will greatly simplify your life when working
with text).
When learning Perl, the FAQs are good for specific how-to questions but you
will find the O'Reilly book _Learning Perl_ to be very useful. Other good
sources for learning Perl are discussed in Perl FAQ 2.
Hope this helps
Brian Altman wrote:
> Hi there,
>
> I am just beginning to learn how to program in Perl.
> Right now I am wondering if it is possible to 'get' specific data from an
> existing file (any text based file), and write it to a new file.
>
> Can someone help me with this ?
> Thanks a lot in advance !!
--
John Warner Tivoli Systems Inc.
Sales Support Engineer 9442 Capital Of Texas Hwy North
Sales Infrastructure Group Austin, TX 78759
john_warner@tivoli.com
------------------------------
Date: 04 May 1999 15:01:55 -0400
From: Uri Guttman <uri@ibnets.com>
To: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Question: Updating an Array...
Message-Id: <39so9cbqvw.fsf@ibnets.com>
>>>>> "SL" == Steve Linberg <linberg@literacy.upenn.edu> writes:
SL> In article <7gn537$6k6$1@murdoch.acc.Virginia.EDU>,
SL> dsf3g@node16.unix.Virginia.EDU (David Salvador Flores) wrote:
>> I know I can do this the loopety loop method with temporary holding
>> arrays and stuff. But is there a simple, one command is all you
>> need, method?
SL> Using array slices for this will make your life much easier, and
SL> avoid the "loopety loop" method. Learning Perl discusses this, I
SL> believe.
haven't you heard of slice either? it does exactly what the poster
requested.
uri
--
Uri Guttman Hacking Perl for Ironbridge Networks
uri@sysarch.com uri@ironbridgenetworks.com
------------------------------
Date: Tue, 4 May 1999 12:10:26 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Question: Updating an Array...
Message-Id: <MPG.1198e601886666f09899b4@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <linberg-0405991219420001@ltl1.literacy.upenn.edu> on Tue, 04
May 1999 12:19:42 -0400, Steve Linberg <linberg@literacy.upenn.edu>
says...
> In article <7gn537$6k6$1@murdoch.acc.Virginia.EDU>,
> dsf3g@node16.unix.Virginia.EDU (David Salvador Flores) wrote:
>
> > Now, I know from "Learning Perl" that the push, pop, shift and unshift
> > functions allow you to update the "left" or "right" end of an array.
> > But is there a simple way of stuffing new values into the middle of
> > an array without overwriting a previous value?
>
> No. Arrays are sequential. You'll have to do some moving.
No, you don't have to. You are *much* better off using splice.
> > I know I can do this the loopety loop method with temporary holding arrays
> > and stuff. But is there a simple, one command is all you need, method?
>
> Using array slices for this will make your life much easier, and avoid the
> "loopety loop" method. Learning Perl discusses this, I believe.
Yes, it does. But it doesn't discuss 'splice'. :-(
#!/usr/local/bin/perl -w
use strict;
use Benchmark;
my @a = (0 .. 99);
timethese(1 << (shift || 0), {
Cntrl => sub { my @b = @a; scalar @b },
Slice0 => sub { my @b = @a;
@b = (@b[0 .. 49], 42, @b[50 .. 99]); scalar @b },
Slice1 => sub { my @b = @a;
@b[50 .. 100] = (42, @b[50 .. 99]); scalar @b },
Splice => sub { my @b = @a; splice @b, 50, 0, 42; scalar @b },
});
__END__
Benchmark: timing 16384 iterations of Cntrl, Slice0, Slice1, Splice...
Cntrl: 2 wallclock secs ( 2.45 usr + 0.00 sys = 2.45 CPU)
Slice0: 7 wallclock secs ( 7.27 usr + 0.00 sys = 7.27 CPU)
Slice1: 3 wallclock secs ( 4.30 usr + 0.00 sys = 4.30 CPU)
Splice: 2 wallclock secs ( 2.53 usr + 0.00 sys = 2.53 CPU)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 04 May 1999 15:10:00 -0400
From: Dan Boorstein <dboorstein@ixl.com>
Subject: Re: Question: Updating an Array...
Message-Id: <372F4608.5159BE7F@ixl.com>
Steve Linberg wrote:
>
> In article <7gn537$6k6$1@murdoch.acc.Virginia.EDU>,
> dsf3g@node16.unix.Virginia.EDU (David Salvador Flores) wrote:
>
> > Now, I know from "Learning Perl" that the push, pop, shift and unshift
> > functions allow you to update the "left" or "right" end of an array.
> > But is there a simple way of stuffing new values into the middle of
> > an array without overwriting a previous value?
>
> No. Arrays are sequential. You'll have to do some moving.
Hmm, seems easy enough to me.
#!/usr/bin/perl
@foo = (1 .. 10);
splice @foo, 5, 0, 'middle';
print @foo;
Yes, things had to move, but also a yes to it being both simple and
possible without overwriting.
I know Steve is familiar with splice but for the benefit of the
original poster, see the documentation on this function.
Cheers,
Dan Boorstein
dboorstein@ixl.com
------------------------------
Date: Tue, 4 May 1999 12:49:31 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Question: Updating an Array...
Message-Id: <MPG.1198ef29146f30089899b6@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <39so9cbqvw.fsf@ibnets.com> on 04 May 1999 15:01:55 -0400,
Uri Guttman <uri@ibnets.com> says...
> >>>>> "SL" == Steve Linberg <linberg@literacy.upenn.edu> writes:
> SL> In article <7gn537$6k6$1@murdoch.acc.Virginia.EDU>,
> SL> dsf3g@node16.unix.Virginia.EDU (David Salvador Flores) wrote:
> >> I know I can do this the loopety loop method with temporary holding
> >> arrays and stuff. But is there a simple, one command is all you
> >> need, method?
>
> SL> Using array slices for this will make your life much easier, and
> SL> avoid the "loopety loop" method. Learning Perl discusses this, I
> SL> believe.
>
> haven't you heard of slice either? it does exactly what the poster
> requested.
For the sake of sanity (mine, if no others' :-), I'll assume you meant
'splice' in that sentence. Let me introduce you to 'agrep'...
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 04 May 1999 15:50:05 -0400
From: WebEvent <WebEvent@MatadorDesign.com>
Subject: WebEvent 3.1 BETA released - Web / CGI/ WWW Calendar Software
Message-Id: <x73e1c8viq.fsf@server.matadordesign.com>
Keywords: web, calendar, software, web calendar software, www, cgi, event, events, scheduling, schedules, webevent, perl, perl cal, scheduler, unix, windows, mac, macintosh
Matador Design announces the availability of WebEvent 3.1 BETA 9.
WebEvent is an interactive World Wide Web calendar program that allows
you to view and modify calendar-type events from any computer that can
run a Web browser. With the release of WebEvent 3.1, we are
proud to announce that WebEvent is available for Macintosh Web servers
in addition to the already supported UNIX and Windows NT servers.
The following features have made WebEvent an indispensable tool in settings
as diverse as FedEx, Intel, Lucent Techonologies, AT&T, and Harvard
University:
* multiple calendar views (year, month, 2 week, week, day, event)
* two calendar formats (calendar and list)
* event types (meetings, to-dos, special events)
* conflict resolution (double-booking feature)
* repeating events (automatically repeats specified events)
* reminders sent via email
* searchable calendars
* meta-calendars (ability to view two or more calendars simultaneously)
* user authentication (ability to control user access)
* style and color options (via pull-down menus)
* source code
WebEvent 3.1 requires a UNIX, Windows NT, or Macintosh server running
a Web server that supports PERL CGI scripts and can communicate with
an SMTP host for e-mail reminders and notification. The Macintosh
version requires MacOS 8 and the WebTen web server or MacOS X Server.
Cost is $200 for a single calendar/user license, $400 for 5
calendar/user license and $800 for a 100 calendar/user license.
Non-profit and educational institutions receive a 50% discount.
Site licenses are also available.
For information, or to download a free fully-functional, evaluation for
WebEvent 3.1, visit http://www.MatadorDesign.com. Please contact
"WebEvent@MatadorDesign.com" for more information.
Keywords: web calendar software, cgi calendar software, www calendar
software, event scheduling, cals, calendars, schedule, perl
calendar, perl cal, unix, windows
------------------------------
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 5561
**************************************