[12541] in Perl-Users-Digest
Perl-Users Digest, Issue: 6141 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 27 02:07:30 1999
Date: Sat, 26 Jun 99 23: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 Sat, 26 Jun 1999 Volume: 8 Number: 6141
Today's topics:
"Learning Perl" exercise question <mdichirico@lamotionpictures.com>
"Learning Perl" exercises <mdichirico@lamotionpictures.com>
"Learning Perl" exercises <mdichirico@lamotionpictures.com>
"Learning Perl" exercises <mdichirico@lamotionpictures.com>
"Learning Perl" exercises <mdichirico@lamotionpictures.com>
Re: "Slurping" a .jpg file <swiftkid@bigfoot.com>
Re: 2 simple (not to me tho) questions <dgris@moiraine.dimensional.com>
Re: Beginner's Question (Abigail)
Re: Capturing a Stop event from the Browser (Abigail)
Re: CGI::Push Problem (David Efflandt)
check for NT process <ccarr@websocket.com>
Re: Comparing two associative arrays (Philip 'Yes, that's my address' Newton)
Re: embedding perl question <pabl0@starmail.com>
exercise question from "Learning Perl" <mdichirico@lamotionpictures.com>
Re: how do I save an MD5 checksum? (Abigail)
Re: How to access MS Access using perl/cgi/unix <ccarr@websocket.com>
Re: How to access MS Access using perl/cgi/unix (Abigail)
Re: How to store hashes <swiftkid@bigfoot.com>
Learning Perl exercises using reverse <mdichirico@lamotionpictures.com>
Re: Need help with numbers and zeros (Abigail)
Re: Need Random Generator HELP!! (Abigail)
NMake Dependency Generator <mckevin@erols.com>
offline testing of Perl/CGI's (Laar)
Re: offline testing of Perl/CGI's (Laar)
Re: Perl utility (Abigail)
Re: Safe expression evaluation <dgris@moiraine.dimensional.com>
Re: separate file <jjames@atlantic.net>
Re: syntax check without execution (Abigail)
Trying to install Win32 Server ... error message... <not@gonna.tell>
Re: Trying to install Win32 Server ... error message... <not@gonna.tell>
using reverse in Learning Perl book <mdichirico@lamotionpictures.com>
Re: Viral matters [completely off-topic] <jik@foxinternet.net>
weirdness with Netcom (Laar)
Re: wwwboard on webjump.com <webmaster@chatbase.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 27 Jun 1999 05:20:12 GMT
From: Mike Dichirico <mdichirico@lamotionpictures.com>
Subject: "Learning Perl" exercise question
Message-Id: <7l4ca1$fhs$1@nnrp1.deja.com>
I'm reading "Learning Perl" and trying the exercises in them. I'm
using my Win98 computer as my platform.
On page 57, exercise #1, it says to wrte a program that reads a list of
strings on seperate lines and prints out the list in reverse order.
Appendix A of the book gives the following code as one of the possible
answers to the exercise:
print "Enter the list of strings:\n";
@list = <STDIN>;
@reverselist = reverse @list;
print @reverselist;
When I run the program, it asks for me to enter a string like it's
supposed to. But after entering a string and hitting <Enter>, the
program just hangs there. I have to hit <Ctrl> + Z to get back to my
command prompt.
How come it isn't reversing my string like it's supposed to? What am I
not adding to the code that it's supposed to have? TIA for any help.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sun, 27 Jun 1999 05:00:03 GMT
From: Mike Dichirico <mdichirico@lamotionpictures.com>
Subject: "Learning Perl" exercises
Message-Id: <7l4b4d$f4g$1@nnrp1.deja.com>
I'm reading "Learning Perl" and trying the exercises in them. I'm
using my Win98 computer as my platform.
On page 57, exercise #1, it says to wrte a program that reads a list of
strings on seperate lines and prints out the list in reverse order.
Appendix A of the book gives the following code as one of the possible
answers to the exercise:
print "Enter the list of strings:\n";
@list = <STDIN>;
@reverselist = reverse @list;
print @reverselist;
When I run the program, it asks for me to enter a string like it's
supposed to. But after entering a string and hitting <Enter>, the
program just hangs there. I have to hit <Ctrl> + Z to get back to my
command prompt.
How come it isn't reversing my string like it's supposed to? What am I
not adding to the code that it's supposed to have? TIA for any help.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sun, 27 Jun 1999 04:58:15 GMT
From: Mike Dichirico <mdichirico@lamotionpictures.com>
Subject: "Learning Perl" exercises
Message-Id: <7l4b11$f3p$1@nnrp1.deja.com>
I'm reading "Learning Perl" and trying the exercises in them. I'm
using my Win98 computer as my platform.
On page 57, exercise #1, it says to wrte a program that reads a list of
strings on seperate lines and prints out the list in reverse order.
Appendix A of the book gives the following code as one of the possible
answers to the exercise:
print "Enter the list of strings:\n";
@list = <STDIN>;
@reverselist = reverse @list;
print @reverselist;
When I run the program, it asks for me to enter a string like it's
supposed to. But after hitting <Enter>, the program just hangs there.
I have to hit <Ctrl> + Z to get back to my command prompt.
How come it isn't reversing my string like it's supposed to? What am I
not adding to the code that it's supposed to have? TIA for any help.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sun, 27 Jun 1999 04:59:28 GMT
From: Mike Dichirico <mdichirico@lamotionpictures.com>
Subject: "Learning Perl" exercises
Message-Id: <7l4b3b$f48$1@nnrp1.deja.com>
I'm reading "Learning Perl" and trying the exercises in them. I'm
using my Win98 computer as my platform.
On page 57, exercise #1, it says to wrte a program that reads a list of
strings on seperate lines and prints out the list in reverse order.
Appendix A of the book gives the following code as one of the possible
answers to the exercise:
print "Enter the list of strings:\n";
@list = <STDIN>;
@reverselist = reverse @list;
print @reverselist;
When I run the program, it asks for me to enter a string like it's
supposed to. But after entering a string and hitting <Enter>, the
program just hangs there. I have to hit <Ctrl> + Z to get back to my
command prompt.
How come it isn't reversing my string like it's supposed to? What am I
not adding to the code that it's supposed to have? TIA for any help.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sun, 27 Jun 1999 04:59:02 GMT
From: Mike Dichirico <mdichirico@lamotionpictures.com>
Subject: "Learning Perl" exercises
Message-Id: <7l4b2h$f41$1@nnrp1.deja.com>
I'm reading "Learning Perl" and trying the exercises in them. I'm
using my Win98 computer as my platform.
On page 57, exercise #1, it says to wrte a program that reads a list of
strings on seperate lines and prints out the list in reverse order.
Appendix A of the book gives the following code as one of the possible
answers to the exercise:
print "Enter the list of strings:\n";
@list = <STDIN>;
@reverselist = reverse @list;
print @reverselist;
When I run the program, it asks for me to enter a string like it's
supposed to. But after entering a string and hitting <Enter>, the
program just hangs there. I have to hit <Ctrl> + Z to get back to my
command prompt.
How come it isn't reversing my string like it's supposed to? What am I
not adding to the code that it's supposed to have? TIA for any help.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sun, 27 Jun 1999 09:30:34 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: "Slurping" a .jpg file
Message-Id: <7l5clb$1r81@news.cyber.net.pk>
Whoops.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift
ICQ: 4265451
FAX: (815) 846-2877
Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
news:7l2gb5$26a$1@gellyfish.btinternet.com...
> On Sat, 26 Jun 1999 14:48:22 +0500 Faisal Nasim wrote:
> > Rich Campbell <rcampbel@gbtech.net> wrote in message
> > news:01bebf6c$26ca06e0$c5dfffcc@upstairs...
> >> I want to modify some of the internal stuff in a ".jpg" file:
> >>
> >> open(FD, "picture.jpg");
> >>
> >> undef $/;
> >>
> >> $file = <FD>;
> >>
> >> but no go (but it works fine for a .txt file)
> >>
> >
> >
> > open FILE , "blah.jpg";
> > binmode FILE;
> > $content = join '' , <FILE>;
> >
>
> I cant see any point in doing that join when the original poster had
> it right with the:
>
> undef $/;
>
> All that he was missing was the binmode().
>
> /J\
> --
> Jonathan Stowe <jns@gellyfish.com>
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
> Hastings:
<URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 23:21:32 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <m3so7efcbn.fsf@moiraine.dimensional.com>
zenin@bawdycaste.org writes:
> Daniel Grisinger <dgris@moiraine.dimensional.com> wrote:
> : Lately I've been using q() and qq() instead of '' or "". I've
> : even been using them in place of heredocs because I can avoid
> : the ugly left-justified end token.
> You mean like this?
> print <<" TheEnd";
> some text
> TheEnd
Yup. Except that this way is too fragile to be used in real
code.
It'll break if you ever enclose the section of code with
a for(@some_array){ } or an if ($some_condition){ } and
forget to change your heredoc statements to reflect the
changed indentation.
It'll break if your program is ever opened by someone with
a braindead editor that converts between tabs and spaces
automatically.
It'll break when the next guy who has to maintain your code
innocently changes your formatting.
Depending on whitespace seems to me to be a fairly dumb thing
to do.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: 26 Jun 1999 22:41:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Beginner's Question
Message-Id: <slrn7nb7am.npo.abigail@alexandra.delanet.com>
Erik Denkers (edenkers@ktis.net) wrote on MMCXXIV September MCMXCIII in
<URL:news:7l0kp5$pi3$1@dumber.ktis.net>:
\\ Thanks for quick reply John,
\\
\\ > One obvious benefit comes from being able to have references to
\\ > variables that don't have names. I can create a reference to an
\\ > array -- an anonymous array -- like this:
\\ >
\\ > $arrayref = [ 9, 42, 666 ];
\\ >
\\
\\ Don't think I'm dense but...
\\
\\ Array --- @myarray = (1,2,3)
\\
\\ Reference --- $myref = [1,2,3]
\\
\\ What is the difference, both contain same data, no?
Hmmm. If I put a blue jellybean, a leather sandal and a beercan in a
canvas bag, and I put a blue jellybean, a leather sandal and a beercan
in the fridge, does that make a fridge the same as a canvas bag, because
they contain the same?
\\ Doesn't @myarray[1] contain the same value as $myref[1] ???
No. @myarray[1] is a list of length 1, containing the value '2'.
$myref[1] is a scalar, the value of the second element of @myref,
an array of which we know nothing. (We are from Barcelona!)
Perhaps you meant $myarray [1] and $myarray -> [1]. Yes, they have the
same value, but a plastic storage bin isn't the same a glass cookie jar,
just because they both have chocolate chip cookies in them.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Jun 1999 22:49:04 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Capturing a Stop event from the Browser
Message-Id: <slrn7nb7ot.npo.abigail@alexandra.delanet.com>
mattm@sunbelt.nawcad.navy.mil (mattm@sunbelt.nawcad.navy.mil) wrote on
MMCXXII September MCMXCIII in <URL:news:7krb04$fd5$1@nnrp1.deja.com>:
\\ Is there any way for my cgi (Perl) script to capture when the user
\\ clicks the stop button? Currently when the user clicks the stop button,
\\ the Perl script keeps running, as well as the child processes it
\\ created. We have a Netscape Enterprise server running on a Sun
\\ Utlrasparc running solaris. I would like to be able to kill the process
\\ after the user clicks the stop button, but I'm not sure how... Any help
\\ would be appreciated. Thanks.
Look up in the manual of Netscape Enterprise how NE tells your program
that the user pressed the stop button.
If it doesn't, you're out of luck.
If it does, do whatever you need to listen to what NE has to say.
If you don't have a manual, call NE customer support and demand your
money back.
Abigail
--
perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 27 Jun 1999 05:05:42 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: CGI::Push Problem
Message-Id: <slrn7nbc4t.ps.efflandt@efflandt.xnet.com>
On Sun, 20 Jun 1999 22:08:50 +0200, Uwe W. Gehring
<gehring@politik.uni-mainz.de> wrote:
>
>I am testing server push with CGI::Push. While NS Comm. (4.x) is
>displaying my page correctly, IE (4.x, 5.x) does not. Instead, each new
>"page" is appended to the page before, seems IE is ignoring the boundary
>info.
This browser issue has nothing to do with Perl. MSIE may call itself
Mozilla, but that is a lie. Since MSIE ignores most headers, how do you
expect it to know anything about server push? So do you believe what they
told you about their webserver (fast, faultless, all that rubbish)?
>Server is IIS 4, Perl is Activestate Perl 5.
>
>Any help appreciated (can anyone point me to a newsgroup where cgi
>related topics are being discuss?).
How about a *.cgi newsgroup.
>P.S.: The page must be written to conform Comm. as IE (at least).
Client pull (refresh) is one solution that works for most browsers, even
MSIE and the obsolete Mosaic that it is based on. For more info, consult
an HTML FAQ or newsgroup.
--
David Efflandt efflandt@xnet.com http://www.xnet.com/~efflandt/
http://www.de-srv.com/ http://cgi-help.virtualave.net/
------------------------------
Date: Sun, 27 Jun 1999 00:02:22 -0500
From: Clinton Carr <ccarr@websocket.com>
Subject: check for NT process
Message-Id: <3775B05E.DA89CCE1@websocket.com>
Is there a way to check to see if a Win32 application is running?
Is there a way to kill a running Win32 application?
Thanks,
------------------------------
Date: Sun, 27 Jun 1999 05:05:05 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: Comparing two associative arrays
Message-Id: <3775afe5.211155670@news.nikoma.de>
On Sun, 27 Jun 1999 02:41:02 GMT, Rick Delaney <rick.delaney@home.com>
wrote:
>Andrew Allen wrote:
>>
>>
>> "@{[%hash1]}" eq "@{[%hash2]}"
>>
>> almost works (but can you explain why?).
>
>Nope, I give up. Can you? Would you?
Here's my attempt:
Andrew makes each hash into an array of key-value pairs by using it in
list context. The [] initialises an anonymous array with those
contents. This anonymous array is then dereferenced with @{...},
yielding an array, which is then stringified by the double quotes,
meaning the elements are pasted together with $" in between (usually a
single space; see perlvar for more). So you might get something
similar to:
"key1 value1 key2 value2" eq "key3 value3 key1 value1"
for different hashes.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.net>
------------------------------
Date: Sun, 27 Jun 1999 00:35:24 -0300
From: "pabl0" <pabl0@starmail.com>
Subject: Re: embedding perl question
Message-Id: <7l45g8$irn$1@ul3.satlink.com>
I got it, thanks.
------------------------------
Date: Sun, 27 Jun 1999 05:02:01 GMT
From: Mike Dichirico <mdichirico@lamotionpictures.com>
Subject: exercise question from "Learning Perl"
Message-Id: <7l4b83$f6e$1@nnrp1.deja.com>
I'm reading "Learning Perl" and trying the exercises in them. I'm
using my Win98 computer as my platform.
On page 57, exercise #1, it says to wrte a program that reads a list of
strings on seperate lines and prints out the list in reverse order.
Appendix A of the book gives the following code as one of the possible
answers to the exercise:
print "Enter the list of strings:\n";
@list = <STDIN>;
@reverselist = reverse @list;
print @reverselist;
When I run the program, it asks for me to enter a string like it's
supposed to. But after entering a string and hitting <Enter>, the
program just hangs there. I have to hit <Ctrl> + Z to get back to my
command prompt.
How come it isn't reversing my string like it's supposed to? What am I
not adding to the code that it's supposed to have? TIA for any help.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 26 Jun 1999 23:23:13 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: how do I save an MD5 checksum?
Message-Id: <slrn7nb9p6.npo.abigail@alexandra.delanet.com>
kev (kevin.porter@fast.no) wrote on MMCXXIV September MCMXCIII in
<URL:news:3773C33E.F419AEBD@fast.no>:
** I'm using an MD5 checksum to determine whether a web page has changed
** since my web client prog last visited it.
** The checksum can contain some weird characters which I'd like to escape
** before putting it in a file. What is the usual method for doing this?
The same way as you would do in C.
BTW, what kind of OS are you using that has problems with "weird"
characters in files?
Abigail
--
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 27 Jun 1999 00:09:06 -0500
From: Clinton Carr <ccarr@websocket.com>
Subject: Re: How to access MS Access using perl/cgi/unix
Message-Id: <3775B1F1.D8626579@websocket.com>
Check out www.websocket.com/products.html
Jonathan Stowe wrote:
> Olivier Maas <olivier.maas@at-lci.com> wrote:
> >
> >
> > Bruce Chao a icrit :
> >
> >> Hi,
> >>
> >> Is there any way that I can connect to MS Access
> >> from a Netscape Server on Unix platform using /Perl/Cgi???
> >>
> >> Thanks!
> >
> > Try that, but not sure...
> >
> > use Win32::OLE;
> > $application=Win32::OLE->new('Access.Application', 'Quit') || warn
> > "Impossible de créer un objet OLE";
> >
> >
>
> Not on Unix you dont ....
>
> /J\
> --
> "You don't watch the Eurovision Song Contest to hear good music" -
> Katrina Leskanich, Katrina and the Waves
------------------------------
Date: 26 Jun 1999 23:24:46 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to access MS Access using perl/cgi/unix
Message-Id: <slrn7nb9s0.npo.abigail@alexandra.delanet.com>
Olivier Maas (olivier.maas@at-lci.com) wrote on MMCXXIV September
MCMXCIII in <URL:news:377382A4.7E0DA5AF@at-lci.com>:
$$
$$
$$ Bruce Chao a icrit :
$$
$$ > Hi,
$$ >
$$ > Is there any way that I can connect to MS Access
$$ > from a Netscape Server on Unix platform using /Perl/Cgi???
$$ >
$$ > Thanks!
$$
$$ Try that, but not sure...
$$
$$ use Win32::OLE;
^^^^^ On a *Unix* platform?
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 27 Jun 1999 09:32:10 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: How to store hashes
Message-Id: <7l5co9$1r82@news.cyber.net.pk>
DB_File
AnyDBM_File
depricated dbmopen() dbmclose()
Read html help pages in your perl\html\lib directory.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift
ICQ: 4265451
FAX: (815) 846-2877
Timo Hummel <thummel@junior-net.de> wrote in message
news:377559E3.5CF8101F@junior-net.de...
> Hi,
>
> I want to store hashes in a file. What's the best way to do this? I'm
> fairly new to Perl, and I haven't found a good beginner document for
> perl yet (the documentation which came with ActiveState Perl for Win32
> is hard to use).
>
> Thanks for any help
> Timo
>
------------------------------
Date: Sun, 27 Jun 1999 05:04:26 GMT
From: Mike Dichirico <mdichirico@lamotionpictures.com>
Subject: Learning Perl exercises using reverse
Message-Id: <7l4bcj$f79$1@nnrp1.deja.com>
I'm reading "Learning Perl" and trying the exercises in them. I'm
using my Win98 computer as my platform.
On page 57, exercise #1, it says to wrte a program that reads a list of
strings on seperate lines and prints out the list in reverse order.
Appendix A of the book gives the following code as one of the possible
answers to the exercise:
print "Enter the list of strings:\n";
@list = <STDIN>;
@reverselist = reverse @list;
print @reverselist;
When I run the program, it asks for me to enter a string like it's
supposed to. But after entering a string and hitting <Enter>, the
program just hangs there. I have to hit <Ctrl> + Z to get back to my
command prompt.
How come it isn't reversing my string like it's supposed to? What am I
not adding to the code that it's supposed to have? TIA for any help.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 26 Jun 1999 23:29:23 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Need help with numbers and zeros
Message-Id: <slrn7nba4m.npo.abigail@alexandra.delanet.com>
Oliver Brown (oliver@admiralq.free-online.net) wrote on MMCXXV September
MCMXCIII in <URL:news:mY8d3.3485$BS6.2867@wards>:
== I need a random number from 1 to 120. But I need to add zeros to it to make
== it a three digit number
==
== e.g. 27 = 027 and 4 = 004
my $I_can_ask_on_usenet = 27 ;
my $I_can_also_look_in_the_faq = '000';
++ $I_can_also_look_in_the_faq while $I_can_ask_on_usenet --;
print $I_can_also_look_in_the_faq;
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Jun 1999 23:36:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Need Random Generator HELP!!
Message-Id: <slrn7nbait.npo.abigail@alexandra.delanet.com>
Joe Hamilton (jrhamilt@golay.csl.uiuc.edu) wrote on MMCXXII September
MCMXCIII in <URL:news:7kpfag$d1a$1@vixen.cso.uiuc.edu>:
\\
\\ In PERLFAQ4 there is a purported quote of John van Neumann:
\\
\\ "Anyone who attempts to generate random numbers by determinisic means is, of
\\ course, living in a state of sin."
\\
\\ I urgently need to find a reference for that quote. Can someone help me
\\ here?
In [Knuth] the quote is as follows:
Any one who considers arithmetical methods of producing random digits
is, of course, in a state of sin.
John Von Neumann, 1951.
Knuth: The Art of Computer Programming, Vol II, page 1.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 27 Jun 1999 00:03:37 -0400
From: Kevin McClaning <mckevin@erols.com>
Subject: NMake Dependency Generator
Message-Id: <3775A299.F791C607@erols.com>
Hi -
I'm looking for a Perl program that has probably all ready been written
by someone.
I'm new to Perl (just read "Perl for Dummies") so I'm quite the newbie
and don't
have the talent to write it myself yet. Besides, if it's all ready out
there ...
In a nutshell, I want to use Perl to parse through a .c file, find the
#include statements and
generate the file dependency list that I can then feed into NMake.
For example, I have a .c file that looks like
//******************************************************************
// FooMain.c
//
// Modifications:
//
// Last Edited: Sat 26-Jun-1999 11:50PM
/*******************************************************************
//* Include Files
*******************************************************
#include <foo1.h>
#include <foo2.h>
//*******************************************************************
... Subtle and useful c code here ..
//*******************************************************************
I pass the Perl program the name of the .c file and my include subdirs:
Perl MakeDeps FooMain.c ./inc ./clib ./dsp
and the Perl program generates
FooMain.c: foo1.h foo2.h
which is in the proper format to feed into NMake. I want to run this
program
every time I run NMake to update the dependency list directly from the
input files.
This seems to be a fairly common programming task and it seems like
someone
would all ready have invented this wheel. Any URLs??
Thx ..
Kevin
------------------------------
Date: Sun, 27 Jun 1999 05:35:49 GMT
From: laar@ix.netcom.com (Laar)
Subject: offline testing of Perl/CGI's
Message-Id: <3775b811.86772142@nntp.ix.netcom.com>
Hello all,
I read everything twice looking for an answer to this -- anyone who
can point me in the direction of the answer will be blessed with my
eternal gratitude... and stuff...
I'm writing a bunch of CGI scripts (in Perl) for handling a fairly
complex set of databases. The scripts will be running on my ISP's
server, and most of the hours of the day I can't be online to write,
upload, test and debug the scripts on their system. My main problem is
getting the code right (rookie Perl scripter that I am), and my life
would become meaningful and filled with pleasure if I could just run
the scripts on my own machine (W95 laptop, Perl 5.005, Netscape 4) via
a web browser, interacting with the scripts the same way I would
online.
--> Problem: I've tried everything, but I can't seem to get the HTML
doc to call the script properly. First, regardless of whether I
specify the GET or POST method in the HTML form, the form seems to try
to pass the data to the script with POST, and it invariably fails.
Both the HTML pages and the scripts I'm trying to test are in c:\perl\
and I've tried every possible combination of fixes (that I can think
of) from both the HTML and script sides, and at best, the browser
tries to download the script (as if downloading a file from on line)
instead of execute it.
Any ideas? Somebody? Please?
--
Laar
www.netcom.com/~laar/index.html
------------------------------
Date: Sun, 27 Jun 1999 06:03:20 GMT
From: laar@ix.netcom.com (Laar)
Subject: Re: offline testing of Perl/CGI's
Message-Id: <3775bdc5.88232365@nntp.ix.netcom.com>
Ah, wait, progress... sort of...
I can now cause a perl script to execute by clicking the "Submit"
button on an HTML form, but instead of the script's output going to
the browser, a DOS window opens and the script's output appears there.
So, I guess the question is: Is there some basic setup thing I'm
missing to get the script to send its output to the browser instead of
a DOS window?
--
Laar
www.netcom.com/~laar/index.html
------------------------------
Date: 26 Jun 1999 23:40:06 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl utility
Message-Id: <slrn7nbaoo.npo.abigail@alexandra.delanet.com>
pandey@my-deja.com (pandey@my-deja.com) wrote on MMCXXIV September
MCMXCIII in <URL:news:7l065p$6l1$1@nnrp1.deja.com>:
"" Hi,
"" I am writing a perl utility that scans mails for
"" some user specified conditions. It scans for keywords
"" and FROM conditions etc. It then filters out the
"" mails to some directory. Is this possible in Perl.
Perhaps, but that depends on what the "user specified conditions" can be.
"" Can somebody point out how to do this.
Basically the same as in any other language, but just encoded in Perl idiom.
Come back if you have some specific question; we don't produce programs here.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Jun 1999 23:33:01 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Safe expression evaluation
Message-Id: <m3n1xmfbsi.fsf@moiraine.dimensional.com>
abigail@delanet.com (Abigail) writes:
> Bart Lateur (bart.lateur@skynet.be) wrote on MMCXXIII September MCMXCIII
> in <URL:news:37798e98.4068129@news.skynet.be>:
> __ Tom Christiansen wrote:
> __
> __ >--
> __ >If you want to see useful Perl examples, we can certainly arrange to have
> __ >comp.lang.misc flooded with them, but I don't think that would help the
> __ >advance of civilization. :-) --Larry Wall in <1992Mar5.180926.19041@netlabs.com>
> __
> __ "comp.lang.misc"?
>
>
> Take a popsicle if you can figure out the meaning of the leading 4 digits
> in the message ID.
That Larry is still posting to Usenet in the year 3892?
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Sun, 27 Jun 1999 01:50:38 -0400
From: Jeremy James <jjames@atlantic.net>
Subject: Re: separate file
Message-Id: <3775BBAE.C11F2521@atlantic.net>
Leonid Goltser wrote:
> I tried to use several files for my program. I use
> "require "filename";
>
> but I got message that says that structure does not return true.
> What does it mean and how to fix it?
Just make sure the file you are "require"ing all end with a
1
on the very last line
------------------------------
Date: 26 Jun 1999 23:43:42 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: syntax check without execution
Message-Id: <slrn7nbav2.npo.abigail@alexandra.delanet.com>
Greg Bartels (gbartels@xli.com) wrote on MMCXXIV September MCMXCIII in
<URL:news:3773987C.EA5197A0@xli.com>:
() is there a way to syntax check a file
() with perl code in it without actually
() executing it.
Is there something about the manual that scares you?
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 27 Jun 1999 00:01:31 -0400
From: "Doug Crabtree" <not@gonna.tell>
Subject: Trying to install Win32 Server ... error message...
Message-Id: <7l47k9$1g7$1@nntp8.atl.mindspring.net>
I followed all of the instructions to install Perl5 on my system. Every
time I try to run a script through my browser on our LAN, I get the
following message:
One of the library files needed to run this application cannot be found.
This even does this on a simple script to print out "Hello, World."
<original, huh?> If I do this running perl.exe myself, it works. Why do I
get this error message? I am thinking it has something to do with the
registry...
Does anybody know where I can go from here?
I am running Win98 with Microsoft's Personal Web Server.
TIA,
Doug
------------------------------
Date: Sun, 27 Jun 1999 01:52:43 -0400
From: "Doug Crabtree" <not@gonna.tell>
Subject: Re: Trying to install Win32 Server ... error message...
Message-Id: <7l4eb2$ejr$1@nntp9.atl.mindspring.net>
Ok, I reinstalled everything and it seems to work. Some more problems...
1. Whenever I run a .pl file it hangs up my server (I can kill the perl.exe
process and I get a CGI error message).
2. If I rename that .pl file to a .plx file (to use PerlIS.dll) it works
perfect.
3. I removed all references to perl.exe in the system registry for .pl and
replaced it with perlis.dll. It still calls perl.exe and still hangs.
Why does it hang with .pl files?
Why does .plx work (dll v. exe)
Why does it still point to exe now that I have changed it to use .dll?
TIA,
Doug
------------------------------
Date: Sun, 27 Jun 1999 05:02:38 GMT
From: Mike Dichirico <mdichirico@lamotionpictures.com>
Subject: using reverse in Learning Perl book
Message-Id: <7l4b98$f6j$1@nnrp1.deja.com>
I'm reading "Learning Perl" and trying the exercises in them. I'm
using my Win98 computer as my platform.
On page 57, exercise #1, it says to wrte a program that reads a list of
strings on seperate lines and prints out the list in reverse order.
Appendix A of the book gives the following code as one of the possible
answers to the exercise:
print "Enter the list of strings:\n";
@list = <STDIN>;
@reverselist = reverse @list;
print @reverselist;
When I run the program, it asks for me to enter a string like it's
supposed to. But after entering a string and hitting <Enter>, the
program just hangs there. I have to hit <Ctrl> + Z to get back to my
command prompt.
How come it isn't reversing my string like it's supposed to? What am I
not adding to the code that it's supposed to have? TIA for any help.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sat, 26 Jun 1999 21:03:37 -0700
From: jik- <jik@foxinternet.net>
Subject: Re: Viral matters [completely off-topic]
Message-Id: <3775A299.90962B4@foxinternet.net>
> I wasn't aware of that functionality of PGP. Is it only 5.0 that
> refuses to sign files that contain viri, or does 2.6.x have that
> functionality as well?
1. Use GnuPG please.
2. The signature verifies who made the package only. Then if its a
Virus you publicly humiliate the person...issue the key to everyone you
see telling them this is a BAD key.
3. Install only packages your reasonably sure came from a valid
source....signatures make this easier.
------------------------------
Date: Sun, 27 Jun 1999 05:19:53 GMT
From: laar@ix.netcom.com (Laar)
Subject: weirdness with Netcom
Message-Id: <3775b239.85276585@nntp.ix.netcom.com>
Maybe it's something I'm doing wrong, but I doubt it...
I'm writing and uploading some fairly simple Perl CGI's to my
/cgi-bin/ directory on my Netcom account. Not too many months ago this
seemed to work without a whole lot of drama, aside from the fact that
I'm a total newbie to Perl and had the usual learning-curve problems.
Problem: I'm going through the write --> upload --> test --> debug -->
upload again ... cycle, and when I upload a new version of a script,
the upload just seems to corrupt the existing script rather than
replace it. FWIW, the same thing was happening with HTML docs -- the
code got very slightly mangled rather than replaced. With HTML, it's
really annoying, but with Perl scripts, it's fatal. When I totally
delete the old files before uploading the new ones, it seems to work
fine (assuming *I* did my part write, which occasionally happens).
Any idea why an FTP upload would corrupt a file rather than replace
it? I'm especially keen to whether this may be a temporary bug
something inherently unreliable with their setup. (BTW, yes, I've
asked them for tech support in the past, which has been shaky at best,
hence the inquiry here.)
--
Laar
www.netcom.com/~laar/index.html
------------------------------
Date: Sat, 26 Jun 1999 19:00:26 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: wwwboard on webjump.com
Message-Id: <377585BA.1BEAA5AE@chatbase.com>
luvencl@my-deja.com wrote:
>
> I am looking for help with placing wwwboard on the webjump.com server.
> I followed all instructions, but I get:
> CGI Script Error
> An error has occurred in processing your CGI script.
> This indicates the error is not the result of a server malfunction.
> Please review your CGI scripts.
>
> Anyone have any experience with this?
> Your help would be appreciated..
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
You'd be better off asking this in the proper place. Have you checked
with the place you got the script from to see if they have any help
pages or message boards for people helping each other when installing
them?
--
Regards,
Tim Greer : webmaster@chatbase.com | software@linkworm.com
The ChatBase: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripts in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, +Sciences.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 6141
**************************************