[15890] in Perl-Users-Digest
Perl-Users Digest, Issue: 3303 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 9 14:06:18 2000
Date: Fri, 9 Jun 2000 11:05:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <960573916-v9-i3303@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 9 Jun 2000 Volume: 9 Number: 3303
Today's topics:
Re: Anoymous hash slices <tcuffel@exactis.com>
Re: Capturing frames <abe@ztreet.demon.nl>
Re: Chomp problem <bill.kemp@wire2.com>
Re: Compile my Perl scripts? (Mark Badolato)
Re: Encrypting / decrypting. <godzilla@stomp.stomp.tokyo>
Re: Encrypting / decrypting. <care227@attglobal.net>
Re: Encrypting / decrypting. <godzilla@stomp.stomp.tokyo>
Re: Encrypting / decrypting. <care227@attglobal.net>
Re: Encrypting / decrypting. (Brandon Metcalf)
file date parse routine <bronsn@hotmail.com>
Re: form to mail script.. <gellyfish@gellyfish.com>
Re: form to mail script.. <care227@attglobal.net>
Re: form to mail script.. <nospam@nospam.com>
Re: GCI using Java? <gellyfish@gellyfish.com>
Re: Help with a simple regular expression <abe@ztreet.demon.nl>
Re: Help with a simple regular expression <blah@nospam.com>
Re: Help with a simple regular expression <lr@hpl.hp.com>
Re: Help: OOPS Inheritance... (Abigail)
Re: How to turn off "Deep recursion" warnings? (Abigail)
Re: How to turn off "Deep recursion" warnings? (Gwyn Judd)
Re: Larry Rosler interview on perl.com! <aqumsieh@hyperchip.com>
Re: Linux/Perl classes <care227@attglobal.net>
Re: logarithms <xavier.tardy@alcatel.fr>
Net::FTP login problem ogiven@vertex.ucls.uchicago.edu
Re: No offense but Larry Wall should do the maths !! <aqumsieh@hyperchip.com>
Re: No offense but Larry Wall should do the maths !! <lr@hpl.hp.com>
Re: No offense but Larry Wall should do the maths !! (Abigail)
Re: No offense but Larry Wall should do the maths !! (Gwyn Judd)
Re: obfuscating script for security of distributed code hadleyr@hotmail.com
Perl Make problem <davewang@wam.umd.edu.invalid>
Re: please help <helza@planet.nl>
Re: Q: Perl Editor for linux? (Stuart Krivis)
RSA simple encrypt-decrypt <ekker@hot.ee>
Re: site_perl vs lib <nospam@nospam.com>
Re: Spaces (Bart Lateur)
Re: Splitting a Text String (Andrew Johnson)
Re: Splitting a Text String <abe@ztreet.demon.nl>
Re: Splitting a Text String (Neil Kandalgaonkar)
Re: Splitting a Text String (Neil Kandalgaonkar)
UX Zombie/Defunct Processes After fork() <bill_border@agilent.com>
Re: windows -> perl = no longer work <ab@cd.com>
Re: windows -> perl = no longer work <ab@cd.com>
Re: windows -> perl = no longer work <ab@cd.com>
Windows Installer error <pjstoNOpjSPAM@hotmail.com.invalid>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 9 Jun 2000 09:48:58 -0500
From: "Tim" <tcuffel@exactis.com>
Subject: Re: Anoymous hash slices
Message-Id: <C4805.8830$Rx.829444@den-news1.rmi.net>
>How about this?
>
> @array = map sub { { cost => $_[0], flavor => $_[1], texture => $_[2] } }
> ->(split /\|/), @lines;
Very clever.
But, all things considered, I think I am going to stick with my for loop. :)
-T
------------------------------
Date: Fri, 09 Jun 2000 17:22:33 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Capturing frames
Message-Id: <ue22kssmph0ob5sbvgrrl1jt557cgl56qb@4ax.com>
On Fri, 09 Jun 2000 14:19:22 GMT, newbie@db-networks.com wrote:
> On 8 Jun 2000 23:58:34 GMT, ebohlman@netcom.com (Eric Bohlman) wrote:
...
>
> |For a framed page, that will give you the content of the frameset
> |document. You'll have to parse that, using something like
> |HTML::TokeParser, to get the URLs to the individual content pages and
> |then retrieve each of them.
>
> When I type the address and error web page stating that they only
> support browsers with frames. There is nothing to parse. Is there an
> updated librairy of LWP::UserAgent or another one?
Look at the 'lwpcook' man page for the way you could make the server
believe you are (your program is) Mozilla. (I wouldn't try 8 though,
this is probably IIS with that _very_ broken browscap.ini thing)
--
Good luck,
Abe
------------------------------
Date: Fri, 9 Jun 2000 16:26:09 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: Chomp problem
Message-Id: <960564476.10146.0.nnrp-01.c3ad6973@news.demon.co.uk>
>crufy
sorry for wastin spce- but pls define the above if it isn't a typo
------------------------------
Date: 9 Jun 2000 17:28:39 GMT
From: mbadolato@quepasa.com (Mark Badolato)
Subject: Re: Compile my Perl scripts?
Message-Id: <8F4E63CFFmbadolatoquepasacom@206.165.3.80>
ctcato@aic-links.com (Casey Cato) wrote in
<7_505.4434$Q7.175707@news-east.usenetserver.com>:
>I am confused as to how to compile all the various
>(eight) .PL files into some type of .exe. The README file only seems
>to give instruction on compiling a single script into an executable.
perldoc perlfaq3
--mark
------------------------------
Date: Fri, 09 Jun 2000 09:06:48 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Encrypting / decrypting.
Message-Id: <39411618.13BCBABC@stomp.stomp.tokyo>
"Randal L. Schwartz" wrote:
> >>>>> "Godzilla!" == Godzilla! <godzilla@stomp.stomp.tokyo> writes:
> Godzilla!> each line performing one simple function. You
> Godzilla!> are the big boy of Perl. Wouldn't be proper
> Godzilla!> for a little girl of Perl to leave alligator
> Godzilla!> teeth marks in your ego, right?
> 1) I don't personally do de-crypto - it's not my area of expertise. I
> leave that to experts, which I have on-call as needed.
> 2) You don't get 24 hours of my time for free. If you're willing to
> discuss the purchase of the time (including the subcontracting
> fees), please call my office below.
> So I reject your challenge. Which does nothing to make my original
> claim any less right (that you had a trivial encryption) since you've
> done nothing to challenge *that* yet.
Would you like a big Fred Flintstone Band-Aid
for your ego, Randal?
Warned you not to try comparing apples and
alligators with me. I bite.
Kira
------------------------------
Date: Fri, 09 Jun 2000 12:46:46 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Encrypting / decrypting.
Message-Id: <39411F76.A6F42A42@attglobal.net>
"Godzilla!" wrote:
> I bite.
>
> Kira
Wow! The first true words from this one.
You sure do.
------------------------------
Date: Fri, 09 Jun 2000 09:53:23 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Encrypting / decrypting.
Message-Id: <39412103.516A6E18@stomp.stomp.tokyo>
Matt King wrote:
> Hi, I like your example, however, it just doesn't give
> me the output I need/want. Using your script, I converted
> 11 and got 31311. I would like it better if that was shown
> in a hex number (like AF for example). I have tried making
> some changes to script to get that, but I have yet to get
> it working. Can you help me out with that (also the decoder
> needs to work the same, but in reverse)?
> > How complicated you make this is only limited
> > by your imagination and how much work you are
> > willing to give this methodology.
Roll up your sleeves and get to work.
Don't take this comment to be rude. It really
isn't meant to be Matt. I mean this sincerely.
Many here know I am a well seasoned and well
educated teacher and professor of English. Early
on, I quickly learned a student does not benefit
one bit when a teacher presents no challenge.
Most students bemoan homework and hard work.
Those students up to these challenges, those
students who accept a teacher's challenges,
often comment, "I really learned a lot."
You will learn a lot more and, you will garnish
much personal pride, in figuring this out all
on your own. So roll up your sleeves and get
to work. Later, you will be pleased you did.
Don't think me rude. I would rather learn you have
worked hard at this and have learned along the way.
We will both be rewarded by learning something of
great personal value and pride.
So roll up your sleeves and get to work writing
powerful Perl 4 alligator code which leading
foremost experts in Perl, cannot easily crack,
even with a copy of the encryption code, in hand.
Godzilla!
------------------------------
Date: Fri, 09 Jun 2000 12:58:24 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Encrypting / decrypting.
Message-Id: <39412230.20880027@attglobal.net>
"Godzilla!" wrote:
>
> Read what others have to say about this
> man you worship, genuflect before and lick
> his jack boots. Most fascinating thread,
> yes indeed.
I rather prefer the dozens of posts calling you a loon.
------------------------------
Date: 9 Jun 2000 17:40:06 GMT
From: bmetcalf@baynetworks.com (Brandon Metcalf)
Subject: Re: Encrypting / decrypting.
Message-Id: <8hra5m$ap$1@spinner.corpeast.baynetworks.com>
godzilla@stomp.stomp.tokyo writes:
> You will learn a lot more and, you will garnish
> much personal pride, in figuring this out all
> on your own. So roll up your sleeves and get
> to work. Later, you will be pleased you did.
>
> Don't think me rude. I would rather learn you have
> worked hard at this and have learned along the way.
> We will both be rewarded by learning something of
> great personal value and pride.
Oh, I'm getting warm fuzzy feelings all over.
> So roll up your sleeves and get to work writing
> powerful Perl 4 alligator code which leading
> foremost experts in Perl, cannot easily crack,
> even with a copy of the encryption code, in hand.
Whatever.
Brandon
------------------------------
Date: Fri, 9 Jun 2000 10:46:02 -0700
From: "Firehawk" <bronsn@hotmail.com>
Subject: file date parse routine
Message-Id: <8hrad7$fgo@news.or.intel.com>
All,
I've read the online documentation and the camel book looking for a way to
pull files by date from a specific directory. I know it's there staring at
me, but I can't figure out where to look for the answer. Any help would be
GREATLY appreciated!
Thanks
------------------------------
Date: 9 Jun 2000 12:37:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: form to mail script..
Message-Id: <8hqkt2$es3$1@orpheus.gellyfish.com>
On Thu, 08 Jun 2000 17:30:48 -0400 Drew Simonis wrote:
>
> Im kinda unsure about why I see the author "Un-Webify plus signs
> and %-encoding" 3 times. That just seems odd.
Its a sure sign that this has been cut and pasted from the ancestral
cargo - this is seen as a magic incantation in these circles and is
neccessary for the code to work properly. Do a search for that phrase
on altavista or google and you will find all of the relatives of this
piece of code.
/J\
--
fortune oscar homer
------------------------------
Date: Fri, 09 Jun 2000 12:23:24 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: form to mail script..
Message-Id: <394119FC.E3AC6A77@attglobal.net>
The WebDragon wrote:
> | is bad. Better would have been to use something like Email::Valid,
> | but even that has numerous pitfalls. But, since we only want to
> | check to make sure we aren't passing shell escapes to sendmail,
> | the usage of a validity check is warranted.
>
> I can't help but think it would be simpler to use some sort of Net::SMTP
> module or something for this instead. (now that I'm aware of such things
> :D )
Well, Net::SMTP would be used to send the message, this bit is
checking for a valid email address format, but it fails at that.
The reason to do this is that nasty folks can pass shell escapes
to sendmail, making it do all sorts of unexpected (to the author)
things. But, that regexp falls short, and would exclude some
valid formats for an email address (per the RFC).
As far as cargo-cult programming, I was pointed to this page when
I recently asked the same question as you:
http://www.jargon.net/jargonfile/c/cargocultprogramming.html
------------------------------
Date: 9 Jun 2000 17:57:52 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: form to mail script..
Message-Id: <8hrb70$4ob$1@216.155.32.44>
In article <394119FC.E3AC6A77@attglobal.net>, Drew Simonis
<care227@attglobal.net> wrote:
| As far as cargo-cult programming, I was pointed to this page when
| I recently asked the same question as you:
|
| http://www.jargon.net/jargonfile/c/cargocultprogramming.html
Ahh I remember where I first came across this ... in a Doc Savage book
by Kenneth Robeson, a looooooooooooooong time ago. Can't remember which
story though :/
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: 9 Jun 2000 12:41:35 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: GCI using Java?
Message-Id: <8hql5f$esi$1@orpheus.gellyfish.com>
On Thu, 08 Jun 2000 17:30:04 GMT Lawrence wrote:
>
> I know that we can use many language for CGI program, such as C, Perl
> and so on. Does Java is a good choice? What is the pros and cons of
> using Java as the CGI program. p.s. I have to decide what kind of
> language I have to learn.
>
Some comp.lang.java.* group would be a more appropriate venue for this
question as there is no Perl content here. It is not your fault that
help.com arranges things so people dont actually know they are posting
to a Usenet newsgroup but I would recommend that you use a proper news
reader or even, heaven forfend, Deja News.
/J\
--
fortune oscar homer
------------------------------
Date: Fri, 09 Jun 2000 17:05:44 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Help with a simple regular expression
Message-Id: <qr12kss0ignllc8kr59vbeorcmolcddi3v@4ax.com>
On Fri, 09 Jun 2000 16:42:44 +0200, Marco Natoni <blah@nospam.com>
wrote:
> Tad,
>
> Tad McClellan wrote:
> > "Perl" is used to refer to the language proper.
> > "perl" is used to refer to the implementation of the language,
> > (the interpreter).
> > "PERL" is not used.
>
> Is that codified or just a current use? Many language or system names
> being acronyms are referred in all uppercase (such as MVS, sometimes
> FORTRAN...).
>
> Of course, with many keyboards writing Perl is more lazy than writing
> PERL, so is also more relating to its philosophy... ;)
perldoc perlfaq1
What's the difference between "perl" and "Perl"?
--
Good luck,
Abe
------------------------------
Date: Fri, 09 Jun 2000 17:19:34 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: Help with a simple regular expression
Message-Id: <39410B06.E01E0F13@nospam.com>
Abe,
Abe Timmerman wrote:
>>> "Perl" is used to refer to the language proper.
>>> "perl" is used to refer to the implementation of the language,
>>> (the interpreter).
>>> "PERL" is not used.
>> Is that codified or just a current use? Many language or
>> system names being acronyms are referred in all uppercase (such
>> as MVS, sometimes FORTRAN...).
> perldoc perlfaq1 What's the difference between "perl" and "Perl"?
Terrific... :)
Best regards,
Marco
------------------------------
Date: Fri, 9 Jun 2000 08:30:57 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Help with a simple regular expression
Message-Id: <MPG.13aaad8984fbad8b98ab57@nntp.hpl.hp.com>
In article <39410264.E806656C@nospam.com>, blah@nospam.com says...
> Tad,
>
> Tad McClellan wrote:
> > "Perl" is used to refer to the language proper.
> > "perl" is used to refer to the implementation of the language,
> > (the interpreter).
> > "PERL" is not used.
>
> Is that codified or just a current use? Many language or system names
> being acronyms are referred in all uppercase (such as MVS, sometimes
> FORTRAN...).
With time, if pronounceable these become ordinary proper nouns, not
acronyms. So Fortran, etc.
> Of course, with many keyboards writing Perl is more lazy than writing
> PERL, so is also more relating to its philosophy... ;)
perlfaq1: "What's the difference between ``perl'' and ``Perl''?"
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 9 Jun 2000 16:18:54 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: Help: OOPS Inheritance...
Message-Id: <8hr5de$fe1$2@news.panix.com>
On 09 Jun 2000 13:24:23 +0200, Gisle Aas <gisle@ActiveState.com> wrote:
++
++ It is generally a bad idea to inherit from Exporter when you write a
++ OO module.
Why?
Abigail
------------------------------
Date: 9 Jun 2000 16:17:12 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: How to turn off "Deep recursion" warnings?
Message-Id: <8hr5a7$fe1$1@news.panix.com>
On Fri, 09 Jun 2000 05:04:56 GMT, Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:
++ I was shocked! How could Abigail <abigail@arena-i.com>
++ say such a terrible thing:
++ >On Thu, 8 Jun 2000 14:00:23 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
++ >++ In article <slrn8jvlc7.r67.tjla@thislove.dyndns.org> on Thu, 08 Jun 2000
++ >++ 17:16:36 GMT, Gwyn Judd <tjla@guvfybir.qlaqaf.bet> says...
++ >++
++ >++ ...
++ >++
++ >++ > If you call this with (say) arguments 3,8 then you get hundreds and
++ >++ > hundreds of "Deep recursion..." warnings. Is there any way to turn these
++ >++ > off for a situation like this when you know the algorithm terminates?
++ >++
++ >++ $SIG{__WARN__} = sub { };
++ >
++ >Or:
++ >
++ > no warnings 'recursion';
++ >
++ >which can be localized to the sub.
++
++ hmm I tried this just now in my Benchmark'ed version I still got the
++ warnings, whereas Larry's version hid them. Why was that?
Hard to tell without code....
Abigail
------------------------------
Date: Fri, 09 Jun 2000 17:54:07 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: How to turn off "Deep recursion" warnings?
Message-Id: <slrn8k2bun.1dt.tjla@thislove.dyndns.org>
I was shocked! How could Abigail <abigail@arena-i.com>
say such a terrible thing:
>++ hmm I tried this just now in my Benchmark'ed version I still got the
>++ warnings, whereas Larry's version hid them. Why was that?
>
>
>Hard to tell without code....
...follows
--
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
Time and tide wait for no man.
------------------------------
Date: Fri, 09 Jun 2000 17:53:37 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <7azooubv1a.fsf@merlin.hyperchip.com>
Dan Sugalski <dan@tuatha.sidhe.org> writes:
> Ah, ya caught me. :) Can't think of a good place to stick in a use of
> rand, alas. Maybe in the memory allocation code...
I always had the impression that a rand() was stealthily used by perl
behind the scenes every time it encountered something like:
*{"${foreign_package}::$foreign_sub"} = \&{"${my_package}::$my_sub"};
;-)
--Ala
------------------------------
Date: Fri, 09 Jun 2000 11:12:54 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Linux/Perl classes
Message-Id: <39410976.50EF4157@attglobal.net>
"David H. Adler" wrote:
>
> On Thu, 08 Jun 2000 08:31:18 -0400, Drew Simonis
> <care227@attglobal.net> wrote:
>
> > Brian D. Foy.
>
> Ahem.
>
I thought I'd get that. Alas, I couldn't get the proper font,
so I defaulted to standard english capitalization.
------------------------------
Date: Fri, 09 Jun 2000 18:12:24 +0200
From: Xavier Tardy <xavier.tardy@alcatel.fr>
To: Sundar <cybertoast@nopoop.mindless.com>
Subject: Re: logarithms
Message-Id: <39411768.EC92680C@alcatel.fr>
Sundar wrote:
> The perl function log() is actually a natural log (base e). Is there
> some way to get a base 10 log (a mathematical log, as opposed to ln)? I
> looked at the Math modules, but don't see anything obvious - maybe I
> missed something?
>
> Thanks much.
Remember that
for every suitable x,a & b
log_base_a(x) = log_base_b(x) / log_base_b(a)
Xavier
------------------------------
Date: Fri, 09 Jun 2000 15:18:40 GMT
From: ogiven@vertex.ucls.uchicago.edu
Subject: Net::FTP login problem
Message-Id: <8hr1rt$20f$1@nnrp1.deja.com>
i'm pulling the username,password for a Net::FTP -> login from a
database.....and although getting the hostname this way works fine, it
breaks the login process......
when i do it like this, it works:
$username='user';
$password='password';
$ftp = Net::FTP->new($hostname);
$ftp->login($username, $password);
but like this, it doesn't:
$statement="SELECT username, password FROM databasetable'";
$sth=$dbh->prepare($statement);
$sth->execute;
($username,$password) = $sth->fetchrow;
$ftp = Net::FTP->new($hostname);
$ftp->login($username, $password);
even though $username, $password print out exactly the same in both
cases.........i've not been able to find any relevant info in the module
docs or on usenet.....so, any suggestions would be much appreciated.....
thanks,
olivia
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 09 Jun 2000 15:05:59 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <7a66ridhd3.fsf@merlin.hyperchip.com>
"TheEx0rcist" <TheEx0rcist@fanclub.org> writes:
> Why isn't "print int(rand*3)" the same as "print int(3*rand)" ??? Isn't
> multiplication supposed to be _always_ commutative?
Apparently, you're new to programming in general.
% perl -le 'print int(3*rand)'
2
% perl -le 'print int(rand()*3)'
2
--Ala
------------------------------
Date: Fri, 9 Jun 2000 09:12:41 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <MPG.13aab75684eaf5de98ab58@nntp.hpl.hp.com>
In article <960551204.4745.0.nnrp-01.c3ad6973@news.demon.co.uk>,
bill.kemp@wire2.com says...
> <snip>
>
> > > Hint for the truly lazy: Try it again with rand() instead of just rand.
>
> I find my code has more brackets in it than the code I see elsewhere.
> I think style comments say that's OK if you feel like it. (and (rand()*3))
> works)
And rand*3 doesn't work.
> Would I be saved from other unusual featurees with my bracket fetish?
> Is there any real penalty from over-use of brakets?
So far as I know, all you will suffer is disapproving glances from Perl
Golfers.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 9 Jun 2000 16:59:36 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <8hr7po$g9o$1@news.panix.com>
On Fri, 9 Jun 2000 02:02:52 +0200, TheEx0rcist <TheEx0rcist@fanclub.org> wrote:
++ Why isn't "print int(rand*3)" the same as "print int(3*rand)" ??? Isn't
++ multiplication supposed to be _always_ commutative?
Sure, multiplication is supposed to be commutative.
But "rand*3" isn't a multiplication. It's "rand" called with the
argument "*3", which is a typeglob.
And of course, had you used -w, you wouldn't have had the need to ask
this question here - Perl would have told you what was wrong.
Abigail
------------------------------
Date: Fri, 09 Jun 2000 18:03:48 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <slrn8k2cgt.1dt.tjla@thislove.dyndns.org>
I was shocked! How could Ala Qumsieh <aqumsieh@hyperchip.com>
say such a terrible thing:
>
>"TheEx0rcist" <TheEx0rcist@fanclub.org> writes:
>
>> Why isn't "print int(rand*3)" the same as "print int(3*rand)" ??? Isn't
>> multiplication supposed to be _always_ commutative?
>
>Apparently, you're new to programming in general.
>
> % perl -le 'print int(3*rand)'
> 2
> % perl -le 'print int(rand()*3)'
> 2
not quite. The original poster wasn't asking about the difference
between "3*rand" and "rand()*3". The OP was asking about the difference
between "3*rand" and "rand*3". See the difference?
--
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
Yet more fun with UNIX #114: $ cat "food in cans" cat: cannot open food in cans
------------------------------
Date: Fri, 09 Jun 2000 16:22:49 GMT
From: hadleyr@hotmail.com
Subject: Re: obfuscating script for security of distributed code
Message-Id: <8hr5k6$4u1$1@nnrp1.deja.com>
In article <slrn8k1at1.4i7.eric@plum.fruitcom.com>,
eric@fruitcom.com wrote:
>
> (second attempt)
>
> I have been unable to locate a code obfuscating script tat I know is
out
> there. For removing white space, changing variable names, whatever.
>
> The purpose is to discourage tampering or backward engineering of
> distributed code. We have given up comiling our code which previously
> served this purpose.
>
> thanx for any response.
> --
> Eric Smith
> eric@fruitcom.com
>
Eric,
I don't know of this script your looking for. However, the Source
Filters on CPAN achieve the same goal and work well.
Richard
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 9 Jun 2000 17:37:21 GMT
From: "David T. Wang" <davewang@wam.umd.edu.invalid>
Subject: Perl Make problem
Message-Id: <8hra0h$gem$1@hecate.umd.edu>
I am having some problem with Installing Perl, and here is a description
of the problem..
I am attempting to compile Perl-5.6.0 on a Compaq/Dec box with an Alpha
21264 sitting in it. OSF/V4.0
I run the standard `sh Configure -de`
then make, which then dies with the message
-----------------------------------------------------------------------------
ld -shared -expect_unresolved "*" -O4 -msym -std -s -L/usr/local/lib -o
libperl.so perl.o malloc.o gv.o toke.o perly.o op.o regcomp.o dump.o util.o
mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o
doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o
perlio.o perlapi.o
ld: unrecognised emulation mode: sym
Supported emulations: alpha
make: *** [libperl.so] Error 1
------------------------------------------------------------------------------
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
Platform:
osname=dec_osf, osvers=4.0, archname=alpha-dec_osf
uname='osf1 lunkwill.sca.umd.edu v4.0 1229 alpha '
config_args='-de'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=unde
f
useperlio=undef d_sfio=undef uselargefiles=define
use64bitint=define use64bitall=define uselongdouble=undef usesocks=undef
Compiler:
cppflags='-std -ieee -D_INTRINSICS -I/usr/local/include -DLANGUAGE_C'
ccflags ='-std -fprm d -ieee -D_INTRINSICS -I/usr/local/include -DLANGUAGE_C stdchar='unsigned char', d_stdstdio=define, usevfork=false
intsize=4, longsize=8, ptrsize=8, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='ld', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /var/shlib
libs=-lbind -ldbm -ldb -lm -liconv
libc=/usr/shlib/libc.so, so=so, useshrplib=true, libperl=libperl.so
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-rpath,/usr/local/lib/perl5/5.6.0/alpha-dec_osf/CORE'
cccdlflags=' ', lddlflags='-shared -expect_unresolved "*" -O4 -msym -std -s
-L/usr/local/lib'
GNU ld version 2.9.1 (with BFD 2.9.1)
--
SETI@HOME Hall of Shame Project
80386DX33, 128KB cache. IIT 80387 MathCo. 32 MB. Win95.
Status: 100.000% complete. CPU Time: 2353 Hours 15 minutes 31.8 sec
------------------------------
Date: Fri, 9 Jun 2000 19:57:30 +0200
From: "Helza" <helza@planet.nl>
Subject: Re: please help
Message-Id: <8hrbbj$8964d$1@reader3.wxs.nl>
ohyeah part of code i forgot I tryed the Net::Ping
------
#!/usr/bin/perl
use Net::Ping;
$host = "130.89.225.137";
$p = Net::Ping->new();
$retval = $p->ping($host,5);
$p->close();
print "Content-type: text/html\n\n";
print "Retval value is: $retval";
-------
but everything i wrote below the $p->close();
doesn't seem to be executed :(
both the print commands you see are never executed :(
Greetings Helza
Ted Marz <tfm@sei.cmu.edu> wrote in message
news:39410064.6D453B1B@sei.cmu.edu...
> I'm not quite catching why your select() call isn't working. It seems
> well formed.
> I suspect that you are always getting a 0 return from your system(ping)
> call because you are getting the success status of the system, not the
> status of the ping.
>
> To try and get around this, use the Net::Ping
> This won't tell you if a server is up on any particular port, but it
> should tell you if the host is reachable.
>
> Ted
>
>
> Helza wrote:
> >
> > I've asked it already before but most answers I get don't work for some
> > reason :( and i'm 100% stuck until i fix this problem :(
> >
> > I simply want to ping a ip to see if it responds, if not that it will
> > continue with the rest of the program.
> >
------------------------------
Date: Tue, 6 Jun 2000 14:05:23 -0400
From: jd@mongo.krivis.com (Stuart Krivis)
Subject: Re: Q: Perl Editor for linux?
Message-Id: <slrn8jqfb3.bf9.jd@kleenex.apk.net>
On Mon, 22 May 2000 19:55:46 GMT, Thomas Åhlen <thomas2@dalnet.se> wrote:
>I am about to change my operatingsystem on my workstation to linux and have
>to find an
>replacement for UltraEdit. I have searched some but havent really found one
>yet.
>Anyone got any suggestions to a similar program on linux.
(X)emacs is worth looking at, as is vi(m). I tend to lean toward vim,
myself.
There is an editor called jext that's written in Java and has nice syntax
highlighting for perl. It's probably closer to what you are used to with
Ultraedit than vi or emacs.
--
Stuart Krivis
*** Remove "mongo" in headers for valid reply hostname
------------------------------
Date: Fri, 09 Jun 2000 19:06:31 +0300
From: Gleb Ekker <ekker@hot.ee>
Subject: RSA simple encrypt-decrypt
Message-Id: <39411607.9D1B6E8D@hot.ee>
Hi,
Can anybody suggest some idea for RSA simple encrypt-decrypt functions.
I need to encrypt some string using my Private RSA key and also to
decript message using message owner's Public key.
Thanks in advance,
Gleb.
mailto:ekker@hot.ee
------------------------------
Date: 9 Jun 2000 17:49:51 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: site_perl vs lib
Message-Id: <8hranv$4ob$0@216.155.32.44>
In article <3943cc70.3047843@news.skynet.be>, bart.lateur@skynet.be
(Bart Lateur) wrote:
| The WebDragon wrote:
|
| >If I understand this correctly, MacPerl will use any modules installed
| >in site_perl, preferring them over the ones in lib? or is there
| >something else I need to do ?
|
| You need to do it. The search order is defined by the order of the
| folders in the "Preferences" -> "Libraries" (which will get copied into
| @INC). If site_perl comes first, then that will be tested first.
|
| One of the modules written/poted by Chris Nandor depends on this (I
| think it's CPAN.pm), because he included a newer version of a module
| which is standard, and it doesn't work with the old version.
|
| I don't like this approach. If you're sure a new version is backward
| compatible with your old scripts, you should simply remove the older
| version, so that there are no conflicts at all, and no matter what order
| the library folders are in @INC, you always load the same version of the
| module.
it's sorta different from what I'd expected.. but one thing that it can
do for you is PRESERVE the former version of an install (if you do this
right) so that if you download a new version to test it, it doesn't
overwrite the previous one.. and if it fails, you have a backup *already
installed* :D
still, though I can see some potential problems with it, not the least
of which is having to look in TWO folders for modules instead of one, I
added the extra dir to my preferences and everything *seems* to be
working fine with the exception of Types.pm which keeps giving me errors
at line 56 when I try and use the CPAN shell :(
I haven't a CLUE what the error is from..
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Fri, 09 Jun 2000 15:38:19 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Spaces
Message-Id: <39410f31.20136768@news.skynet.be>
methos wrote:
>Or another simple one is
>
>$variable =~ s:\s::g;
And
s:\s+::g;
will be faster in the case where sequences of more than one whitespace
character are common.
Note that this deletes newlines too.
--
Bart.
------------------------------
Date: Fri, 09 Jun 2000 15:21:30 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Splitting a Text String
Message-Id: <_X705.3797$55.49163@news1.rdc1.mb.home.com>
In article <Gr705.294056$Kv2.619944@quark.idirect.com>,
Robert Young <roberty@idirect.com> wrote:
> Can anyone give me a regular expression to perform a split where the
> expression is split on a character unless the character is preceded by a
> backslash (\) ?
use a negative look-behind, which looks like: (?<!pattern) -- ie, to
split on colons not preceded by a backwhack:
split /(?<!\\):/
see 'perldoc perlre' for info on negative look-behinds and other
regex constructs.
regards,
andrew
--
Andrew L. Johnson http://members.home.net/perl-epwp/
There ain't nothin' in this world that's worth being a snot over.
-- Larry Wall in <1992Aug19.041614.6963@netlabs.com>
------------------------------
Date: Fri, 09 Jun 2000 17:37:03 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Splitting a Text String
Message-Id: <cf32ksku1frn043dm4do4tnlmhrhppphpr@4ax.com>
On Fri, 09 Jun 2000 14:47:02 GMT, "Robert Young" <roberty@idirect.com>
wrote:
> Can anyone give me a regular expression to perform a split where the
> expression is split on a character unless the character is preceded by a
> backslash (\) ?
You have asked this exact question before and it _has_ been answered.
Check here:
http://www.deja.com/viewthread.xp?AN=631831581&group=comp.lang.perl.misc
if you don't like the answers you were given three days ago, you are not
likely to get better ones without telling what you _do_ want.
--
Good luck,
Abe
------------------------------
Date: 9 Jun 2000 15:57:52 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: Splitting a Text String
Message-Id: <8hr460$1qr$1@newsflash.concordia.ca>
In article <Gr705.294056$Kv2.619944@quark.idirect.com>,
Robert Young <roberty@idirect.com> wrote:
>Can anyone give me a regular expression to perform a split where the
>expression is split on a character unless the character is preceded by a
>backslash (\) ?
>
$ cat > file
abcdef\rdfs\g\G\dsfjsdf\\fjsdlkf\d\!\\sdfkl\dg\\\
$ perl -wne 'print "<$_>" for ( split /(?<=\\\\)|(?<!\\(?![\n\r]))/ )' file
<a><b><c><d><e><f><\r><d><f><s><\g><\G><\d><s><f><j><s><d><f><\\><f><j>
<s><d><l><k><f><\d><\!><\\><s><d><f><k><l><\d><g><\\><\><
>
Explanation: split, if we have \\ behind us, or, don't if
there is a \ behind us -- since the test for \\ comes first,
we know it's only one -- and there isn't a newline or carriage-return
ahead of us. (You can stuff more things to reject in that char class).
Argggh. You'd think there'd be a simpler way. I tried this:
/(\\[^\n\r])|/ -- split on backslash-non-newline-nor-CR and keep what
you split on, or split (on any boundary).
Unfortunately, due to the special behaviour of parens in split, you get
extraneous empty strings.
$ perl -wne 'print "<$_>" for ( grep {$_ ne ""} split /(\\[^\n\r])|/ )' file
Anyone have a simpler solution?
--
Neil Kandalgaonkar
neil@brevity.org
------------------------------
Date: 9 Jun 2000 16:01:33 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: Splitting a Text String
Message-Id: <8hr4ct$k5m$1@newsflash.concordia.ca>
In article <_X705.3797$55.49163@news1.rdc1.mb.home.com>,
Andrew Johnson <andrew-johnson@home.com> wrote:
>In article <Gr705.294056$Kv2.619944@quark.idirect.com>,
> Robert Young <roberty@idirect.com> wrote:
>> Can anyone give me a regular expression to perform a split where the
>> expression is split on a character unless the character is preceded by a
>> backslash (\) ?
>
>use a negative look-behind, which looks like: (?<!pattern) -- ie, to
>split on colons not preceded by a backwhack:
>
> split /(?<!\\):/
<head slap>
I misread the q, I thought he wanted to tokenize a string grouping
backwhacked stuff together.
Ignore what I just posted.
--
Neil Kandalgaonkar
neil@brevity.org
------------------------------
Date: Fri, 9 Jun 2000 09:32:32 -0600
From: "Bill Border" <bill_border@agilent.com>
Subject: UX Zombie/Defunct Processes After fork()
Message-Id: <8hqdv1$ptg$1@nonews.col.hp.com>
Although I have been writing Perl for years, I am now having
to experience fork(). :\
I downloaded a client/server sockets program which I am developing
into a server for events from remote servers. I am experiencing the
problem of defunct/zombie formerly forked processes filling the
process table.
I saw the example on www.perl.com of the REAPER subroutine and I
coded it into my program. But, when I run it when a connection
arrives, it seems to loop through the REAPER routine infinitely.
All I want to do is to kill these defunct children.
I am attaching some code.
Thanks VERY MUCH in advance,
Bill Border
Agilent Technologies
bill_border@agilent.com
my $waitedpid = 0;
sub REAPER
{
$waitedpid = wait;
$SIG{CHLD} = \&REAPER;
&msg("(REAPER) waitedpid=$waitedpid");
}
...
$| = 1;
# Set default output back to the standard output channel
select(STDOUT);
# The 'fork' creates a child process to handle this client.
# Remember that 'fork' returns 0 for the child and a positive number
# for the parent.
$SIG{CHLD} = \&REAPER;
if (($child = fork()) == 0) {
# We're the child...
# unpack the information returned by 'accept' to get some
# (readable) information about the client we're serving and
(do child stuff)
...
{
&msg("(Child $$ Dbcnum $e_dbcnum) Can't find module -
Unknown Me
ssage Type=$e_type - Sending NG");
syswrite(NS,"NG\n",3);
last;
}
}
# Close the socket connection when the client goes away
&msg("(Child $$ Dbcnum $e_dbcnum) Closing NS");
close(NS);
# The forked server dies here
&msg("(Child $$ Dbcnum $e_dbcnum) Client went away. Forked
server $c
on exiting...");
exit;
}
# this is where the parent returns; all we do is close the socket
# connection (it's being handled by the child we fork'ed) and then
# enter another iteration of the big for loop.
&msg("Closing NS");
close(NS);
}
(end of program)
------------------------------
Date: Fri, 09 Jun 2000 17:41:00 GMT
From: "Blair Heuer" <ab@cd.com>
Subject: Re: windows -> perl = no longer work
Message-Id: <M_905.698$907.19796@newsread2.prod.itd.earthlink.net>
> mode (the default), and there is an invisible carriage-return ("\cM")
That was exactly my problem. Thats a pesky little problem that has seemed to
be the culprit in every single script I have on the server. Thanks a bundle!
-Blair Heuer
The Geosoft Network
------------------------------
Date: Fri, 09 Jun 2000 17:42:19 GMT
From: "Blair Heuer" <ab@cd.com>
Subject: Re: windows -> perl = no longer work
Message-Id: <%%905.700$907.19867@newsread2.prod.itd.earthlink.net>
> What server software is he running? Sounds like your cgi-bin needs to be
> given the rights it needs.
Apparently the server is set to full executable rights universally, so that
is not the problem.
I did find the problem to be an invisible carraige return of some sort.
Thanks anyways!
-Blair Heuer,
The Geosoft Netwok
------------------------------
Date: Fri, 09 Jun 2000 17:44:41 GMT
From: "Blair Heuer" <ab@cd.com>
Subject: Re: windows -> perl = no longer work
Message-Id: <d2a05.703$907.18770@newsread2.prod.itd.earthlink.net>
> "Premature end of script headers" means that the program died before it
> could print the headers. It doesn't have anything to do with the first
lines
> of your program, or the header you used (usually!).
Thanks for clarifying the for me. I had a misconception of it, which sent me
searching everywhere else but where the problem was for a solution.
> Get the server error logs, they may be more informative. Or use this:
> use CGI::Carp 'fatalsToBrowser';
That may come in handy in the future.
I found the problem to be an invisible carriage return on the first line.
Thanks for the help.
Blair Heuer,
The Geosoft Network
------------------------------
Date: Fri, 09 Jun 2000 08:31:53 -0700
From: pjsto <pjstoNOpjSPAM@hotmail.com.invalid>
Subject: Windows Installer error
Message-Id: <04c22c70.66754e2c@usw-ex0101-006.remarq.com>
I'm getting a wininstaller error that say I need to up grade to
a more current Service Pack for NT. One that has a more current
Windows installer. I've installed SP6a and have also installed
the most current windows installer from the Office 2000 cd. File
name Instmsiw.exe created 6/9/00. I'm still getting the error
which is preventing me from loading ActivePerl 5.6
Thanks for your help on this one Pete.
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 3303
**************************************