[8763] in Perl-Users-Digest
Perl-Users Digest, Issue: 2380 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 22 13:17:32 1998
Date: Wed, 22 Apr 98 10:11:33 -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 Wed, 22 Apr 1998 Volume: 8 Number: 2380
Today's topics:
CGI help for a newbie, easy question <jconnell@lords.com.nospam>
Re: CGI help for a newbie, easy question <jconnell@lords.com.nospam>
Re: CGI-Mail Problem (Jonathan Stowe)
CGI.PM Question & ASCII/HEX problem squid@fish.net
Re: Command line instructions don't execute in Win95 <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
compiling module compiles PERL?!? otis@POPULUS.net
Re: compiling module compiles PERL?!? otis@POPULUS.net
Compiling perl with static libc (Tom Hukins)
creating config file to pull into a script. skruzich@stc.net
Re: Deleting a Line of Text, but keeping the file tidy <rootbeer@teleport.com>
Re: Easy way to count lines in a file <johnnie@holly.colostate.edu>
Re: Easy way to count lines in a file <tchrist@mox.perl.com>
Re: Easy way to count lines in a file <tchrist@mox.perl.com>
Re: Easy way to count lines in a file <vallon@pearl.fi.bear.com>
Re: Eat my dust - Perl running on Windows 95 <sneaker@earthling.net>
Re: Eat my dust - Perl running on Windows 95 <rjk@coos.dartmouth.edu>
Re: Eat my dust - Perl running on Windows 95 (Martin Oakley)
Re: Eat my dust - Perl running on Windows 95 <tony@cyberscape.net>
Re: Eat my dust - Perl running on Windows 95 (Martien Verbruggen)
Re: Eat my dust - Perl running on Windows 95 <sowmaster@juicepigs.com>
Re: Eat my dust - Perl running on Windows 95 <sneaker@earthling.net>
Embed Perl: Can't link with stack routines <jbush@bigfoot.com>
Re: Excel via cgi <Pat_kane@compuserve.com>
Re: Excel97 wont SaveAs() <robk-not-@reading.sgi.com>
Re: Expand wildcards shellishly (Peter Scott)
Re: Fastest "smallest power of 2 >= N" in Perl? <rjk@coos.dartmouth.edu>
File Manipulation <dooleyr@ccis12.baylor.edu>
Re: File Manipulation <johnnie@holly.colostate.edu>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 20 Apr 1998 00:47:51 -0400
From: "Andrew Connell" <jconnell@lords.com.nospam>
Subject: CGI help for a newbie, easy question
Message-Id: <6hek8e$8hs@bgtnsc02.worldnet.att.net>
I am new to cgi scripting, but i am familiar with perl. However, I have yet
to make it work. I have put a script which I know works in that directory
(I know it works because it is straight off a tutorial site). I have tried
the chmod 0755 to the file, but I continue to get the "Internal Server
Error: The server encountered an internal error or misconfiguration and was
unable to complete your request." error. Anyone see anything that I am
doing wrong or things I should check on? Please email responses.
A copy of the script as well as the URL is located below:
http://jconnell.host4u.com/CGI-bin/howdy.pl
#!/user/bin/perl -w
# howdy--the easiest of CGI programs
print <<END_of_Multiline_Text;
Content-type: text/html
<HTML>
<HEAD>
<TITLE>Hello World</TITLE>
</HEAD>
<BODY>
<H1>Greetings, Terrans!</H1>
</BODY>
</HTML>
END_of_Multiline_Text;
------
Andrew Connell <jconnell@lords.com>
ICQ#: 4210346 AOL IM: jaconell
http://jconnell.host4u.com
"No one is too old or too young to do something."
-Bobby Sands-
------------------------------
Date: Mon, 20 Apr 1998 14:27:34 -0400
From: "Andrew Connell" <jconnell@lords.com.nospam>
Subject: Re: CGI help for a newbie, easy question
Message-Id: <6hg49q$ca0@bgtnsc02.worldnet.att.net>
I did both the changes that I were suggested (removing the ; and fixing the
#!usr/... header), but I am still getting the error. Any suggestions?
------
Andrew Connell <jconnell@lords.com>
ICQ#: 4210346 AOL IM: jaconell
http://jconnell.host4u.com
"No one is too old or too young to do something."
-Bobby Sands-
Andrew Connell wrote in message <6hek8e$8hs@bgtnsc02.worldnet.att.net>...
>
>I am new to cgi scripting, but i am familiar with perl. However, I have
yet
>to make it work. I have put a script which I know works in that directory
>(I know it works because it is straight off a tutorial site). I have tried
>the chmod 0755 to the file, but I continue to get the "Internal Server
>Error: The server encountered an internal error or misconfiguration and was
>unable to complete your request." error. Anyone see anything that I am
>doing wrong or things I should check on? Please email responses.
>
>A copy of the script as well as the URL is located below:
>http://jconnell.host4u.com/CGI-bin/howdy.pl
>
>#!/user/bin/perl -w
># howdy--the easiest of CGI programs
>print <<END_of_Multiline_Text;
>Content-type: text/html
>
><HTML>
><HEAD>
><TITLE>Hello World</TITLE>
></HEAD>
><BODY>
><H1>Greetings, Terrans!</H1>
></BODY>
></HTML>
>
>END_of_Multiline_Text;
>
>
>------
>Andrew Connell <jconnell@lords.com>
>ICQ#: 4210346 AOL IM: jaconell
>http://jconnell.host4u.com
>
>"No one is too old or too young to do something."
> -Bobby Sands-
>
>
>
>
------------------------------
Date: Tue, 21 Apr 1998 15:42:17 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: CGI-Mail Problem
Message-Id: <353cb522.18357747@news.btinternet.com>
On 21 Apr 1998 14:30:10 GMT, GRau@alcatel.de (Gaby Rau) wrote:
>
>I have a problem with sending an external Email from an Perl-CGI-Script.
>
<etc>
Eh,oh.
Your problem is due to the circumstances under which you CGI is run bu
the server and thus has nothing to do with Perl in reality.
However a Perlish solution would be to jettison your widely deprecated
method of sending mail in favour of the Mail::* modules available from
CPAN. You might want to read perlfaq9 first.
/J\
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm
------------------------------
Date: Wed, 22 Apr 1998 01:03:55 GMT
From: squid@fish.net
Subject: CGI.PM Question & ASCII/HEX problem
Message-Id: <353d3daf.6787295@news.earthlink.net>
Howdy all...
Scenario: Graphics files and a user fill-out form being uploaded via
http file upload from both PC and Macintosh(ugh).
Graphics file is written to upload directory and user input from form
is written to a text file with the same name as the graphic file+.txt
Graphics file is written with:(as recommended in CGI.PM docs)
<snip>
while ($bytesread = read($filename,$buffer,1024)) {
$totalbytes += $bytesread;
binmode OUTFILE;
print OUTFILE $buffer;
}
close($filename);
close(OUTFILE);
<snip>
Text file is generated by following:
<snip>
$descrip = $real_name . '.txt';
open (TEMP_FILE, ">../upload/$descrip") || die;
$query->save(TEMP_FILE) || die;
close (TEMP_FILE);
<snip>
Using: PERL V 5.003, SCO, CGI.PM
Problem: P.C. uploads work like a champ but the friggin' Mac's uploads
are inserting the HEX equivalents for all non-alphanumerics
i.e. the @ symbol becomes %40.
This happened with both the filenaming and in the text file name=value
pairs. I was able to clean up the filename before it is written to
with the following subst/pack:
<snip>
$filename =~ s/%([0-9a-f][0-9a-f])/pack("C",hex($1))/ige
<snip>
But no such luck for the $query->save call to CGI.PM
The text file remains cluttered. Any suggestions would be greatly
appreciated.
Everything else works great and this part has just about stumped me
Please don't laugh at my E-Mail address.
Thanks all!
------------------------------
Date: Tue, 21 Apr 1998 20:38:32 -0700
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Command line instructions don't execute in Win95
Message-Id: <6hjon6$m3r@bgtnsc02.worldnet.att.net>
This might be a FAQ but I'll answer it anyway: WinPerl really wants
double quotes when you enclose parameters for the -e command. You might
be able to do something like
perl -e qq(print "Hello, world!\n";)
but I can't remember for sure. In any case, put the command in single
quotes and it gets very confused. If you really need double quotes you
can do
perl -e "print \"Hello, world!\"n;"
but Perl gives you enough ways to simulate quotes you should be able to
work around it.
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
Allan M. Due wrote in message <6hi66o$sb4$0@206.165.146.159>...
>Hi Folks,
>
> Sorry to reply to myself. Apparently the best way to solve a
problem is
>to post it to the newsgroup and and then the solution will magically
pop
>into your head. Just so you can embarras yourself twice. First by
posting
>the question, and then having to reply to yourself. It turns out that
>using:
>
>perl -e "print 'JaPHW';"
>
>works just fine under win95. However, I would still like to understand
why
>this is different. Again, sorry for the double post.
>
>AmD
>
>
------------------------------
Date: Sun, 19 Apr 1998 13:16:20 -0600
From: otis@POPULUS.net
Subject: compiling module compiles PERL?!?
Message-Id: <6hdf1k$c8m$1@nnrp1.dejanews.com>
Hello,
I was trying to compile DateCalc 4.0b7 module but for some reason 'make test'
started re-compiling perl on my machine, and not DateCalc module.
This is on BSDI 2.0 with perl 5.003 (I didn't upgrade perl because I could not
compile perl 5.004_4 on this machine).
Here is how it 'works':
bets:/tmp/Date-Calc-4.0#perl Makefile.PL
Writing Makefile for Date::Calc
bets:/tmp/Date-Calc-4.0#
bets:/tmp/Date-Calc-4.0#make
gcc -c -I/usr/local/include -O -DVERSION=\"4.0\" -DXS_VERSION=\"4.0\"
-I/usr1/local/lib/perl5/i386-bsdos/5.003/CORE Calc.c
gcc -c -I/usr/local/include -O -DVERSION=\"4.0\" -DXS_VERSION=\"4.0\"
-I/usr1/local/lib/perl5/i386-bsdos/5.003/CORE DateCalc.c
rm -rf ./blib/arch/auto/Date/Calc/Calc.a
ar cr ./blib/arch/auto/Date/Calc/Calc.a Calc.o DateCalc.o && /usr/bin/ranlib
./blib/arch/auto/Date/Calc/Calc.a
chmod 755 ./blib/arch/auto/Date/Calc/Calc.a
Manifying ./blib/man3/Date::Calc.3
bets:/tmp/Date-Calc-4.0#make test
Writing "Makefile.aperl" for this perl
Writing Makefile.aperl for Date::Calc
make -f Makefile.aperl perl
Writing ./perlmain.c
cd . && gcc -c -I/usr1/local/lib/perl5/i386-bsdos/5.003/CORE
-I/usr/local/include -O -DVERSION=\"4.0\"
-DXS_VERSION=\"4.0\" -I/usr1/local/lib/perl5/i386-bsdos/5.003/CORE perlmain.c
cat ./blib/arch/auto/Date/Calc/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralibs.all
cat /usr1/local/lib/perl5/i386-bsdos/5.003/auto/DB_File/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralibs.all
cat /usr1/local/lib/perl5/i386-bsdos/5.003/auto/DynaLoader/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralib
s.all
cat /usr1/local/lib/perl5/i386-bsdos/5.003/auto/Fcntl/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralibs.all
cat /usr1/local/lib/perl5/i386-bsdos/5.003/auto/FileHandle/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralibs.all
cat /usr1/local/lib/perl5/i386-bsdos/5.003/auto/GD/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralibs.all
cat /usr1/local/lib/perl5/i386-bsdos/5.003/auto/NDBM_File/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralibs.all
cat /usr1/local/lib/perl5/i386-bsdos/5.003/auto/POSIX/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralibs.all
cat /usr1/local/lib/perl5/i386-bsdos/5.003/auto/SDBM_File/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralibs.all
cat /usr1/local/lib/perl5/i386-bsdos/5.003/auto/Safe/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralibs.all
cat /usr1/local/lib/perl5/i386-bsdos/5.003/auto/Socket/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralibs.all
cat /usr1/local/lib/perl5/site_perl/i386-bsdos/auto/GD/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralibs.all
cat /usr1/local/lib/perl5/site_perl/i386-bsdos/auto/Storable/extralibs.ld >>
./blib/arch/auto/Date/Calc/extralibs.all
cat /usr1/local/lib/perl5/site_perl/i386-bsdos/auto/Term/ReadKey/extralibs.ld
>> ./blib/arch/auto/Date/Calc/extralibs.all
gcc -L/usr/X11/lib -L/usr/local/lib -o perl -O ./perlmain.o
/usr1/local/lib/perl5/i386-bsdos/5.003/CORE/libper
l.a /usr1/local/lib/perl5/site_perl/i386-bsdos/auto/Term/ReadKey/ReadKey.a
/usr1/local/lib/perl5/site_perl/i3
86-bsdos/auto/Storable/Storable.a
/usr1/local/lib/perl5/site_perl/i386-bsdos/auto/GD/GD.a /usr1/local/lib/pe
rl5/i386-bsdos/5.003/auto/Socket/Socket.a
/usr1/local/lib/perl5/i386-bsdos/5.003/auto/Safe/Safe.a /usr1/loca
l/lib/perl5/i386-bsdos/5.003/auto/SDBM_File/SDBM_File.a
/usr1/local/lib/perl5/i386-bsdos/5.003/auto/POSIX/PO...
..
...
....
and then it starts complaining about some errors.
Is this a known problem?
Thanks,
Otis
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Tue, 21 Apr 1998 21:18:31 -0600
From: otis@POPULUS.net
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: compiling module compiles PERL?!?
Message-Id: <6hjk1m$ldb$1@nnrp1.dejanews.com>
> > I was trying to compile DateCalc 4.0b7 module but for some reason 'make
> > test' started re-compiling perl on my machine, and not DateCalc module.
>
> Perhaps some date stamp is incorrect or in the future? Or your perl (or
> your system) isn't set up to do dynamic linking, maybe?
the latter, I believe.
I was never able to compile perl with dynamic linking on this machine (BSDI
2.0)
But does Steffen's Date::* modules require perl with dynamic linking?
Won't work with a statically build perl??
> > This is on BSDI 2.0 with perl 5.003 (I didn't upgrade perl because I
> > could not compile perl 5.004_4 on this machine).
>
> I think you should fix that, first! 5.400 should compile cleanly on
> virtually any properly-configured machine.
it doesn't compile on this BSDI 2.0 :(
I can try again and post the errors, but I think I've done that in the past
but nobody knew a solution :(
Thanks,
Otis
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Sun, 19 Apr 1998 21:45:20 GMT
From: tom@NOSPAMeborcom.com (Tom Hukins)
Subject: Compiling perl with static libc
Message-Id: <353a3c41.55174@nntp.netcom.net.uk>
This is probably a really simple question, but I've had no luck
finding the answer anywhere: How do I build Perl to use a static
libc rather than a dynamic libc?
I am using a FreeBSD 2.2.6-RELEASE system (in case that matters).
The Perl FAQ suggests this is a good idea, as it may noticeably
improve the performance of Perl scripts. The FAQ suggests reading
the INSTALL file which comes with Perl's source, not mentioning
which section of the INSTALL file is relevant. Having read the
whole thing several times, I still don't know what I should do to
build a static libc.
I have also searched DejaNews and Alta Vista, and had no luck
with either of them.
In config.sh there are two variables which look like they might
be relevant - 'static_ext' and 'libc'. I have tried setting
'libc' to '/usr/lib/libc.a' but ktrace and ldd suggest that a
libc.so (shared) is still being used.
On a related note, I will probably build two Perls on my system -
one with a static libc, and one with a dynamic libc. Using a
dynamic libc would reduce bloat for programs such as mod_perl
which embed a Perl interpreter within their code. Am I right in
assuming that the only thing I would need to change would be
having both an i386-freebsd/5.00404-static and an
i386-freebsd/5.00404-dynamic rather than having an
i386-freebsd/5.00404 directory within /usr/local/lib/perl5? This
would save me having to re-install modules for both my Perl
builds.
I would greatly appreciate any help with this.
Regards,
Tom
If you want to e-mail me remove 'NOSPAM' from my address
--
Learn how to create amazing web sites
Visit eBORcOM's Web Development Resources
http://www.eborcom.com/webmaker/
------------------------------
Date: Mon, 20 Apr 1998 11:37:51 -0600
From: skruzich@stc.net
Subject: creating config file to pull into a script.
Message-Id: <6hftkv$d46$1@nnrp1.dejanews.com>
I am writing a script to automate a backup program, and I was wanting to know
if there was a easy way to put stuff into a config file, for easy updates, to
call into the perl script. For example, the volumenames of tapes could be
placed into the configfile and called in. What I am running into is problems
with how to do it. I know that in C, you can #inherit, or a include
statement. I am getting a bit confused on what i can and can't do.
This is what i want to do.
I want to bring in a config file with certain information defined.
for example.
cfgfile
______________
TAPEVOLS
000001
000002
000003
000004
000005
000006
000007
END_TAPEVOLS
NEXTDATA
blah blah blah
blah blah blah
END_NEXTDATA
_______________________
perlscript
_________________
#!/opt/perl5/bin/perl
#include cfgfile;
Thanks
Steve Kruzich
skruzich@stc.net
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 22 Apr 1998 00:49:14 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Chad Peterson <chad@umr.edu>
Subject: Re: Deleting a Line of Text, but keeping the file tidy
Message-Id: <Pine.GSO.3.96.980421174655.21174n-100000@user2.teleport.com>
On Tue, 21 Apr 1998, Chad Peterson wrote:
> $oldstring="Line Three";
> s/$oldstring//;
You replace "Line Three blah\n" with " blah\n" there, right?
> What if I don't want a blank line in there?
Replace it with nothing at all:
s#.*$oldstring.*##s
> chad@NOSPAMumr.edu
Why mangle it here if it's correct in your headers? Odd...
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 19 Apr 1998 21:33:28 -0600
From: John Blanco <johnnie@holly.colostate.edu>
To: Tommy <tkho@technologist.com>
Subject: Re: Easy way to count lines in a file
Message-Id: <353AC207.CA4C4641@holly.colostate.edu>
Tommy wrote:
> how about
>
> @Lines= <ACCESS>
> $NumOfLines= $#Lines;
Go with your original plan and use grep. Here's the most portable:
grep -c ^ <filename>
Notice this is NOT a Perl call but a system call. See how much
faster that is...
- Johnnie B
------------------------------
Date: 20 Apr 1998 03:58:46 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Easy way to count lines in a file
Message-Id: <6heh5m$d4e$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
John Blanco <johnnie@holly.colostate.edu> writes:
: grep -c ^ <filename>
: Notice this is NOT a Perl call but a system call. See how much
:faster that is...
No sir, that is not a trap into kernel space.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
pos += screamnext[pos] /* does this goof up anywhere? */
--Larry Wall in util.c from the perl source code
------------------------------
Date: 20 Apr 1998 22:54:13 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Easy way to count lines in a file
Message-Id: <6hgjml$n8p$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, keithmur@mindspring.com writes:
....
:but in such cases Perl outsmarts me and refuses to evaluate the
:filehandle in a list context before it goes to scalar context, so the
:assign to @_ seems necessary, unless there's something clever someone
:else knows...
% perl -le 'print scalar((undef) = <STDIN>)' < /etc/motd
4
% perl -le 'print scalar((undef) = <STDIN>)' < /etc/termcap
10459
% perl -le 'print scalar((undef) = <STDIN>)' < /bin/cat
33
Actually, you can omit the undef for 5.004 and just have:
% perl -le 'print scalar(() = <STDIN>)' < /etc/termcap
10459
Programmatically, this suffices:
$count = (undef) = <FH>;
Remember: the scalar sense of list assignment is the RHS count.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Zounds! I was never so bethumped with words
since I first called my brother's father dad.
-- William Shakespeare, "King John"
------------------------------
Date: 20 Apr 1998 19:33:03 -0400
From: Justin Vallon <vallon@pearl.fi.bear.com>
Subject: Re: Easy way to count lines in a file
Message-Id: <x6elnt0m5lc.fsf@pearl.fi.bear.com>
I was suggesting that a `Progress bar' may be just as meaningful if
stated in terms of the number of bytes processed.
If the process is consuming data in real time, and the number of lines
is being displayed in real time, the amount of effort that it requires
to actually compute the number of lines elapsed may not be worth the
cost, where the number of bytes is extremely inexpensive to compute.
comdog@computerdog.com (brian d foy) writes:
> In article <x6eogy1mnca.fsf@pearl.fi.bear.com>, Justin Vallon
> <vallon@pearl.fi.bear.com> posted:
>
> >May I suggest just using the number of bytes in the file? It should
> >give a very reasonable approximation of the number of lines. So, you
> >could notify on every 1k lines, or 80k bytes.
>
> i'm curious how you translate bytes to lines. for instance, i have
> a data file that i'm avoiding at the moment - it's about 200 lines [1]
> and about 500 characters per line. another data file for the same
> project has 6000 lines of about 20 characters per line.
--
-Justin
vallon@bear.com
------------------------------
Date: Mon, 20 Apr 1998 03:07:40 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: Eat my dust - Perl running on Windows 95
Message-Id: <353ABA60.911811A1@earthling.net>
ELSS Admin wrote:
> Eat my dust - I've got Perl running on an old Windows 95 box - for fun.
> (486 dx-66)
My RedHat 5.0 (Hurricane) P100 can beat up
your old Windoze 95 486 DX66
:-)
PS - Did you document your efforts
for the Perl Win95 FAQ?
__________________________
Bill Jones...............|
Sneaker's Nest...........|
Chasecreek Systemhouse...|
------------------------------
Date: Sun, 19 Apr 1998 23:25:40 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Eat my dust - Perl running on Windows 95
Message-Id: <353AC036.ACD1380E@coos.dartmouth.edu>
ELSS Admin wrote:
>
> Eat my dust - I've got Perl running on an old Windows 95 box - for fun.
> (486 dx-66)
I have Perl running on four DOS machines at work. What's your point? :-)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Mon, 20 Apr 1998 04:58:51 GMT
From: martin.oakley@usa.net (Martin Oakley)
Subject: Re: Eat my dust - Perl running on Windows 95
Message-Id: <353ad4b7.22074809@news.bne.aone.net.au>
ELSS Admin <elssa09@callisto.si.usherb.ca> wrote:
>Eat my dust - I've got Perl running on an old Windows 95 box - for fun.
>(486 dx-66)
For fun? I don't know if I'd go that far, but perl certainly makes
win95 more pleasant.
------------------------------
Date: Mon, 20 Apr 1998 20:35:32 +0100
From: "Tony Kenny" <tony@cyberscape.net>
Subject: Re: Eat my dust - Perl running on Windows 95
Message-Id: <6hg82p$o1f$1@svr-c-01.core.theplanet.net>
I have it running on a 486 33MHz laptop, like the other person said, what's
your point?
~TK
Martin Oakley wrote in message <353ad4b7.22074809@news.bne.aone.net.au>...
>ELSS Admin <elssa09@callisto.si.usherb.ca> wrote:
>
>>Eat my dust - I've got Perl running on an old Windows 95 box - for fun.
>>(486 dx-66)
>
>For fun? I don't know if I'd go that far, but perl certainly makes
>win95 more pleasant.
------------------------------
Date: 21 Apr 1998 03:46:49 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Eat my dust - Perl running on Windows 95
Message-Id: <6hh4r9$qgq$1@comdyn.comdyn.com.au>
In article <33066F57.2FF1@callisto.si.usherb.ca>,
ELSS Admin <elssa09@callisto.si.usherb.ca> writes:
> Eat my dust - I've got Perl running on an old Windows 95 box - for fun.
> (486 dx-66)
Err... back when I still had to use DOS/Win boxes, I always had perl
installed on it. In fact, on my wife's Win95 box, I have perl installed
as well.
Now.. What was that about dust? I just don't get it. Are you saying
you are proud that you successfully unpacked an archive and followed
the instructions that came with it? Well.. my sincere congratulations
to you. Or are you saying that there was so much dust on that old
machine before you installed perl, that you are now looking for
volunteers to help you get rid of it? In that case: Unfortunately I
have more than enough dust of my own to work with. I am sorry to say
that I don't plan on developing a taste for yours as well.
Sorry,
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Advertising: The science of arresting
Commercial Dynamics Pty. Ltd. | the human intelligence long enough to
NSW, Australia | get money from it.
------------------------------
Date: Tue, 21 Apr 1998 19:01:00 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
Subject: Re: Eat my dust - Perl running on Windows 95
Message-Id: <353D252C.6EF7@juicepigs.com>
Petr Prikryl wrote:
>
> Ronald J Kimball (rjk@coos.dartmouth.edu) wrote:
> >ELSS Admin wrote:
> >>
> >> Eat my dust - I've got Perl running on an old Windows 95 box - for fun.
> >> (486 dx-66)
>
> >I have Perl running on four DOS machines at work. What's your point? :-)
>
> Do read carefully the message! Do you also have that much fun of it ;-)
I download nekkid pics from USENET using my win32 perl. You bet I have
fun. 8-)
--
Bob Trieger | Titanic: big boat, bigger
sowmaster@juicepigs.com | iceberg, big deal
------------------------------
Date: Tue, 21 Apr 1998 23:16:00 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: Eat my dust - Perl running on Windows 95
Message-Id: <353D2713.508CABC8@earthling.net>
Bob Trieger wrote:
>
>
> I download nekkid pics from USENET using my win32 perl. You bet I have
> fun. 8-)
>
> --
> Bob Trieger | Titanic: big boat, bigger
> sowmaster@juicepigs.com | iceberg, big deal
If I 'member correctly, you're 70? Right?
Just wondering if I would be interested in naked pics at 70 %)
__________________________
Bill Jones...............|
Sneaker's Nest...........|
Chasecreek Systemhouse...|
------------------------------
Date: Tue, 21 Apr 1998 17:08:30 -0500
From: "Alt.net" <jbush@bigfoot.com>
Subject: Embed Perl: Can't link with stack routines
Message-Id: <6hj5d0$qdi$0@dosa.alt.net>
I'm trying to embed Perl in my Windows NT Visual C++ 5.0 application. So
for, I've been able instantiate Perl interpreters, execute scripts, and even
call Perl subroutines. Everything compiles, links, and runs just fine.
But now I'm trying to pass parameters to a Perl subroutine, and I'm unable
to link because all of the Perl stack manipulation routines are generating
"unresolved external" errors.
Does Perl not export those functions by default? How do I get Perl to export
them so that my application will link?
Thanks,
John
johnb@intertech-ns.com
------------------------------
Date: Mon, 13 Apr 1998 23:36:24 -0400
From: Pat Kane <Pat_kane@compuserve.com>
Subject: Re: Excel via cgi
Message-Id: <3532D9B8.678E@compuserve.com>
Peter Tapolyai wrote:
>
> I have to query an MS Excel Spreadsheet across the web.
> I have the simplified core of the cgi below. However, this
> query does not return the very first 'records' (or cell values)
> or any text values either.
> That is if I have:
> A B
> 1 11 12
> 2 21 text
> 3 31 32
> values in a spreadsheet, then all numberical values returned,
> with the exception of A1 and B1 values in addition to the B2 'text'.
> Column A's name is F1 and Column B is F2 through ODBC.
>
> Any ideas what I am missing ?
>
> use Win32::ODBC;
> $DSN = "Excel";
> $db = new Win32::ODBC($DSN);
>
> &html_header;
> print "Excel Data<br>\n";
> print "<ol>\n";
> $db->Sql("SELECT * FROM \"Sheet1\$\"");
> while ($db->FetchRow()){
> %in = $db->DataHash();
> print " <li>", $in{F1}, " ", $in{F2}, "\n";
> }
> print "<\/ol>\n";
> $db->Close();
> &html_footer;
>
> --
>
> Remove ### from before replying
>
> peter###@uhu.com
> http://www.uhu.com/tinkershop/
Peter,
I am a perl novice so take this reply as only what I would try next
based on my limited knowledge. Whenever I have used a hash I have put
the key in single quotes. I would therefore make the following change.
print " <li>", $in{'F1'}, " ", $in{'F2'}, "\n";
Hope it works for you.
Pat
------------------------------
Date: Mon, 20 Apr 1998 18:39:42 +0100
From: Rob Knight <robk-not-@reading.sgi.com>
Subject: Re: Excel97 wont SaveAs()
Message-Id: <353B885E.2D2FF5AF@reading.sgi.com>
Thanks, this '39' works fine with Win32::OLE
#...
..SaveAs($nfile, 39);
Should I expect ..SaveAs($nfile, $xlExcel5); to work, also? It doesn't
:(
What I could really do with is the Win32::OLE::Const which isn't
included with the software set I grabbed of GS 5.004_02 in which the
OLE.pm is version 0.03
I've looked through CPAN under OLE but didn't spot it. Where should I
look?
Jan Dubois wrote:
>
> xlExcel5 is a symbol constant. It has the value 39. Depending on the
> version of your Win32::OLE module you can also use the Win32::OLE::Const
> module:
>
> use Win32::OLE::Const 'Microsoft Excel';
> #...
> $xl->ActiveWorkbook->SaveAs({
> Filename => $nfile,
> Fileformat => $xlExcel5,
> });
>
> Please note that the next release of Win32::OLE will change the const
> module to produce inlinable subs instead of scalar variables. You'll
> then be able to just write xlExcel5 (without the leading $).
That, I'm looking forward to! :)
Thanks,
Rob
------------------------------
Date: 21 Apr 1998 16:45:03 GMT
From: psf@euclid.jpl.nasa.gov (Peter Scott)
Subject: Re: Expand wildcards shellishly
Message-Id: <6hiief$ohc@netline.jpl.nasa.gov>
In article <6hgihn$m5d$2@nntp1.ba.best.com>, David Fetter <dfetter@shell4.ba.best.com> writes:
> In the course of working with an O^H^H^H legacy database, I've found a
> profound lack of wildcardishness in matching strings, so I'd like
> to build a wildcard expander in perl, which would work like this:
>
> Wildcard_Expand('.*([a-c]foo|[d-f]bar)?') would return the following
> list:
>
> %afoo_
> %bfoo_
> %cfoo_
> %dbar_
> %ebar_
> %fbar_
I think you meant to say '.*([a-c]foo|[d-f]bar).?', BTW.
^
I just tackled much the same issue, and found it not worth the trouble
to translate arbitrary regexes to SQL. Unless you have a large existing
body of code that already contains or delivers arbitrary regexes, if you're
bent on expanding the search syntax in the supplied string, just devise
some mini syntax that's easy to parse, e.g., for a column called FIELD of
numbers (note that you have to know the data type in order to generate
the SQL 'cos of quotes):
Input SQL WHERE clause
----- ----------------
n FIELD = n
">n" FIELD > n (etc for <, <=, >=, !=)
"m-n" FIELD BETWEEN m AND n
"!m-n" FIELD NOT BETWEEN m AND n
[@n] FIELD IN (join ',', @n)
This approach can deliver more power than regexes if you need to test
date ranges.
Also, consider your users: if they're coming from a SQL background, they'll
likely be most comfortable with the % and _ metacharacters.
--
This is news. This is your | Peter Scott, NASA/JPL/Caltech
brain on news. Any questions? | (psf@euclid.jpl.nasa.gov)
Disclaimer: These comments are the personal opinions of the author, and
have not been adopted, authorized, ratified, or approved by JPL.
------------------------------
Date: Sun, 19 Apr 1998 17:56:45 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Fastest "smallest power of 2 >= N" in Perl?
Message-Id: <353A7323.AC740F73@coos.dartmouth.edu>
Igor Krivokon wrote:
>
> As far as I understand (from original post), for N<=0 the function should
> return 1,
> (btw, why not 0?)
Because 0 is not a power of 2?
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 21 Apr 1998 17:39:13 +0000
From: Roger Dooley <dooleyr@ccis12.baylor.edu>
Subject: File Manipulation
Message-Id: <353CD98F.12D7@ccis12.baylor.edu>
Hi,
I'm new to Perl (I just started using it last Friday), and I have what
are probably simple questions that I'd like answered. I'm writing a Perl
script that will allow me to run a program that does iterations to find
a minimum energy configuration (not really important). I'd like to know
if the following are possible with Perl:
1. Can I read a line from a file and extract a certain portion of that
line without having to read, store the text, and then grab the
relevant information?
2. If I have a file with some data in it, can I open the file and
change some of the data. For example if I have the following line:
0 -1 2 0
Can I go into the file and change the 2 to a 0? I have the book
Learning Perl, but I'm still not sure how to do these things.
If anyone has any helpful suggestions, please drop me some mail
at dooleyr@ccis12.baylor.edu.
Thanks in advance.
-Roger Dooley
------------------------------
Date: Tue, 21 Apr 1998 20:32:48 -0600
From: John Blanco <johnnie@holly.colostate.edu>
To: Roger Dooley <dooleyr@ccis12.baylor.edu>
Subject: Re: File Manipulation
Message-Id: <353D56D0.C106B3C8@holly.colostate.edu>
Roger Dooley wrote:
> 1. Can I read a line from a file and extract a certain portion of that
>
> line without having to read, store the text, and then grab the
>
> relevant information?
>
Well, you'll have to read the data from the file into a variable and
not just read from thefile directly if that's what you're asking...
> 2. If I have a file with some data in it, can I open the file and
> change some of the data. For example if I have the following
> line:
>
> 0 -1 2 0
Let's put it this way. I think you want the the -pi combo flag. What
it does is reads one line
at a time from a file and edits it in place. So changing all 2's to 1's
would work like:
perl -pi -e 's/\b2\b/1/g' <filename>
- Johnnie B
------------------------------
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 2380
**************************************