[7256] in Perl-Users-Digest
Perl-Users Digest, Issue: 881 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 17 12:07:12 1997
Date: Sun, 17 Aug 97 09:00:25 -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 Sun, 17 Aug 1997 Volume: 8 Number: 881
Today's topics:
B-trees vs. hash tables? <nobody@secret.squirrel.owl.de>
Re: B-trees vs. hash tables? (Mike Stok)
Re: Beginner problems <rootbeer@teleport.com>
Re: Content-Type: "JAVASCRIPT"??? <rootbeer@teleport.com>
Re: Environment variables :LC_CTYPE , LC_ALL...??? <rootbeer@teleport.com>
Re: Help with Perl Regular Expressions <rootbeer@teleport.com>
Help with perl scripts uploads <murillo@infocostarica.com>
Re: Help with perl scripts uploads <rootbeer@teleport.com>
Re: How do I create a directory and then create a direc <mchase@ix.netcom.com>
Re: How do I create a directory and then create a direc (Nathan V. Patwardhan)
Re: How do I create a directory and then create a direc (Drake Raft)
Re: How do I create a directory and then create a direc (Mike Stok)
Re: How do I create a directory and then create a direc (I R A Aggie)
Re: HTML --> Perl conversion <rootbeer@teleport.com>
Re: HTML --> Perl conversion (Bart Lateur)
Re: makewhatis for Solaris (Rachel Polanskis)
Re: Nifty hash initialization, but why? (Mike Muise)
Re: Passing an argument to a Perl SSI problem <rootbeer@teleport.com>
Re: Perl 5.00[2 and 3] compile problems under SCO OSR 5 <scmckay@ix.netcom.com>
Re: Perl Performance FAQ? <rootbeer@teleport.com>
pl2bat, batwrap for perl-win32 build 306 <sventek@ibm.net>
Re: pl2bat, batwrap for perl-win32 build 306 <mchase@ix.netcom.com>
Please Help me w/ this script! (Ilesa SW)
Re: Relative link points to cgi-bin -- HELP <mikep@rt66.com>
Re: What is this EOF error? <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Aug 1997 00:41:03 -0000
From: Secret Squirrel <nobody@secret.squirrel.owl.de>
Subject: B-trees vs. hash tables?
Message-Id: <69a96749a619965e50c41dfd43c4096b@squirrel>
Berkeley DB offers B-trees and hash tables as options. Why would one
want to choose one over the other?
(no email,
please)
------------------------------
Date: 17 Aug 1997 13:39:02 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: B-trees vs. hash tables?
Message-Id: <5t6utm$9ll@news-central.tiac.net>
In article <69a96749a619965e50c41dfd43c4096b@squirrel>,
Secret Squirrel <nobody@secret.squirrel.owl.de> wrote:
>Berkeley DB offers B-trees and hash tables as options. Why would one
>want to choose one over the other?
B-trees have the property that you can guarantee traversal order, so if
you want to have each/keys/values return an ordered list then you might
prefer a B-tree to a hash e.g.
#!/usr/local/bin/perl -w
use DB_File;
use Fcntl;
$DB_BTREE->{'compare'} = sub {
my ($key1) = $_[0] =~ /(\w+)\s*$/s;
my ($key2) = $_[1] =~ /(\w+)\s*$/s;
"\L$key1" cmp "\L$key2" || $_[0] cmp $_[1];
};
tie %hash, 'DB_File', undef, O_RDWR|O_CREAT, 0666, $DB_BTREE or die
"tie\n";
%hash = ('Robert Fripp' => 'guitar',
'Adrian Belew' => 'guitar & voice',
'Tony Levin' => 'bass & voice',
'Bill Bruford' => 'drums & percussions',
'Trey Gunn' => 'guitar &voice',
'Pat Mastelotto' => 'drums & percussions',
);
print "Bill Bruford plays $hash{'Bill Bruford'}\n";
while (($member, $role) = each %hash) {
print "$member: $role\n";
}
untie %hash;
__END__
produces
Bill Bruford plays drums & percussions
Adrian Belew: guitar & voice
Bill Bruford: drums & percussions
Robert Fripp: guitar
Trey Gunn: guitar &voice
Tony Levin: bass & voice
Pat Mastelotto: drums & percussions
as I decided that the sort ordering for the keys is alphabetically by
lower case surname (well, ASCII ordering...) With a hash there's no
ordering which can be assumed. As elements get inserted into the B-tree
it may be rebalanced, but the number of comparisons is kept nearly
optimal, so if you had a hash which was frequently updated and presented
as an ordered list then this may be useful.
Note that this may not be the most efficient way to do the task, it's just
an example.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Sun, 17 Aug 1997 08:48:03 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Dan <equi@herald.infi.net>
Subject: Re: Beginner problems
Message-Id: <Pine.GSO.3.96.970817084721.28633N-100000@julie.teleport.com>
On Sat, 16 Aug 1997, Dan wrote:
> Then, I opened the perl 5 program and typed perl test.pl and hit enetr
> and nothing.
> Then, I typed C:\perl5\bin\perl test.pl and it said I had a bunch of
> syntax errors.
That's an improvement! Have you tried fixing the syntax errors that it
reported? Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 17 Aug 1997 08:50:56 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Mark Sears <msears@cnnet.com>
Subject: Re: Content-Type: "JAVASCRIPT"???
Message-Id: <Pine.GSO.3.96.970817084828.28633O-100000@julie.teleport.com>
On Sat, 16 Aug 1997, Mark Sears wrote:
> I want to:
> - open a new window with the game (if they havent' played yet today)
Perl can't open new windows directly. Maybe you want to print something
that asks the user's browser to do what you want.
> Is there something like Content-Type: javascript?!?!
Maybe; check with the docs and FAQs about MIME types.
If you can't find what you need in the appropriate docs and FAQs, you
could try putting your questions into a newsgroup about browsers (or some
related category). Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 17 Aug 1997 08:10:55 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Devon Caines <devonc@inetnebr.com>
Subject: Re: Environment variables :LC_CTYPE , LC_ALL...???
Message-Id: <Pine.GSO.3.96.970817080656.28633H-100000@julie.teleport.com>
On Fri, 15 Aug 1997, Devon Caines wrote:
> -warning setlocale(LC_CTYPE," ") failed
> -warning LC_ALL = "(null)", LC_CTYPE = "(null)", LANG = "US";
> -warning falling back to the "C" locale;
It looks as if those environment variables have bad settings. See the
pellocale(1) manpage for more information on locales. If you need help
setting up locales on Linux, check your favorite Linux newsgroup. Hope
this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 17 Aug 1997 08:40:15 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: jaltuve@ibm.net
Subject: Re: Help with Perl Regular Expressions
Message-Id: <Pine.GSO.3.96.970817083823.28633L-100000@julie.teleport.com>
On Sat, 16 Aug 1997 jaltuve@ibm.net wrote:
> it is posible to use a search string like
> 'cancion' but make it match 'canci=F3n' in my Database File?
Does this do what you want?
print "It's a match!\n" if $string =3D~ /canci[o=F3]n/;
You also may want to see what locales can do for you. Hope this helps!
--=20
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 16 Aug 1997 21:02:07 -0700
From: Juan Carlos Murillo <murillo@infocostarica.com>
Subject: Help with perl scripts uploads
Message-Id: <33F677BF.3003@infocostarica.com>
Can someone please tell me how I should upload my perl scripts in order
to get them to work.
I use the 16 bit WSFTP for win 3.1.
What is it that goes wrong? Half the time my scripts just won't work.
My cgi-lib.pl, for example, doesn't ReadParse, so my form scripts just
return blank screens and e-mails.
A million thanks
Juan
------------------------------
Date: Sun, 17 Aug 1997 08:37:16 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Juan Carlos Murillo <murillo@infocostarica.com>
Subject: Re: Help with perl scripts uploads
Message-Id: <Pine.GSO.3.96.970817083522.28633K-100000@julie.teleport.com>
On Sat, 16 Aug 1997, Juan Carlos Murillo wrote:
> Can someone please tell me how I should upload my perl scripts in order
> to get them to work.
Always use your FTP client's text mode, since a Perl script is a text
file. That should convert the line endings as needed. (If they're already
messed up, you may need to make a one-line script to fix them. Just don't
transfer that one the wrong way! :-)
> My cgi-lib.pl, for example, doesn't ReadParse, so my form scripts just
> return blank screens and e-mails.
Use CGI.pm instead. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 16 Aug 1997 21:32:26 -0700
From: "Michael A. Chase" <mchase@ix.netcom.com>
Subject: Re: How do I create a directory and then create a directory within that directory?
Message-Id: <5t60ga$2ou@dfw-ixnews7.ix.netcom.com>
You could also use mkdir() in File::Path.
--
Mac :}) mchase@ix.netcom.com
Tom Phoenix wrote in article ...
>On 16 Aug 1997, Drake Raft wrote:
>
>> I'm looking to create a directory named etc2 within a directory named
>> etc1, but this doesn't seem to work. How would I go about doing this?
>
>Create them one at a time. Be sure to check for an error return from
>mkdir. The message explaining failure will be in the magical $!
variable.
>See the perlfunc and perlvar manpages for more details. Hope this helps!
------------------------------
Date: 17 Aug 1997 05:00:46 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: How do I create a directory and then create a directory within that directory?
Message-Id: <5t60hu$boc@fridge-nf0.shore.net>
Tom Phoenix (rootbeer@teleport.com) wrote:
: Create them one at a time. Be sure to check for an error return from
: mkdir. The message explaining failure will be in the magical $! variable.
: See the perlfunc and perlvar manpages for more details. Hope this helps!
It would probably be easier to use the mkdir() function in
File::Path. :-)
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 17 Aug 1997 13:40:14 GMT
From: drake-@email.unc.edu (Drake Raft)
Subject: Re: How do I create a directory and then create a directory within that directory?
Message-Id: <5t6uvu$lqi$1@fddinewz.oit.unc.edu>
Hello there. Thank you for the information. If you could please
elaborate, that would be great. How exactly do I use mkdir() in
File::Path to create nested directories? How would I implement this in
code? I tried a couple of things, but none of them work. Thanks a lot--
Elliot
Elliot McGucken
mcgucken@physics.unc.edu
Michael A. Chase (mchase@ix.netcom.com) wrote:
: You could also use mkdir() in File::Path.
: --
: Mac :}) mchase@ix.netcom.com
: Tom Phoenix wrote in article ...
: >On 16 Aug 1997, Drake Raft wrote:
: >
: >> I'm looking to create a directory named etc2 within a directory named
: >> etc1, but this doesn't seem to work. How would I go about doing this?
: >
: >Create them one at a time. Be sure to check for an error return from
: >mkdir. The message explaining failure will be in the magical $!
: variable.
: >See the perlfunc and perlvar manpages for more details. Hope this helps!
------------------------------
Date: 17 Aug 1997 15:05:02 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: How do I create a directory and then create a directory within that directory?
Message-Id: <5t73uu$eo4@news-central.tiac.net>
In article <5t6uvu$lqi$1@fddinewz.oit.unc.edu>,
Drake Raft <drake-@email.unc.edu> wrote:
>
>Hello there. Thank you for the information. If you could please
>elaborate, that would be great. How exactly do I use mkdir() in
>File::Path to create nested directories? How would I implement this in
>code? I tried a couple of things, but none of them work. Thanks a lot--
>Elliot
You'd use mkpath e.g.
$ cat try.pl
#!/usr/local/bin/perl -w
use File::Path;
@dirsMade = mkpath '/tmp/foo/bar/baz', 0, 0755;
foreach $dir (@dirsMade) {
print "made $dir\n";
}
$ ./try.pl
made /tmp/foo
made /tmp/foo/bar
made /tmp/foo/bar/baz
The next time it's run it returns an empty list 'cos the directories are
already made. The way to check out the documentation for a module is to
use the perldoc command e.g:
$ perldoc file::path
File::Path(3) User Contributed Perl Documentation File::Path(3)
NAME
File::Path - create or remove a series of directories
SYNOPSIS
use File::Path
mkpath(['/foo/bar/baz', 'blurfl/quux'], 1, 0711);
rmtree(['foo/bar/baz', 'blurfl/quux'], 1, 1);
DESCRIPTION
The mkpath function provides a convenient way to create
directories, even if your mkdir kernel call won't create
more than one level of directory at a time. mkpath takes
three arguments:
[...]
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Sun, 17 Aug 1997 11:22:33 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: How do I create a directory and then create a directory within that directory?
Message-Id: <fl_aggie-ya02408000R1708971122330001@news.fsu.edu>
In article <5t6uvu$lqi$1@fddinewz.oit.unc.edu>, drake-@email.unc.edu (Drake
Raft) wrote:
+ How exactly do I use mkdir() in File::Path to create nested directories?
Try: perldoc File::Path. On my machine, I got this:
NAME
File::Path - create or remove a series of directories
SYNOPSIS
use File::Path
mkpath(['/foo/bar/baz', 'blurfl/quux'], 1, 0711);
rmtree(['foo/bar/baz', 'blurfl/quux'], 1, 1);
DESCRIPTION
The mkpath function provides a convenient way to create
directories, even if your mkdir kernel call won't create
more than one level of directory at a time.
[yadda yadda yadda]
James
--
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Sat, 16 Aug 1997 15:50:48 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Aitor <webmaster@dmedia.net>
Subject: Re: HTML --> Perl conversion
Message-Id: <Pine.GSO.3.96.970816153038.7583G-100000@julie.teleport.com>
On Sat, 16 Aug 1997, Aitor wrote:
> Is there any program (for Macintosh) to transtale to perl an HTML page?
This is like asking whether anybody knows how to turn a slice of pie into
a recipe, or a carousel into directions to the amusement park! :-)
Perl is a programming language. HTML is a document markup language. But if
you need to make a program which can print out a HTML document, that's
easy to do once you learn Perl. If somebody gives you such a program
_before_ you learn Perl, you won't be able to do anything new with it.
Trust me, I'm not trying to be mean. (If somebody gave you a book on
physics before you knew how to read, it wouldn't help you any. By the time
you're ready for a book on physics, you should be able to find one at the
library.)
At this point, you should get a good book like the llama (Learning Perl,
second edition, with information on writing Perl for the web). You should
study that and then come back to this problem. You'll be able to write
your script with ease, once you've studied that book.
Somehow, I feel that you want the script anyway. :-) See whether you can
find some bugs in it. :-)
#!/usr/bin/perl -w
use strict;
my $filename = "foo.html"; my $progname = "foo";
open HTML, $filename or die "Can't read '$filename': $!";
open STDOUT, "> $progname" or die "Can't write '$progname': $!";
print "#!/usr/bin/perl -w\n\nuse strict;\nprint <<'END_HTML';\n";
while (<HTML>) { # Don't ask! :-)
chomp;
s/\\/\\\\/g;
print "$_\n";
}
print "END_HTML\n";
chmod 0755, $progname or warn "Can't chmod '$progname': $!";
exit;
It's worth noting that I didn't claim that this is a CGI script. But
that's easily fixed, once you understand CGI. :-) Good luck with it!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 17 Aug 1997 15:56:18 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: HTML --> Perl conversion
Message-Id: <33fd0ce7.4848614@news.tornado.be>
Tom Phoenix <rootbeer@teleport.com> wrote:
>Somehow, I feel that you want the script anyway. :-) See whether you can
>find some bugs in it. :-)
...
> while (<HTML>) { # Don't ask! :-)
> chomp;
> s/\\/\\\\/g;
> print "$_\n";
> }
haven't you forgotten about "$" and "@"?
s/(\\|\$|\@)/\\$1/g;
Bart.
------------------------------
Date: 16 Aug 1997 15:10:33 GMT
From: rachel@virago.org.au (Rachel Polanskis)
Subject: Re: makewhatis for Solaris
Message-Id: <5t4ft9$ukm@janis.virago.org.au>
In article <nqo4t8raciz.fsf@mitra.phys.uit.no>,
Tom Grydeland <tom@mitra.phys.uit.no> writes:
> trey@zipcon.net (Trey Valenta) writes:
>
>> I would like to fix the windex file on my SunOS5.5.1 system so that the
>> man pages for perl modules and other non Sun items get parsed properly
>> and inserted into the windex. I searched DejaNews and found that some
>> people had written some various perl scripts to replace sun's makewhatis
>> script but the only script I could get my hands on didn't work right.
>> (I won't waste any more bandwidth on this and assume that if you don't
>> have/know of this problem, you don't have anything already written).
>
> I've found and tried that script, and while it worked fine for Perl's
> manpages, it broke several others. I have instead made this quick fix
> to the makewhatis delivered with solaris:
>
> *** /usr/lib/makewhatis.solaris Wed Apr 23 09:35:03 1997
> --- /usr/lib/makewhatis Wed Apr 23 09:37:40 1997
> ***************
> *** 38,43 ****
> --- 38,44 ----
> -e 's/\\-/-/' \
> -e 's/\\\*-/-/' \
> -e 's/ VAX-11//' \
> + -e 's/\.IX Header "NAME" //' \
> -e 's/\\f[PRIB0123]//g' \
> -e 's/\\s[-+0-9]*//g' \
> -e '/ - /!d' \
>
>
>
It works!
It works!
It works!
If Sun adds one thing to Solaris 2.6, it's gotta be this patch!
At the very least, can we please see this enshrined in the
Solaris FAQ?
Thankyou, a thousand times...
rachel
--
Rachel Polanskis Kingswood, Greater Western Sydney, Australia
grove@zeta.org.au http://www.zeta.org.au/~grove/grove.html
r.polanskis@nepean.uws.edu.au http://www.nepean.uws.edu.au/ccd/
"Yow! Am I having fun yet?!" - John Howard^H^H^H^H^H^H^H^H Zippy the Pinhead
------------------------------
Date: 14 Aug 1997 12:58:11 GMT
From: c-muise@mail.dec.com (Mike Muise)
Subject: Re: Nifty hash initialization, but why?
Message-Id: <5suvd3$5b@usenet.pa.dec.com>
Mark A. Lehmann <mlehmann@prismnet.com> wrote:
> I really like this but I don't understand why this works and if it is
> dangerous.
> [...]
Somewhat unrelated, but I found this some years ago, and am still not
sure why it works, or what use it is. It's not Perl; I present it for
curiosity value:
$ >someother<somefile cat
Produces the output of 'cat < somefile > someother'. You can invoke
pipes, too:
$ <somefile grep foo |>someother sed 's/foo/bar/g'
Enlightenment (as always =) is welcome.
cheers,
mike
--
# mike muise, Unix Guy // c-muise@mail.dec.com
perl -e 'print pack"c*",grep{$l=0;$o=96⩝for(split//){$o+=$l=($n=(9..65
,(-15..9,1..6,10)x2)[ord])>$l?$n-2*$l:$n}$_=$o}@R=(X,xxi,xix,xx,I,
xiv,xv,xx,viii,v,ixix,XVI,v,ixix,xii,VIII,i,iii,xi,v,ixix,X7654)'
# "... And it is not fine for gods to menace fools." - Stephen Crane
------------------------------
Date: Sun, 17 Aug 1997 08:52:23 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Henry Wolff <henrywolff@hatsoftnevada.lovelock.nv.us.nospam>
Subject: Re: Passing an argument to a Perl SSI problem
Message-Id: <Pine.GSO.3.96.970817085138.28633P-100000@julie.teleport.com>
On 16 Aug 1997, Henry Wolff wrote:
> Tom Phoenix wrote in article
> > On 15 Aug 1997, Henry Wolff wrote:
> >
> > > But when I call it from the HTML page like
> > > <!--#exec cgi="cgi/ad.cgi?pege" -->
> > > it gives me an error processing this directive.
> >
> > It looks as if you have an invalid SSI tag. To find out, check with your
> > server's docs and FAQs, or those of a newsgroup about servers. Hope this
> > helps!
>
> I am not sure on what you mean by the invalid SSI tag.
To find out, check with your server's docs and FAQs, or those of a
newsgroup about servers. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 16 Aug 1997 22:43:33 -0400
From: Scott McKay <scmckay@ix.netcom.com>
Subject: Re: Perl 5.00[2 and 3] compile problems under SCO OSR 5.0.4
Message-Id: <33F66555.41C6@ix.netcom.com>
Danny Aldham wrote:
>
> McKay (scmckay@ix.netcom.com) wrote:
> I have always built perl with gcc, and it builds flawlessly out of the box.
> If you insist on using SCO's cc , check at ftp.sco.com in Skunk2 or Skunk96.
> There is a package there built with SCO's dev kit, and you can get their
> config.sh out of the package. This package also has the advantage of including
> dynamic loading of modules.
That's where I got the perl 5.003 from. For some reason, it core dumps
in the pod directory with both 5.002 and 5.003. To fix the problem, I
just downloaded 5.004.01 and it compiled without any problem.
------------------------------
Date: Sun, 17 Aug 1997 08:46:15 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Tad McClellan <tadmc@flash.net>
Subject: Re: Perl Performance FAQ?
Message-Id: <Pine.GSO.3.96.970817084055.28633M-100000@julie.teleport.com>
On Sat, 16 Aug 1997, Tad McClellan wrote:
> There are some things that will speed it up regardless of the data.
> eg: m//o (provided you meet the conditions that allow you to use it,
> of course)
That won't necessarily speed things up, although there shouldn't be a
performance hit for using it when it doesn't help. (Maybe /fixed_text/o
should merit a warning! :-)
> Some that speed things up for "most" data.
> eg: for(;;) rather than foreach() if the array is large (as mentioned
> in Eric's followup), and we could assume they are large, else the
> programmer would not be looking at a FAQ to get better speed ;-)
It's worth noting that this won't _necessarily_ be faster. If the large
array already exists, it's probably faster to simply iterate over it (and
avoid the penalty of lots of subscripting inside the loop) in most cases.
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 16 Aug 1997 21:44:08 -0500
From: "Paul L. Sventek" <sventek@ibm.net>
Subject: pl2bat, batwrap for perl-win32 build 306
Message-Id: <33F66578.2D1D@ibm.net>
I've been trying to get my perl scripts to run from
the command line in Windows 95 using perl-win32 build 306.
I've tried pl2bat.bat and batwrap.bat. When I use either
of these bat wrappers, the .bat files get created, but when
I try to use them, I get a "Can't execute xxxx." where
xxxx is the name of the bat file created. If this were UNIX
I'd be inclined to check to make sure the file is executable,
but this is Win95. Anyone have any clues?
------------------------------
Date: Sat, 16 Aug 1997 21:53:00 -0700
From: "Michael A. Chase" <mchase@ix.netcom.com>
Subject: Re: pl2bat, batwrap for perl-win32 build 306
Message-Id: <5t60gb$2ou@dfw-ixnews7.ix.netcom.com>
If the perl call inside the batch file uses -S, the batch file needs to
be in a directory in %path% or you need to give the full file
specification when running the batch file.
--
Mac :}) mchase@ix.netcom.com
Paul L. Sventek wrote in article <33F66578.2D1D@ibm.net>...
>I've been trying to get my perl scripts to run from
>the command line in Windows 95 using perl-win32 build 306.
>I've tried pl2bat.bat and batwrap.bat. When I use either
>of these bat wrappers, the .bat files get created, but when
>I try to use them, I get a "Can't execute xxxx." where
>xxxx is the name of the bat file created. If this were UNIX
>I'd be inclined to check to make sure the file is executable,
>but this is Win95. Anyone have any clues?
------------------------------
Date: 17 Aug 1997 01:43:01 GMT
From: ilesasw@aol.com (Ilesa SW)
Subject: Please Help me w/ this script!
Message-Id: <19970817014301.VAA03208@ladder01.news.aol.com>
I need someone to write me the following script:
The script takes a query string that contains a user's email address and
either "on" or "off" (ex
http://www.company.com/cgi-bin/script.cgi?user@host.com&on). If the second
parameter is "on", the script then creates a text file in a specified
directory. The name of this text file is that user's email address. The
only contents of the text file should be the user's IP address. If the
second parameter is "off" the text file that has the user's email address
as a name gets deleted from that specified folder. the "on" will always be
issued before the 'off', so files that don't exist will never be messed
with. If you can write this script for me, I'd be happy to pay you a small
fee....less than 50 bucks. I am a poor shareware developer, so I don't
have much cash. I'd be happy to credit you in my 'about box', though. This
script shouldn't take very long at all. If you can help or have more
questions, email me at ilesasw@aol.com.
Thanks!
---
ilesa software
premium internet utility software
www.ilesa.com
------------------------------
Date: Sun, 17 Aug 1997 01:16:41 -0600
From: Mike Powell <mikep@rt66.com>
Subject: Re: Relative link points to cgi-bin -- HELP
Message-Id: <33F6A559.424E@rt66.com>
John Callender wrote:
> This has nothing to do with the CGI program per se (and even less to do
> with comp.lang.perl.misc, as I'm sure any number of Thought Police are
> even now hastening to point out), but instead is simply based on how the
> Web server interprets relative links.
Watch out it's the thought police.
> Your "Thank You" page is being generated by an invocation of the cgi
> script, which resides in /cgi-bin. Thus, in the page that that script
> displays, an HREF attribute pointing to a file with no path information
> is going to be interpreted by the Web server as pointing to a file in
> that same directory; i.e., in /cgi-bin.
>
> Tell your script to create the link as
>
> <A HREF="../home.html">Back to the Home Page</A>
>
> (which will look in the parent of the current directory for home.html),
> or as
>
> <A HREF="/home.html">Back to the Home Page</A>
>
> (which will look in the Web server's root directory for home.html), and
> you should be fine.
Better yet, since SSI and CGI scripts are generally found in the same
directory, but are referred to differently but the server (may be a
moot point, but a consideration), a better practice may be to just
use absolute URL's (e.g. since the client browser will see the full
URL anyhow!).
Just my 2 cents.
==============================
Mike Powell
mikep@rt66.com
powellmw@acm.org
http://www.rt66.com/~mikep/
==============================
"It's all good. It's rock 'n roll."
"It's pure uncut, uncensored... rock 'n roll."
"Rock 'n roll baby..."
"Ya know what I like baby? ...rock 'n roll."
--Rock 'n Roll Brothers, 94 Rock Morning Show
------------------------------
Date: Sat, 16 Aug 1997 15:30:00 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Hedin Meitil <hm@royal.net>
Subject: Re: What is this EOF error?
Message-Id: <Pine.GSO.3.96.970816152545.7583F-100000@julie.teleport.com>
On Fri, 15 Aug 1997, Hedin Meitil wrote:
> When I run the script below, I get the error message "EOF in string at
> hellow.pl line 5." Why?
> print <<endHTML; # This is line 5
Two reasons: First, you (almost certainly) have some extra invisible
(whitespace) characters on the line which should have just 'endHTML' and
a trailing newline.
Second, you (almost certainly) have an old version of Perl, probably
version 4. For the security of your system, you (or your sysadmin) should
install 5.004 at once. Among other benefits, your code will run more
reliably, you'll have better docs, and making and debugging CGI scripts
will be easier.
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
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 881
*************************************