[7265] in Perl-Users-Digest
Perl-Users Digest, Issue: 890 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 19 15:07:28 1997
Date: Tue, 19 Aug 97 12:00:26 -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, 19 Aug 1997 Volume: 8 Number: 890
Today's topics:
Anyone know a good tutorial? <jshare1@po-box.mcgill.ca>
Block parameters <tw36027@glaxowellcome.com>
Chars into Array <ken1@earthlink.net>
Re: CPAN module and UNINST=1 lvirden@cas.org
Debugging PIPEs script <jbrunker@ams.dhs.texas.gov>
efficient editing <dhoover@textwise.com>
Re: floor/ceil (M.J.T. Guy)
Re: fly, gd.pm help? (Lasse Hillerxe Petersen)
Help reading massive file <temp.ed.vanderbush@bentley.com>
Re: Help reading massive file (Eric Bohlman)
HELP: Perl5 on Novell Web Server 3.0 "Document Contains (Mahlon Inksetter)
How to access 3D hash keys through reference? <kerr_tung@sdt.com>
Re: I'm looking for a perl logo... (Lasse Hillerxe Petersen)
Number conversion help <ken1@earthlink.net>
Re: Passing multiple arrays to subroutine ??? <sfairey@adc.metrica.co.uk>
Re: Password Protection on a directory <test@somi.sk>
Re: Password Protection on a directory <Jan.Vajda@somi.sk>
Re: Perl Performance FAQ? (Michael N. Edmonson)
Re: Perl Win95 <susan@graygraham.com>
Perl's Creator Speaks Out On The Challenges Ahead software@newapps.com
Re: Perl5 & Personal Web Server <susan@graygraham.com>
Re: perl5 regexes slower than perl4? (Ilya Zakharevich)
Re: Problem with CPAN module and MD5? lvirden@cas.org
Re: PROPOSAL: Overloaded subs in perl (Aaron Sherman)
regexp C library sieben@imap1.asu.edu
Re: Saving array in hash tied to dbm? <jay@rgrs.com>
Re: shift (David Bonner)
Re: Unix pwd <jefpin@bergen.org>
Win95 + Perl back-quotes or fx(<system command>) assign <alten@dial.pipex.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 19 Aug 1997 17:28:50 GMT
From: "Jacob Share" <jshare1@po-box.mcgill.ca>
Subject: Anyone know a good tutorial?
Message-Id: <01bcacc5$69cb57c0$7db7a8c6@host.mcgill.ca.mcgill.ca>
I'm looking for a good perl tutorial preferably with emphasis on CGI but
not necessarily.
Thanks
Please email:
mailto:jshare@iname.com
------------------------------
Date: Tue, 19 Aug 1997 10:16:12 -0400
From: Thad Welch <tw36027@glaxowellcome.com>
Subject: Block parameters
Message-Id: <33F9AAAC.CADCF11F@glaxowellcome.com>
I've noticed that some built-in perl functions like (sort, grep) can
take
a Block parameter. ie
sort { $a->date <=> $b->date } @objects.
I know you can pass a 'sub {}' parameter, but using a block looks
better in my opinion.
So, if there anyway to pass a Block as a parameter?
------------------------------
Date: Tue, 19 Aug 1997 10:05:10 -0700
From: John Grimm <ken1@earthlink.net>
Subject: Chars into Array
Message-Id: <33F9D246.6B32@earthlink.net>
How can I get a variable (say $x) into an array (say @p)?
I want to get a number like -1.942 so it's like @p = (-,1,.,9,4,2)
------------------------------
Date: 19 Aug 1997 16:50:45 GMT
From: lvirden@cas.org
Subject: Re: CPAN module and UNINST=1
Message-Id: <5tcit5$2kd$2@cas.org>
According to Tony Bowden <tony@niweb.com>:
:Is there a way, from within the CPAN shell to specify this? I've looked
:through the docs and can't see anything, but surely there must be an
:easier way than going to the source dir and re-installing it with that?
I think back in 5.003 there was a point during Configure's prompting
where it mentioned that at that point you could provide the flag so
that it was the default. However, someone removed it by the time 5.004
was released - perhaps there was some sort of 'gotcha' that arose from
this.
--
Larry W. Virden INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.
------------------------------
Date: Tue, 19 Aug 1997 12:24:02 -0500
From: Jay Brunker <jbrunker@ams.dhs.texas.gov>
Subject: Debugging PIPEs script
Message-Id: <33F9D6B2.25642D3E@ams.dhs.texas.gov>
Hi All:
Does anyone see what the error is in this piece of code?
The idea of this code is to run prtvtoc on all devices in
/dev/rdsk/ of slice '2'.
I get an error near "Cannot open output" or
if I use 'system()' I seem to get a broken pipe error.
Here 'tis!
foreach $dev (glob('/dev/rdsk/c*t*d*s2'
{
open(PIPE, "/usr/sbin/prtvtoc -h $dev|"
open(OUT,">/tmp/$outfile"
while(<PIPE> {print OUT;
close(PIPE ; close(OUT ;
}
* Please note...to add further confusion the left parens
symbol doesn't seem to display when I use Netscape. Egads!!!!
Any help will be greatly appreciated.
Jay.
------------------------------
Date: Tue, 19 Aug 1997 10:40:57 -0400
From: Dean Hoover <dhoover@textwise.com>
Subject: efficient editing
Message-Id: <33F9B079.21A9@textwise.com>
I'm trying to figure out the best way to change:
\ to \\ and | to \V and & to \A
in one fell swoop, efficiently.
Any ideas?
Thanks.
Dean Hoover
------------------------------
Date: 19 Aug 1997 17:47:46 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: floor/ceil
Message-Id: <5tcm82$r94$1@lyra.csx.cam.ac.uk>
In article <5tasd3$pe1$2@nntp2.ba.best.com>, Zenin <zenin@best.com> wrote:
>Gary Chambers <geecee@netquarters.net> wrote:
>> I've checked CPAN with no luck. Can someone point me in the direction
>> of a Perl equivalent to C's floor and ceil functions? A BCD math
>> package would work, too. I'd hate to reinvent the wheel, but if I
>> must, I must. Thanks in advance...
>
> You're thinking too low level for perl. sprintf() and int() will
> probably do the bulk of what you want, if not all of it.
> perldoc -f sprintf
> perldoc -f int
No - these don't do what is wanted. sprintf rounds (with undefined
behaviour at the halfway points) and int truncates towards zero (usually).
So use the POSIX subroutines, as Mike Stok suggested. (And he probably
should also have pointed out that the POSIX module comes with the
standard Perl distribution, so you don't need to install it specially.)
Mike Guy
------------------------------
Date: Tue, 19 Aug 1997 16:38:47 +0200
From: lassehp@imv.aau.dk (Lasse Hillerxe Petersen)
Subject: Re: fly, gd.pm help?
Message-Id: <lassehp-ya023180001908971638470001@news.daimi.aau.dk>
In article <33F473E6.71E4@geenite.demon.co.uk>, Matthew Knight
<matt@geenite.demon.co.uk> wrote:
>hi
>
>can anyone who is familiar with gd.pm or fly give me a run down on how
>to install it on a unix machine. i'm a mac user, and although i have
>macperl running fine, there aren't ports to the mac for these - and i
>need to work out how to use either module.
I don't know why it is always said that GD isn't ported to Mac? I have been
using GD from MacPerl quite a bit. I think that BigMacPerl is needed for
68K machines, but the PPC version should have it built-in.
Regarding "fly", I must say I haven't heard of it. If it doesn't depend on
C code, it could be working though.
-Lasse
------------------------------
Date: Tue, 19 Aug 1997 11:37:25 -0400
From: Ed Vander Bush <temp.ed.vanderbush@bentley.com>
Subject: Help reading massive file
Message-Id: <33F9BDB4.78B0@bentley.com>
I am creating a text file to hold user information for a site.
User ID Name Var1 var2 etc......,..
Seperated by tabs
I need to know how to find a line based on the User Id and then take the
information out of that line and set each one to a variable in the
script. Thanks!
------------------------------
Date: Tue, 19 Aug 1997 16:29:06 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Help reading massive file
Message-Id: <ebohlmanEF65sI.IJG@netcom.com>
Ed Vander Bush (temp.ed.vanderbush@bentley.com) wrote:
: I am creating a text file to hold user information for a site.
: User ID Name Var1 var2 etc......,..
: Seperated by tabs
: I need to know how to find a line based on the User Id and then take the
: information out of that line and set each one to a variable in the
: script. Thanks!
1) grep() or index(), depending on how you decide to read the file.
2) split().
3) Read perlfunc(1) if neither 1) or 2) makes sense to you.
------------------------------
Date: Tue, 19 Aug 97 13:57:23 GMT
From: mwinkset@ice.lakeheadu.ca (Mahlon Inksetter)
Subject: HELP: Perl5 on Novell Web Server 3.0 "Document Contains No Data" error
Message-Id: <5tc8o3$a0g_001@psylab-20.lakeheadu.ca>
Hi,
I'm new to Perl but I'm not having much trouble understanding Perl,
it's getting it to run. I'm working with Perl 5 on Novell Web Server (NWS) 3.0
I am not the admin but I have spoken with the admin many times. The NWS is set
up with the default installation.
As per the documentation, I'm placing my perl scripts (*.pl) in the directory
SYS:INW_WEB\SHARED\DOCS\LCGI\PERL5
There are sample scripts in there that work fine. And I can get the most *basic*
script (ie. Send print statments to the browser) to work. But anytime I add more
complicated stuff (if..else, passing info from a form etc.) I'm getting a "Document
Contains No Data" error. I've checked my code against the examples provided with NWS
and I can't see where I'm going wrong.
Is there a way to run Perl on NWS with the "-w" switch?
Here is a snipet of code that works in the example, but not in mine:
EXAMPLE: (works)
require("cgilib.pl");
print &PrintHeader;
&ReadParse;
if($ENV{"REQUEST_METHOD"} eq "GET" && $ENV{QUERY_STRING"} eq "") {
....here HTML is sent to the browser....
MY CODE: (Does NOT work)
require("cgilib.pl");
print &PrintHeader;
&ReadParse;
if ($ENV{"REQUEST_METHOD"} eq "GET" && $ENV{"QUERY_STRING"} eq "") {
...here HTML is sent to the browser....
To me they look exactly the same. The HTML is different, but once inside
the "if" statement, it's simple statements like:
print "<HTML><HEAD><TITLE>My Page</TITLE></HEAD>\n";
The properties of the file are the same too (no "execute" mode or anything)
I would really appreciate any help as I am trying to get a project done and
my position ends this week. I only have a few minor things to do, but i can't
seem to get Perl to perform the simplest tasks!! Which is all I want it to do
anyway.
Thanks in advance to any who may help!
Mahlon
------------------------------
Date: Tue, 19 Aug 1997 12:53:46 -0500
From: Kerr Tung <kerr_tung@sdt.com>
Subject: How to access 3D hash keys through reference?
Message-Id: <33F9DDAA.6F76@sdt.com>
Hi all,
I build a 3D hash. $table{$user}{$cur_view}{$file} = $x; I would like to
access all the 3 keys through dereferencing in a sub.
#call the sub to print
&print_keys(\%table);
sub print_keys {
my($hash_ref) = @_;
my $user;
my $view;
my $file;
foreach $user (sort keys %$hash_ref) { #this works
print "user: $user\n";
foreach $view (sort keys ???){ # how do I dereferce this one?
print "view: $view\n";
foreach $file (sort keys ???){ #how do I dereference this one?
print "file: $file\n";
}
}
}
}
------------------------------
Date: Tue, 19 Aug 1997 16:37:40 +0200
From: lassehp@imv.aau.dk (Lasse Hillerxe Petersen)
Subject: Re: I'm looking for a perl logo...
Message-Id: <lassehp-ya023180001908971637400001@news.daimi.aau.dk>
In article <MAXWELL.97Aug15194224@yoda.jpl.nasa.gov>,
maxwell@natasha.jpl.nasa.gov (Scott Maxwell) wrote:
>Duh, I should have looked a little more before posting on this topic
>earlier. I ought to have visited
>
> http://www.ora.com/info/perl/republic/usage.html
>
>which has such a logo and sets terms for its use. Please note that
>this site also says,
>
> "The use of a camel image in conjunction with Perl is a
> trademark of O'Reilly & Associates, Inc."
>
>Since trademark infringement is nothing to take lightly, I suggest you
>use this logo on your Web site and abide by their terms.
I'm no lawyer, just another perl hacker, but I cannot see how such a
loosely defined trademark ("a camel image in conjunction with Perl") can be
valid and legal. Could Apple similarly trademark any fruit with a bite
taken of it in conjunction with computers?
I do like O'Reilly & Associates and have a couple of their books (of
course) and they have standards that I admire. However this "ownership" of
"a camel in conjunction with Perl" I must say that I don't like.
MacPerl has a camel in front of a pyramid as an icon. That must be a
trademark infringement then?
I am not opposed to trademarks, and I do believe that infringement should
be regarded seriously; but I also think there should be (and must be)
limits to what can be trademarked. A camel of a particular style such as
the one used by O'Reilly: yes that can and should be trademarked. But any
"camel image in conjunction with Perl" -- no way. It is just as silly as if
O'Reilly claimed "The use of an animal image in conjunction with a computer
programming concept or language is a trademark of O'Reilly & Associates,
Inc.", which would merely be a generalization from the covers of other
books. I just don't think it can be done. Or maybe it can in the United
States? Suddenly we can't use a spider to visualize the WWW?
Has my coffee cup suddenly become a trademark of Sun or Javasoft, because
it sits next to my computer (with Java on it)?
If _that_ is the situation with trademark law, then we are living in a sad
world and should do something about it.
I hope O'Reilly will relax and reduce their claim to cover only camel
drawings of the particular style used by O'Reilly. Which is very neat, BTW.
-Lasse
------------------------------
Date: Tue, 19 Aug 1997 08:52:20 -0700
From: John Grimm <ken1@earthlink.net>
Subject: Number conversion help
Message-Id: <33F9C134.2745@earthlink.net>
I need to translate a number like -1.7 to -017000 or something like 9.3
to +093000
Any suggestions?
------------------------------
Date: Tue, 19 Aug 1997 15:20:21 +0100
From: Simon Fairey <sfairey@adc.metrica.co.uk>
To: "James H. Blackwell" <jim.blackwell@gsfc.nasa.gov>
Subject: Re: Passing multiple arrays to subroutine ???
Message-Id: <33F9ABA5.41C6@adc.metrica.co.uk>
James H. Blackwell wrote:
>
> Hi all,
>
> Before I go completely gaa gaa, I thought I'd ask the question in hopes
> that someone can help me.
>
> I have a subroutine that gets passed to it a number of arrays.
>
> my_routine(@arr1, @arr2, @arr3)
>
> In the subroutine, I do this:
>
> sub my_routine {
>
> my (@ar1, @ar2, @ar3) = @_;
>
> ...
>
> However, all the values go into @ar1. I have tried a number of
> things like
>
> my_routine(\@arr1, \@arr2, \@arr3)
OK thats a good start, now you need to know how to access the data once
you get into the routine, see the perlref man page for full details.
Below is a quick example for you to ponder over:
sub my_routine {
my( $ar1_ref, $ar2_ref, $ar3_ref ) = @_;
Then to process one of the array references as an array use '@$ar1_ref'
and to access individual elements use '$$ar1_ref[0]' or the much nicer
'$ar1_ref->[0]'.
Hope this gets you started.
Simon
PS: You might also want to look at prototyping your subroutine so that
you dont need to de-reference the arrays ( see perlsub manpage ).
------------------------------
Date: 19 Aug 1997 15:19:55 GMT
From: test <test@somi.sk>
Subject: Re: Password Protection on a directory
Message-Id: <5tcdir$9vl@gringo.somi.sk>
> [cc\'d automagically to original author]
takze
>
> On 12 Aug 1997 22:40:11 GMT\, \"Greg Meechan\" <gregmee\@vianet.net.au>
> >Jeremy D. Zawodny <zawodny\@hou.moc.com> wrote in article
> ><33f05b1d.338740422\@igate.hst.moc.com>
> >> >I\'ve tried to FTP a .htaccess file across\, I\'ve tried to FTP a htacess
> >file
> >> >across and then rename it .htaccess. However\, none of these work!
> >> >
> >> >Does anyone have any suggestions
> >>
> >> Yeah\, contact the ISP and ask them to fix the problem\, or at least ask
> >> them what the proper procedure is.
> >
> >Thanks for the suggestion.
> >
> > I\'ve mailed their support five times and have never had a reply to ANY of
> >them. I recently sent a snail mail letter to their General Manager
> >complaining about the situation. In the meantime my client is anxious to
> >get the site up and running. Thus I thought someone else may have an
> >solution.
>
> That\'s too bad.
>
> Sounds like it may be time to switch providers\, because it certainly
> sounds like a problem on their end.
>
> Jeremy
> --
> Jeremy Zawodny
> Internet Technology Group
> Information Technology Services
> Marathon Oil Company\, Findlay Ohio
>
> http://www.marathon.com/
>
> Unless explicitly stated\, these are my opinions only--not those of my employer.
-atari- Tvoja spravicka sa nahrala - [Dolphin]
*atari* ked kompilujem sietove vei pre sun\, ake library ?
-> *atari* -lsocket -lnsl -lresolv -lucb
*** atari is away: uz 4h3m56s dovod: scsi
-> *atari* snad by to malo stacit ..
*** atari is away: uz 4h4m47s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-> *atari* pomohlo ??
*** atari is away: uz 4h14m1s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
*atari* ked kompilujem sietove vei pre sun\, ake library ?
-> *atari* -lsocket -lnsl -lresolv -lucb
*** atari is away: uz 4h3m56s dovod: scsi
-> *atari* snad by to malo stacit ..
*** atari is away: uz 4h4m47s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-> *atari* pomohlo ??
*** atari is away: uz 4h14m1s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
*atari* ked kompilujem sietove vei pre sun\, ake library ?
-> *atari* -lsocket -lnsl -lresolv -lucb
*** atari is away: uz 4h3m56s dovod: scsi
-> *atari* snad by to malo stacit ..
*** atari is away: uz 4h4m47s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-> *atari* pomohlo ??
*** atari is away: uz 4h14m1s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
*atari* ked kompilujem sietove vei pre sun\, ake library ?
-> *atari* -lsocket -lnsl -lresolv -lucb
*** atari is away: uz 4h3m56s dovod: scsi
-> *atari* snad by to malo stacit ..
*** atari is away: uz 4h4m47s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-> *atari* pomohlo ??
*** atari is away: uz 4h14m1s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
*atari* ked kompilujem sietove vei pre sun\, ake library ?
-> *atari* -lsocket -lnsl -lresolv -lucb
*** atari is away: uz 4h3m56s dovod: scsi
-> *atari* snad by to malo stacit ..
*** atari is away: uz 4h4m47s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-> *atari* pomohlo ??
*** atari is away: uz 4h14m1s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
*atari* ked kompilujem sietove vei pre sun\, ake library ?
-> *atari* -lsocket -lnsl -lresolv -lucb
*** atari is away: uz 4h3m56s dovod: scsi
-> *atari* snad by to malo stacit ..
*** atari is away: uz 4h4m47s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-> *atari* pomohlo ??
*** atari is away: uz 4h14m1s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
*atari* ked kompilujem sietove vei pre sun\, ake library ?
-> *atari* -lsocket -lnsl -lresolv -lucb
*** atari is away: uz 4h3m56s dovod: scsi
-> *atari* snad by to malo stacit ..
*** atari is away: uz 4h4m47s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-> *atari* pomohlo ??
*** atari is away: uz 4h14m1s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
*atari* ked kompilujem sietove vei pre sun\, ake library ?
-> *atari* -lsocket -lnsl -lresolv -lucb
*** atari is away: uz 4h3m56s dovod: scsi
-> *atari* snad by to malo stacit ..
*** atari is away: uz 4h4m47s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-> *atari* pomohlo ??
*** atari is away: uz 4h14m1s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
*atari* ked kompilujem sietove vei pre sun\, ake library ?
-> *atari* -lsocket -lnsl -lresolv -lucb
*** atari is away: uz 4h3m56s dovod: scsi
-> *atari* snad by to malo stacit ..
*** atari is away: uz 4h4m47s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-atari- Tvoja spravicka sa nahrala - [Dolphin]
-> *atari* pomohlo ??
*** atari is away: uz 4h14m1s dovod: scsi
-atari- Tvoja spravicka sa nahrala - [Dolphin]
----------------------------------------------------
posted by WWWNews gateway v1.12
(c) 1997 Somi Systems Ltd. http://www.somi.sk/
------------------------------
Date: 19 Aug 1997 15:23:58 GMT
From: Kozo <Jan.Vajda@somi.sk>
Subject: Re: Password Protection on a directory
Message-Id: <5tcdqe$9vq@gringo.somi.sk>
I\'m sorry for prev. article ..
I\'m testing new WWW_NEWS gateway and
in this time I have a little bugs ...
I\'m Sorry .. realy ...
K O Z O
----------------------------------------------------
posted by WWWNews gateway v1.12
(c) 1997 Somi Systems Ltd. http://www.somi.sk/
------------------------------
Date: 19 Aug 1997 15:44:30 GMT
From: edmonson@chlccs.fccc.edu (Michael N. Edmonson)
Subject: Re: Perl Performance FAQ?
Message-Id: <5tcf0u$gc$1@taurus.fccc.edu>
To this list I would also add:
- Instead of dynamically "push"ing variables onto arrays, use map
wherever possible:
So instead of:
foreach (@list) { push @other, $_ + 5; }
Use:
@other = map {$_ + 5} @list;
- When passing large arrays or hashes to subroutines, pass
references to the objects intead. There may be a little more
expense associated with dereferencing, but at least Perl won't have
to make a copy of the whole thing with every subroutine call.
------------------------------
Date: Tue, 19 Aug 1997 14:02:23 -0400
From: "Susan" <susan@graygraham.com>
Subject: Re: Perl Win95
Message-Id: <5tcnu9$dii@mtinsc05.worldnet.att.net>
Here's one way to do it:
1. From the Windows 95 Start Menu Select Run and type in regedit
2. Select
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3Svc\Parameters\Script
Map
3. Create a new string value with the name ".pl" or ".cgi" (or whatever you
are using as the file extension for your perl programs) and give it a value
of "c:\Perl5\bin\perl.exe %s" (note: your perl.exe may reside elsewhere and
you should that location for the value).
4. Invoke FrontPage Explorer and select View | Folder View
5. Select File | Import | Folder and import the cgi-bin directory from your
hard drive
6. Right click on the cgi-bin directory, select properties, and select
"allow scripts or programs to be run"
7. Reboot your PC
8. Fire up your web browser and type in
http://default/cgi-bin/myperl_program.pl (where myperl_program.pl is the
name of your perl program)
Works like a charm for me! (You can also execute from the command line using
DOS-prompt and typing: perl myperl_program.pl)
Hope this helps,
Susan
mudd97@nac.net wrote in article <33F92C06.3EB0@nac.net>...
>I am trying to test perl stuff on PWS on win95. I can't get anything
>going.
>Not even the "helloworld.pl" script. I set my scripts directory to
>execute and not read but it forbids read-access.
>I added .pl to my registry and the associations in win95. When I click
>on the .pl file a DOS windows comes up and executes the script and then
>disappears. Can anyone please help.
>Thanks in advance
>mudd97@nac.net
------------------------------
Date: Tue, 19 Aug 1997 14:18:31 GMT
From: software@newapps.com
Subject: Perl's Creator Speaks Out On The Challenges Ahead
Message-Id: <33f9a92d.155572177@netnews.mis.net>
Perl's Creator Speaks Out On The Challenges Ahead
... http://www.newslinx.com
SunWorld: Do you think the world at large really understands Perl?
Perl is
sometimes thought of a rough-and-ready language. Is that a fair
assessment?
Larry Wall: Well...Yes.
Tim O'Reilly: I think of Perl as the Intel of the information
revolution. Many of the
information sites have Perl inside, you know, in the same ways that
the PCs all
have Intel inside. And I think that's not an accident. I think that
has to do with the
way that Perl lends itself to the kinds of products that are really
being built in this
next generation of the computer revolution. They tend to be
information products;
they tend to have text in them -- and Perl is really good at handling
text -- they tend
to be put together by non-programmers, and Perl, despite being a very
full-featured language, is very
easy to get started with.
SunWorld: We're at version 5.004 of Perl right now. Is there a version
six planned?
Wall: I think Perl may end up like Unix did and get stuck at system
five. There's a version 5.005 that a
fellow named Malcolm Beattie is working on. It will have
multithreading support, and it will have a
compiler back end to it that can be extended very easily.
SunWorld: Are there any great technical challenges that remain ahead
at this point?
Wall: There are always technical challenges. When you talk about Perl,
version whatever, you're mostly
talking about what you think of as core Perl and in that sense, yeah
the language itself is pretty much
stabilizing. But if you talk about Perl in terms of culture, that is
simply exploding. And I think that's
healthy. One of the reasons that Perl culture is growing so fast is
that we're stabilizing the core.
A similar thing happened with Unix. There's not a whole lot of Unix
kernel reinvention nowadays. What
Unix means nowadays is pretty stable.
O'Reilly: Comparing it to Unix is maybe a bad idea. What about
comparing it to
something like C. What version of C are we at?
Wall: So it serves as a stable platform. But by design Perl 5 included
an extension
mechanism so that we could, in fact, decentralize the further
development of the
language. And that was intentional. A lot of the strength of Perl
culture is built into
this decentralization notion. There's just an awful lot of strength in
the grass roots.
And I as a language designer, do not want to make decisions. Just like
I believe in
limited federal government, all the decisions that can be made at the
local level, I
think, ought to be.
That is where I think the strength of the language is in the future.
Because the
dynamics of how Perl develops is more like a natural language than
like a computer language. With a
typical computer language, the word comes down from on high: "this is
the next thing that is going to
happen to the language." Whereas with Perl it's always been a very
cooperative effort, a very,
"let's-see-who-needs-help-the-most-right-now,
let's-grease-the-squeaky-wheel" effort. And that implies
it's viewed as a rough-and-ready language because we have taken a
practical approach to it -- a bit of a
populist approach, if you will. But that's why it gets people's jobs
done for them.
...find more of the article via http://www.newslinx.com
NewsLinx, Daily Web News
"The Web's Most Comphrehensive News Source"
Tuesday, August 19, 1997
------------------------------
Date: Tue, 19 Aug 1997 13:59:22 -0400
From: "Susan" <susan@graygraham.com>
Subject: Re: Perl5 & Personal Web Server
Message-Id: <5tcnoo$d94@mtinsc05.worldnet.att.net>
Here's one way to do it:
1. From the Windows 95 Start Menu Select Run and type in regedit
2. Select
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3Svc\Parameters\Script
Map
3. Create a new string value with the name ".pl" or ".cgi" (or whatever you
are using as the file extension for your perl programs) and give it a value
of "c:\Perl5\bin\perl.exe %s" (note: your perl.exe may reside elsewhere and
you should that location for the value).
4. Invoke FrontPage Explorer and select View | Folder View
5. Select File | Import | Folder and import the cgi-bin directory from your
hard drive
6. Right click on the cgi-bin directory, select properties, and select
"allow scripts or programs to be run"
7. Reboot your PC
8. Fire up your web browser and type in
http://default/cgi-bin/myperl_program.pl (where myperl_program.pl is the
name of your perl program)
Works like a charm for me! (You can also execute from the command line using
DOS-prompt and typing: perl myperl_program.pl)
Hope this helps,
Susan
Klaus Wolf wrote in article <33F95905.7BBBE6AA@arcor.net>...
>Brian Moffatt wrote:
>
>> I installed PWS and I am brand new at Perl. How do I install it so I
>> can
>> test CGI's
>> Thank you.
>
>
>I also tried to use that Personal Web Server stuff but I didn't have
>success because it seems to be there's no documentation for that package
>at all.
>Now I'm using Netscapes FastTrack server 2.0 for Windows 95, which is
>more complex but everything works fine including Perl CGI-scripts. The
>beta version is free for download from netscapes Web-site.
>
------------------------------
Date: 19 Aug 1997 18:33:16 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: perl5 regexes slower than perl4?
Message-Id: <5tcotc$r6e@agate.berkeley.edu>
In article <Pine.GSO.3.96.970818185314.5155D-100000@linda.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
> On 18 Aug 1997, Andrew Dalke wrote:
>
> > I'm glad I was able to help you to track it down to a specific
> > set of changes and hope the performance improvements are easy
> > to implement.
> > Could you drop me a note when this happens?
>
> I wouldn't expect most of this to be "fixed" anytime soon. :-) The reason
> is that many slowdowns in one place either provide greater speed someplace
> else or greater security and accuracy. For example, we take extra time
> when compiling a regexp in order to make it run more quickly when it's
> used. In real-world applications, programs written to use Perl5's features
> should outrun equivalent Perl4 programs almost every time. The exception
> is when Perl5 does something extra which is needed for security or
> accuracy.
While this remark is generally applicable, and is what I had in mind
in my causious first responses, it is not applicable to the situation
at hand. This was just a goof during addition of locales.
A tiny macro in a dense loop was changed to a call to a complicated
function *without any new benefit*.
I might fix it some time soon in one of the next jumbo RE patches
(btw, I found what maked (?{...}) work inside eval only, now it works
as it should).
Ilya
------------------------------
Date: 19 Aug 1997 16:49:13 GMT
From: lvirden@cas.org
Subject: Re: Problem with CPAN module and MD5?
Message-Id: <5tciq9$2kd$1@cas.org>
According to Tony Bowden <tony@niweb.com>:
:I upped my installation of Perl from 5.003 to 5.004, and managed to screw up
:the path @INC liked (It used to have lots of /usr/local/lib variants, and
This caused some sleeping neurons in my brain to fire.
Has anyone written a script that takes the config.sh information and
generates a Configure invocation that sets things like directories,
library names, etc. in the proper voodoo notation required so that
when one goes to configure a new perl you get as defaults the same
basic info that was specified last time? I understand there are good
reasons not to keep the config.sh itself around . However the config.over
mechanism is too late in the configuration process to be of much help.
Surely someone gets tired of cutting and pasting variable info from old
config.sh files, and I _know_ I don't have a good enough memory
to remember all the weird places I dreamed up specifying the last time
I configured things...
--
Larry W. Virden INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.
------------------------------
Date: 19 Aug 1997 12:48:33 -0400
From: ajs@lorien.ajs.com (Aaron Sherman)
Subject: Re: PROPOSAL: Overloaded subs in perl
Message-Id: <5tcip1$v6q@lorien.ajs.com>
Actually, it turns out that method inheiritance is harder than I
thought for the following reasons:
1. From inside the sub, it is impossible to tell between:
$obj->meth();
and:
Package::meth($obj);
2. Given, that you have to guess, but even then you can't
know where the call began. For example:
package a;
osub meth => q($$), sub {};
package b;
osub meth => q($), sub {};
package c;
@ISA=qw(a b);
package main;
$o = bless {}, c;
$o->meth(1);
Here, we can see that the call should resolve to b::meth,
but perl will find a::meth, and there's no way for a::meth
to know that it should climb back up the tree (after all,
we WANT $o->a::meth(1) to fail).
I think to do this right will require a small change to the
core. Perhaps a new vartiable which is automatically lexically scoped,
and contains the "inheiritance state" so that you can say something
like:
if (defined($METHOD_STATE)) {
goto &$METHOD_STATE;
}
and have perl leap back into method lookup as if this subroutine had
not existed.... This certainly opens up some possibilities. I'll have
to go see how the method lookup code works, and if there's any hope of
doing this kind of thing right.
-AJS
------------------------------
Date: 19 Aug 1997 15:58:59 GMT
From: sieben@imap1.asu.edu
Subject: regexp C library
Message-Id: <5tcfs3$nkc@news.asu.edu>
Is there a port of perl's regular expression library for C? I ve found some
regular expression implementations but they seem too simple, especially
for substitutions.
Thanks,
Nandor.
------------------------------
Date: 19 Aug 1997 12:30:55 -0400
From: Jay Rogers <jay@rgrs.com>
To: uzs90z@uni-bonn.de (Michael Schuerig)
Subject: Re: Saving array in hash tied to dbm?
Message-Id: <82g1s6rv7k.fsf@shell2.shore.net>
uzs90z@uni-bonn.de (Michael Schuerig) writes:
> I want to put an array into an element of hash tied to a dbm file.
> Unfortunately Perl only puts a reference there. What do I have to do to
> get around this?
The module MLDBM can be used to store multidimensional hash structures
in DBM files. Look for it on CPAN.
--
Jay Rogers
jay@rgrs.com
------------------------------
Date: 19 Aug 1997 13:48:05 GMT
From: davidb@kenan.com (David Bonner)
Subject: Re: shift
Message-Id: <5tc86l$f4@pony.kenan.com>
Bill Ravdin (ravdin@vantisintl.com) wrote:
: I'm having a problem using the shift function.
: It's my understanding that it undefines the array if there's only one
: element in it (at least that's what it says in the Camel book.)
>From the mouth of the Camel:
If there are no elements in the array, shift returns the
undefined value.
Shift _returns_ undef if used on an empty array, but it doesn't undef the
array. The array remains an empty array until you undef it by yourself.
--
#=====================================================================#
#"it's the word's suppression that gives it the | david bonner #
# power, the violence, the viciousness" -lenny bruce | dbonner@bu.edu #
#=====================================================================#
------------------------------
Date: Tue, 19 Aug 1997 12:04:06 -0400
From: Anagrams of the Word 'A' <jefpin@bergen.org>
To: Michael Danielsson <Michael.Danielsson@ein.ericsson.se>
Subject: Re: Unix pwd
Message-Id: <Pine.SGI.3.95.970819115807.13942A-100000@vangogh.bergen.org>
On Mon, 18 Aug 1997, Michael Danielsson wrote:
>
> I would like to check if i am standing in the directory /tmp. How do I
> do this in perl.
>
Just use this:
chop($curr = `pwd`);
if ($curr eq "/tmp"){
# if it is the directory...
}
else{
# if it isn't...
}
Remember that you have to use the chdir command in Perl... you can't just
type `cd /tmp`.
----------------
| "A bird in the hand leaves a nasty stain."
| - Me
----------------
Jeff "TechMaster" Pinyan | http://users.bergen.org/~jefpin
I do: HTML!! CGI!! Perl!! JavaScript!! jefpin@bergen.org
Got a JavaScript/CGI/Perl question or problem? Let me know!
webXS - the new eZine for WebProgrammers! TechMaster@bergen.org
Visit us @ http://users.bergen.org/~jefpin/webXS
------------------------------
Date: Tue, 19 Aug 1997 18:09:25 +0000
From: Alten Limited <alten@dial.pipex.com>
Subject: Win95 + Perl back-quotes or fx(<system command>) assignment not working.
Message-Id: <33F9E155.1E0C@dial.pipex.com>
I've downloaded Perl 5 (build 307) from ActiveWare and installed it on
the Windows 95 machine I'm using (for my sins).
My problem is that in the statement:
@catch_variable = `dir`;
or:
@catch_variable = fx(dir);
the yield of the command (dir) is sent to screen instead of being placed
in @catch_variable as expected.
I had the same problem with build 110, infact that's where I discovered
the problem, since the test.bat supplied with this build makes extensive
use of back-quotes. So I'm suprised if no one's come across the problem
before ... unless there's something wierd with the incarnation of Win95
that I have.
I've searched all the doc's and FAQa that I can find. The only mention
of what look like similar Win95/Perl problems are concerning 'system
escapes', perportedly fixed by Cmd32.exe which I have installed.
Any ideas or help on this problem'd be much appreciated.
Ian Ashton-Reader
--
Alten Ltd, Linton House
164/180 Union Street - Waterloo Tel: 0171 401 8222
London SE1 OLH - United Kingdom Fax: 0171 401 3553
alten@dial.pipex.com & http://dialspace.dial.pipex.com/alten
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 890
*************************************