[12560] in Perl-Users-Digest
Perl-Users Digest, Issue: 6160 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 29 01:07:17 1999
Date: Mon, 28 Jun 99 22:00:23 -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 Mon, 28 Jun 1999 Volume: 8 Number: 6160
Today's topics:
Re: 2 simple (not to me tho) questions (Steve Lamb)
Re: 2 simple (not to me tho) questions (Ronald J Kimball)
Re: Apples and Oranges (William Herrera)
Re: Apples and Oranges (Ronald J Kimball)
Bin output via Perl? <scottm@pobox.com>
Re: CGI.pm, hashes, passing by reference and two differ (Ronald J Kimball)
Re: Command line parameters / Wildcard characters / Rec (Ben Coleman)
Re: Comparing two associative arrays (John Cochran)
Re: Comparing two associative arrays <uri@sysarch.com>
converting html to plain text (brian e jones)
Re: DBD::msql <spike@isd.net>
Re: DBI and Recursion <s328942@student.uq.edu.au>
dynamic web page creation and posting <begum786@rocketmail.com>
Re: each-ing on $rec{'thing'}{'subthing'} <design@crucial-systems.com>
Re: FAQ 2.12: Perl in Magazines (Cameron Laird)
Re: Help needed in using library (Martien Verbruggen)
How to put small icons at the start menu bar smnayeem@my-deja.com
Re: is there any perlscript for client-side scripting? smnayeem@my-deja.com
Re: Linux better than perl? (Ronald J Kimball)
Re: Multiple Mail Messages from Perl (Ronald J Kimball)
Re: New Site about East Timor (Ronald J Kimball)
output the hexadecimal value of character from a string (markus)
Perl or PNP...which is better? <danielrod@nts.co.jp>
Re: Perl or PNP...which is better? (Cameron Laird)
Re: please help! regular expression! (Ronald J Kimball)
second try - need help <argyrodes@sympatico.ca>
Re: second try - need help <aperrin@mcmahon.qal.berkeley.edu>
Single quote in string passed to embeded Perl jellingt@my-deja.com
Special Charecters converted from forms <figarema@my-deja.com>
Sybase OpenClient Problem (Martin Prager)
Re: UK Perl job vacancy (Ronald J Kimball)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 29 Jun 1999 02:41:10 GMT
From: morpheus@despair.rpglink.com (Steve Lamb)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <slrn7ngci6.ene.morpheus@rpglink.com>
On 28 Jun 1999 17:35:42 GMT, I R A Aggie <fl_aggie@thepentagon.com> wrote:
>Ok, compare and constrast:
You're missing the point.
>Are they different? is there *really* more than one way to skin this
>particular cat?
>James - nay, you get *different* results
The point is in the example I gave it made no difference. In fact, in
most cases that I do that, I want it to make a new string. That is how *I*
code. Let me handle the problems with it because I LIKE it that way.
I now refer *YOU* to page 10 of the Programming Perl book.
--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
ICQ: 5107343 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
------------------------------
Date: Tue, 29 Jun 1999 00:58:51 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <1du4vpj.5ouk3s1ll4uecN@p23.tc1.metro.ma.tiac.com>
<greyed@my-deja.com> wrote:
> Tom, lemme be blunt about this, turn to page
> 10 of "Programming Perl, 2nd Edition" by Larry
> Wall, Tom Christiansen & Randal L. Schwartz and
> read the first paragraph under "How to Do It" and
> the assicaited subnote. I'm sure you are familiar
> with it since your name is on the book.
If you think that code is relevant, then you're missing the point.
Using quotes when you need to interpolate variables, as in
print "$student: $grades{$student}\tAverage: $average\n";
is perfectly reasonable. Using quotes around a lone variable, however:
print "$student";
is completely superfluous, and would be better written as:
print $student;
Hope that clears things up.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 29 Jun 1999 03:38:55 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: Apples and Oranges
Message-Id: <37783e7b.137524975@news.rmi.net>
On Mon, 28 Jun 1999 23:35:13 GMT, edmundsMUNGED@pacifierMUNGED.com
(doug edmunds) wrote:
>Can anyone explain why the 'oranges' test (below) fails?
You are doing the perl equivalent of an invalid pointer access. Don't
do that :)
>In what way is a string that starts with a digit (other than 0)
>different than any other string, or is this a bug?
Perl is apparently treating the NULL pointer ($$b = 0 is what atoi()
translation of non-digit text like "two...") diferently from other
ponters. I suspect this is a safety feature--perl automagically won't
dereference a NULL pointer the way it tries to de-reference a non-NULL
pointer.
I would look at the source code if you really want to know ;-)
--Bill
>#! perl -w
>#apples_and_oranges.pl
>$a = "One apple";
>print "first - $a \n";
>
>$a_ref = \$a;
>$$a_ref = "Two apples";
>print "second - $a \n";
>
>$$a = "Three apples";
>print "third - \$\$a is $$a \$a is $a \n\n";
>$b = "One apple";
>print "first - $b \n";
>
>$b_ref = \$b;
>$$b_ref = "Two apples";
>print "second - $b \n";
>
>$$b = "3 apples";
>print "third - \$\$b is $$b \$b is $b \n\n";
>$c = "1 orange";
>print "first - $c \n";
>
>
>$c_ref = \$c;
>$$c_ref = "2 oranges";
>print "second - $c \n";
>
>$$c = "3 oranges"; #the crash site
>#you won't see the next line print
>print "third - \$\$c is $$c \$c is $c \n\n";
---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.
------------------------------
Date: Tue, 29 Jun 1999 00:58:52 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Apples and Oranges
Message-Id: <1du4vwj.170o1ox1cffharN@p23.tc1.metro.ma.tiac.com>
doug edmunds <edmundsMUNGED@pacifierMUNGED.com> wrote:
> Can anyone explain why the 'oranges' test (below) fails?
> In what way is a string that starts with a digit (other than 0)
> different than any other string, or is this a bug?
Scalar variables whose names are numbers (other than 0) are special
regex variables, as $1, $2, etc, and are therefore read-only.
Apparently this read-only protection extends to all scalar variables
whose names begin with digits other than 0. Go figure.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Mon, 28 Jun 1999 22:28:27 -0500
From: Scott Moseman <scottm@pobox.com>
Subject: Bin output via Perl?
Message-Id: <37783D5B.C9E6EF3B@pobox.com>
I am writing a Perl script that is going to be doing some user/pass
validation. Upon passing, the script is going to send the user a binary
file. The trick is that the user cannot have a straight URL to the binary
file, they must enter appropriate information into the given form. Is
there a way to stream a file (with the filename intact) to a web user
through Perl? Or any other ideas how to go about this? Thanks.
--
Scott Moseman
scottm@pobox.com
------------------------------
Date: Tue, 29 Jun 1999 00:58:53 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: CGI.pm, hashes, passing by reference and two different results?
Message-Id: <1du4w1s.g2a8p3efjcfgN@p23.tc1.metro.ma.tiac.com>
John Warner <john.warner@tivoli.com> wrote:
> Ah ha! I knew I must be missing something obvious. Now for the $64 dollar
> question: how do I fix it? I've tried every way, except the correct way,
> I can think of to reference @row.
>
\@row is a reference to the array @row.
[ @row ] is a reference to an anonymous array, which is initialized with
a copy of @row.
I would expect either of those to work.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 29 Jun 1999 03:45:33 GMT
From: tnguru@termnetinc.com (Ben Coleman)
Subject: Re: Command line parameters / Wildcard characters / Recursive directories
Message-Id: <37784095.611000652@news.mindspring.com>
On 26 Jun 1999 20:08:35 -0700, Tom Christiansen <tchrist@mox.perl.com>
wrote:
>Yes, one is broken; and in blazes does the rest of the sentence mean?
>Don't you *read* these messages before you actually post them?
Tom, I think the first of these two sentences is missing a word. Didn't
you read it before posting?
Seems that even Tom is vulnerable to the law that says that in any spelling
or grammar flame, the flamer will commit grammar and/or spelling mistakes.
Ben
--
Ben Coleman
Senior Systems Analyst
TermNet Merchant Services, Inc.
Atlanta, GA
------------------------------
Date: Mon, 28 Jun 1999 23:47:19 -0400
From: jdc@johnc.connectionsusa.com (John Cochran)
Subject: Re: Comparing two associative arrays
Message-Id: <7kf9l7.8t3.ln@johnc.connectionsusa.com>
In article <7l86jo$pk0$1@fcnews.fc.hp.com>, Andrew Allen <ada@fc.hp.com> wrote:
>Andrew Allen (ada@fc.hp.com) wrote:
>: "@{[%hash1]}" eq "@{[%hash2]}"
>
>: almost works (but can you explain why?).
>
>Wow, 13 responses for 30 characters of code. I think I've come
>up with a solution that removes the "almost" (assuming a strange-
>enough $"):
>
> keys %hash1==keys %hash2 && "@{[values %hash1]}" eq "@{[@hash2{keys %hash1}]}"
^^^^^^^^^^^^^^^^^^^^^^^^
You need to read some more of those 13 responses until you understand why
the above underlined code isn't reliable. If you insist on a one-liner, then
I suggest that you stick a coupla of sorts on those keys so that you have
a defined key order with your hashes. But then the cost of 2 sorts would
mean that a longer (but clearer) algorythm would probably be faster.
>
>of course, you're probably just better off (in the perl golf sense) with:
>
> keys %hash1==keys %hash2 && !grep($hash1{$_} ne $hash2{$_},keys %hash1)
>
>Andrew
John
------------------------------
Date: 29 Jun 1999 00:17:43 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Comparing two associative arrays
Message-Id: <x7g13b63o8.fsf@home.sysarch.com>
>>>>> "JC" == John Cochran <jdc@johnc.connectionsusa.com> writes:
>> keys %hash1==keys %hash2 && "@{[values %hash1]}" eq "@{[@hash2{keys %hash1}]}"
JC> ^^^^^^^^^^^^^^^^^^^^^^^^
JC> You need to read some more of those 13 responses until you
JC> understand why the above underlined code isn't reliable. If you
JC> insist on a one-liner, then I suggest that you stick a coupla of
JC> sorts on those keys so that you have a defined key order with your
JC> hashes. But then the cost of 2 sorts would mean that a longer (but
JC> clearer) algorythm would probably be faster.
i think you are mistaken. that expression is calling keys in a scalar
context provided by ==. so it compares the number of keys in each which
is a valid shortcut but not needed. the second part compares the
concatenated keys in the same order by using the key ordering of only
one of the hashes.
it looks like it should work fine except for the problems of $" but that
should not be a problem with many typical sets of keys.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Tue, 29 Jun 1999 03:31:01 GMT
From: cluebag@world.std.com (brian e jones)
Subject: converting html to plain text
Message-Id: <FE2KFp.ILB@world.std.com>
i think my last post was removed, if someone could tell my why i would appreciate it. anyway, i have some files in html format that i would like to convert to plain text (man pages to be exact). i think i could just get the originals off of the installation cd, but i'm trying to learn perl and wonder if this would be a good exercise. it is a little over my head so i am hoping someone can clue me in on where to start with this. is this going to be more involved than i thought? i just finished Learning Perl and have started Programming Perl although i don't know much about html. i feel like i have a decent understanding of the topics covered in Learning Perl, but i don't have much experience programming and have no idea where to start. thanks,
-brian
------------------------------
Date: Mon, 28 Jun 1999 21:46:34 -0500
From: judy <spike@isd.net>
Subject: Re: DBD::msql
Message-Id: <3778338A.5B122D04@isd.net>
Steve,
I believe the problem is probably that Perl can't locate the shared
library
libmysqlclient.so. One of the following might fix it for you:
1) Copy libmysqlclient.so to the directory where your other shared
libraries
are located (most likely /lib or /usr/lib).
2) Since you're running Linux, you can add the pathname for the
location
of the libmysqlclient.so library to the /etc/ld.so.conf file. Then
run
/sbin/ldconfig to update the links.
3) Add the directory where libmysqlclient.so is located to the
LD_RUN_LIBRARY
environment variable.
4) Compile the Msql-Mysql perl module with the -static flag (e.g.,
perl
Makefile.PL -static).
If you choose option 1, you may have to manually create an additional
link. The linker (ld), which searches for the library at compile time,
looks for a name with the .so extension whereas the dynamic linker (dl)
which searches for the library whenever the program is run, looks for
the soname (e.g., libmyclient.so.X, where X denotes the major version
number). So, what you need is libmyslient.so -> libmyclient.so.X ->
libmyclient.so.X.Z where Z is the minor version number. Note that
ldconfig will create the link for the dynamic linker but you'll have to
add the libmyclient.so -> libsclient.so.X link manually.
I chose option 2 and everything worked fine. Hopefully one of the
above options will fix your problem.
Good luck!
Judy
Just remove the nospam to send me a reply.
Steve Gilbert wrote:
>
> I'm trying to get DBD::msql installed and running on my web server, and
> it's giving me a bit of a pain. A little background, I'm running Linux
> 2.0.29, and perl 5.005_02. MySQL seems to be working fine, I can run
> mysql and create, modify, view tables etc. The compilation and
> installation of DBD::msql also went without a hitch, however, whenever I
> try to use it, I get:
>
> install_driver(mysql) failed: Can't load
> '/usr/lib/perl5/site_perl/5.005/i586-li
> nux/auto/DBD/mysql/mysql.so' for module DBD::mysql: File not found at
> /usr/lib/p
> erl5/5.00502/i586-linux/DynaLoader.pm line 168.
>
> at (eval 35) line 2
>
> at /usr/local/sql-bench/server-cfg line 191
>
> I have varified that mysql.so is available, and is readable by the
> current user (in this case, root). Has anyone else had this problem?
>
> - Steve
--
-------
Judy Kallestad
Systems Software Programmer
Center for Magnetic Resonance Research
kalle001@maroon.tc.umn.edu
------------------------------
Date: Tue, 29 Jun 1999 11:32:53 +1000
From: Nathan Dunn <s328942@student.uq.edu.au>
To: David Hounsell <David@hounsell.freeserve.co.uk>
Subject: Re: DBI and Recursion
Message-Id: <37782245.187A1604@student.uq.edu.au>
David Hounsell wrote:
>
> while((my $child)=$sth->fetchrow_array)
The $child variable is local and you won't be able to pass it to other
subroutines, and recursively calling a subroutine?
Perhaps a better way would be to place the while loop in the main
program and call &print_tree from within this
while ($child=$sth->fetchrow->array) {
&print_tree($child, $tabs);
}
It's always a good idea to include error messages in posts too.
Chris (cmd@maths.uq.edu.au)
------------------------------
Date: Tue, 29 Jun 1999 10:50:39 +0800
From: Zam Zam Begum <begum786@rocketmail.com>
Subject: dynamic web page creation and posting
Message-Id: <3778347E.BD1D6504@rocketmail.com>
Hi,
I am Zam Zam from Singapore. I am a bit new to this perl and cgi
program.I need some help with the program i am doing. I have created a
form using html, whereby users will be keying in their details in this
form. And when i "submit" this form, I want my perl program to create a
dynamic page based on the user's input. I would like to know if i click
on the "submit" button to create the dynamic page, would it be possible
to call a local file .
<form name="information" method="POST" action="test3a.pl">
And if everything is ok with the user, they will hit the "ok" button,
and this dynamic page will be emailed to me.
print ("document.write(\"<form
action=mailto:$RecAddress?subject=Greetings method=GET
enctype=text/plain \");\n");
Do i have to use perl or cgi program to create this dynamic page.?
Appreciate your help. Thanks You.
Regards,
Zam Zam
------------------------------
Date: Mon, 28 Jun 1999 22:48:03 -0400
From: "crucial" <design@crucial-systems.com>
Subject: Re: each-ing on $rec{'thing'}{'subthing'}
Message-Id: <930624675.765.83@news.remarQ.com>
>Bart Lateur wrote:
>> Uri Guttman wrote:
>> >trust perl, it knows what is right for you.
>>
>> So what should I eat for breakfast?
>
>Umm, let's see.. 'perls before swine'... 'a perl of great
>price'...
>
>Okay, ham and caviar.
>
>David, whose rabbi great-grandfather is probably spinning
>like a lathe...
>--
>David Cassell, OAO cassell@mail.cor.epa.gov
>Senior computing specialist
>mathematical statistician
...uh...thank you gentlemen. i have successfully dereferenced myself now.
__________________________________________ :\\_______
http://crucial-systems.com
__________________________________________ :\\_______
------------------------------
Date: 28 Jun 1999 21:45:57 -0500
From: claird@Starbase.NeoSoft.COM (Cameron Laird)
Subject: Re: FAQ 2.12: Perl in Magazines
Message-Id: <7l9c15$dh4$1@Starbase.NeoSoft.COM>
In article <rdm-2806990921230001@205.158.144.205>,
Rich Morin <rdm@cfcl.com> wrote:
>In article <377345d0@cs.colorado.edu>, perlfaq-suggestions@perl.com (Tom
>and Gnat) wrote:
>
>> The first and only periodical devoted to All Things Perl, *The Perl
>> Journal* contains tutorials, demonstrations, case studies, ...
>
>I am also a big fan of TPJ, but I think you should also mention PerlMonth
>(http://www.perlmonth.com). They have published two issues so far and seem
.
.
.
>P.S. I may be biased by the fact that my spouse, Vicki Brown, has a
> column ("Script Different") in the new publication.
.
.
.
I'm married to no one who works for PerlMonth, but I agree with
Rich. Moreover, I've recommended to perlfaq-suggestions that
mention be made of *SunWorld Online*. Between the monthly
column Rich writes for that magazine, and other regular contrib-
utors, *SunWorld Online* generally has more than one Perl piece
each month.
--
Cameron Laird http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com +1 281 996 8546 FAX
------------------------------
Date: Tue, 29 Jun 1999 02:11:16 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help needed in using library
Message-Id: <8XVd3.106$Cj2.6125@nsw.nnrp.telstra.net>
In article <7l93ff$qp$1@nnrp1.deja.com>,
dilipc@my-deja.com writes:
> When I compile, I get following message:
>
> ReadEnv.pl did not return a true value at SyncDispCodes line 8.
# perldoc perldiag
/did not return
%s did not return a true value
(F) A required (or used) file must return a true value
to indicate that it compiled correctly and ran its
initialization code correctly. It's traditional to end
such a file with a "1;", though any true value would do.
See the require entry in the perlfunc manpage.
> Can somebody help me.
The documentation can. Find out how to get access to the perldiag
documentation on your platform. perldoc should work for most. Winstuff
seems to come with a bundle of html files as well.
While you're there, also check out the other documentation; start with:
# perldoc perl
# perldoc perldoc
# perldoc perldata
# perldoc perlsyn
# perldoc perlrun
> Share what you know. Learn what you don't.
Indeed. And learn how to learn.
Martien
--
Martien Verbruggen |
Interactive Media Division | We are born naked, wet and hungry. Then
Commercial Dynamics Pty. Ltd. | things get worse.
NSW, Australia |
------------------------------
Date: Tue, 29 Jun 1999 04:33:21 GMT
From: smnayeem@my-deja.com
Subject: How to put small icons at the start menu bar
Message-Id: <7l9iah$5o3$1@nnrp1.deja.com>
Does anyone know how I can install a small icon on the start menu like
those of say ICQ, Antivirus programs, Pager etc? So that when someone
clicks a window pops up, if they highlight something else happens etc.
In fact is there any way to do windows programming using perl? or is it
that using Microsoft tools is the only solution?
Please let me know and thanks in advance.
smnayeem
smnayeem@agni.com
Programmer,
Agni Systems Ltd.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 29 Jun 1999 04:17:23 GMT
From: smnayeem@my-deja.com
Subject: Re: is there any perlscript for client-side scripting?
Message-Id: <7l9hcb$5fm$1@nnrp1.deja.com>
In article <7l0t38$kk$1@gellyfish.btinternet.com>,
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> On Mon, 21 Jun 1999 15:39:13 -0700 TRG Software : Tim Greer wrote:
> > smnayeem@my-deja.com wrote:
> >>
> >> Does anyone know where i can find some documentation on
perlscripts, is
> >> it going to be a good scripting language for doing client side
> >> scripting? so that i wont have to wait about javascript or
vbscript, and
> >> not to mention be restricted to their limited vocabulary :(
> >> thanks
> >>
> > PerlScript on the client-side? I haven't heard anything about that.
>
> Yeah you can do that ... With the Microsoft scripting engine there is
> basically little difference betweeen a Scripting Provider that will
> run on the Client side or on the server side ... If it wasnt Microsoft
> I might even be lured into thinking it was quite a nice idea. Try out
> some of the IE examples that come with the Activestate Distribution.
>
> Of course, yes, if you insist on using this then you are going to have
> to get all of your potential audience to use a particular browser and
> to download and install Activestates distribution.
>
> /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>
>
But thats very microsoftish, I am more into the any-platform any-browser
standard, is there really no way? I mean does it always have to be Java?
why does perl have to be so handicapped? I am sure the perl community
can persuade Netscape and Microsoft to accept a certain Perlscript
standard like Javascript or something?
I really feel bad about this whole thing :(
smnayeem
smnayeem@agni.com
Programmer
Agni Systems Ltd.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 29 Jun 1999 00:58:54 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Linux better than perl?
Message-Id: <1du4wl2.1hi7n3p1hwd3jjN@p23.tc1.metro.ma.tiac.com>
Scratchie <upsetter@ziplink.net> wrote:
> Nedret <nedred@my-deja.com> wrote:
> : In article <7l6lmt$vio$10@newsfeed.smartt.com>,
> : joey@hecnyyvr.com (J.Y.) wrote:
> :> Linux better than perl?
> :> -JY
> :>
> :>
>
> : - What is the difference between the crocodile?
> : - The crocodile is longer than green.
>
> I thought it was "One leg is both the same."
No, no, no, that's the answer to a different question!
- What's the difference between a duck?
- One of its legs is both the same.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 29 Jun 1999 00:58:55 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Multiple Mail Messages from Perl
Message-Id: <1du4wpp.12zjnxw11h2a4dN@p23.tc1.metro.ma.tiac.com>
Dann-o <druttle@gb.pepperl-fuchs.com> wrote:
> print MAIL "@Litrequests";
perlvar
$"
Enjoy.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
perl -e '$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'
------------------------------
Date: Tue, 29 Jun 1999 00:58:56 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: New Site about East Timor
Message-Id: <1du4wwk.1iwafvav2ssg7N@p23.tc1.metro.ma.tiac.com>
brian d foy <brian@pm.org> wrote:
> Jonathan Stowe <gellyfish@gellyfish.com> posted:
>
> > I always thought that a Java.pm group would be a good idea.
>
> there is one.
Hmm, I see a Perl Mongers group in West Java, but I don't see one
actually named Java.pm.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 29 Jun 1999 00:06:53 GMT
From: drbrain@ziemlich.org (markus)
Subject: output the hexadecimal value of character from a string
Message-Id: <slrn7ng3gt.l3m.drbrain@josefine.ben.tuwien.ac.at>
This one catched me latly, when i just tried to print for every
character in a string its hexadeizmal value. So e.g. the string is "ABC" it
would print "0x29 0x30 0x31". I found the function 'hex' which converts _from_
hex _to_ decimal. There isn't mentioned any counterpart function. I also
played a bit with pack() and it's "h" modifier without success. Any idea which
function to use and how to do this ?
thanks very much,
Markus
--
(0- OpenSource
//\ join the revolution
v_/_
------------------------------
Date: Tue, 29 Jun 1999 01:53:22 GMT
From: Daniel <danielrod@nts.co.jp>
Subject: Perl or PNP...which is better?
Message-Id: <7l98ue$2kt$1@nnrp1.deja.com>
I am a beginning programmer, interested in web programming. I have
read much about Perl, mod_perl, PNP, Java servlets, ASP, etc.
I am interested in knowing which might be the more beneficial tool to
learn, coming from a "no previous experience" background. I.e., If I
am not a Perl programmer, and I am not a PNP programmer, which has the
best future potential? (both technical and careerwise)
Please understand that I am a student, not an IT manager, and hence I
am trying to get a feel for future market potential, not trying to
solve a particular real-live IT problem.
Insofar as Perl is concerned, lets assume mod_perl, so as to put it on
an equal field as PNP.
Thanks to all!
--Daniel
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 28 Jun 1999 21:55:27 -0500
From: claird@Starbase.NeoSoft.COM (Cameron Laird)
Subject: Re: Perl or PNP...which is better?
Message-Id: <7l9civ$e10$1@Starbase.NeoSoft.COM>
In article <7l98ue$2kt$1@nnrp1.deja.com>, Daniel <danielrod@nts.co.jp> wrote:
>I am a beginning programmer, interested in web programming. I have
>read much about Perl, mod_perl, PNP, Java servlets, ASP, etc.
>
>I am interested in knowing which might be the more beneficial tool to
>learn, coming from a "no previous experience" background. I.e., If I
>am not a Perl programmer, and I am not a PNP programmer, which has the
>best future potential? (both technical and careerwise)
>
>Please understand that I am a student, not an IT manager, and hence I
>am trying to get a feel for future market potential, not trying to
>solve a particular real-live IT problem.
>
>Insofar as Perl is concerned, lets assume mod_perl, so as to put it on
>an equal field as PNP.
.
.
.
I assume your question is about PHP, not PNP.
Are you asking about "future market potential" for yourself?
We'd need to know more about you. The cheap answer is that
Perl is likely to outlive PHP, but it's hard to know how that
relates to your career.
Technical comparisons of the two languages appear in <URL:http://
starbase.neosoft.com/~claird/comp.lang.misc/language_comparisons.html#scripting>
Learn 'em both. College's good time for that.
--
Cameron Laird http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com +1 281 996 8546 FAX
------------------------------
Date: Tue, 29 Jun 1999 00:58:59 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: please help! regular expression!
Message-Id: <1du4x2r.1gthmkhzor7e4N@p23.tc1.metro.ma.tiac.com>
<hamed53@my-deja.com> wrote:
> [long description of goal]
s/-f-(.*?)-f-/ ($x = $1) =~ tr,hamedio,qwtykul, /ge;
s/-e-//g;
This makes use of the /e option to s///, which allows for the evaluation
of arbitrary code in the replacement.
Repeatedly match whatever is between -f- and -f-, translate the
characters appropriately, and substitute it back in. Then match all
occurences of -e-, and replace them with nothing.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 29 Jun 1999 03:26:44 GMT
From: Norman Crooks <argyrodes@sympatico.ca>
Subject: second try - need help
Message-Id: <37783F1D.E9F58514@sympatico.ca>
Hi,
I could really use some help on this one, I'm stumped...
I'm having trouble doing a system call to pgp from a perl script. My
script is on a Solaris unix box.
At the command line, the following does what I want it to:
$ perl -e '`/heckler/www/stricker/.pgpdir/pgp -eatw
/heckler/www/stricker/cgi-bi
n/filename.txt Sue`';
It returns the following, and my file is properly encrypted:
Pretty Good Privacy(tm) 2.6.3ia - Public-key encryption for the masses.
(c) 1990-96 Philip Zimmermann, Phil's Pretty Good Software. 1996-03-04
International version - not for use in the USA. Does not use RSAREF.
Current time: 1999/06/27 22:35 GMT
Additionally, this works fine from the command line:
$ perl -e 'system("/heckler/www/stricker/.pgpdir/pgp -eatw
/heckler/www/stricker
/cgi-bin/filename.txt Sue")';
and returns this:
Pretty Good Privacy(tm) 2.6.3ia - Public-key encryption for the masses.
(c) 1990-96 Philip Zimmermann, Phil's Pretty Good Software. 1996-03-04
International version - not for use in the USA. Does not use RSAREF.
Current time: 1999/06/27 22:52 GMT
Recipients' public key(s) will be used to encrypt.
Key for user ID: Sue Stricker <stricker@strickerbooks.com>
1024-bit key, key ID CD393A49, created 1999/06/23
.
Transport armor file: /heckler/www/stricker/cgi-bin/filename.txt.asc
File /heckler/www/stricker/cgi-bin/filename.txt wiped and deleted.
In the script however, neither of these statements work:
`/heckler/www/stricker/.pgpdir/pgp -eatw
/heckler/www/stricker/cgi-bin/filename.txt Sue`;
Returns a SERVER ERROR message
and,
system("/heckler/www/stricker/.pgpdir/pgp -eatw
/heckler/www/stricker/cgi-bin/filename.txt Sue");
returns
Recipients' public key(s) will be used to encrypt. Preparing random
session key...
but doesn't actually do any encryption. My script also 'stalls' at
this point.
If anyone can tell me the proper syntax to call pgp and encrypt from
within a script I would be very appreciative. I should of had this done
a week ago...
Thanks,
-Norm
--
http://www.nobelmed.com/ncrooks
mailto:argyrodes@sympatico.ca
------------------------------
Date: Mon, 28 Jun 1999 20:47:36 -0700
From: Andrew J Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: second try - need help
Message-Id: <377841D8.43E7443F@mcmahon.qal.berkeley.edu>
1.) The system() is the cleaner way to do it, unless you're trying to
capture the output, which is what `` are for.
2.) My guess is permissions/ownership issues - try inserting
print "$0 is running as $>\n";
somewhere convenient in the script, or even if you feel ambitious:
print "$0 is running as " . (getpwuid($>))[0] . ".\n";
which will tell you who your script thinks it is when it's running.
Cheers,
Andy Perrin
Norman Crooks wrote:
> At the command line, the following does what I want it to:
> ...
> In the script however, neither of these statements work:
>
> `/heckler/www/stricker/.pgpdir/pgp -eatw
> /heckler/www/stricker/cgi-bin/filename.txt Sue`;
>
> Returns a SERVER ERROR message
>
> and,
>
> system("/heckler/www/stricker/.pgpdir/pgp -eatw
> /heckler/www/stricker/cgi-bin/filename.txt Sue");
>
> returns
>
> Recipients' public key(s) will be used to encrypt. Preparing random
> session key...
>
> but doesn't actually do any encryption. My script also 'stalls' at
> this point.
--
-------------------------------------------------------------
Andrew Perrin - NT/Unix/Access Consulting - aperrin@mcmahon.qal.berkeley.edu
http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------
------------------------------
Date: Tue, 29 Jun 1999 02:49:34 GMT
From: jellingt@my-deja.com
Subject: Single quote in string passed to embeded Perl
Message-Id: <7l9c7r$3qn$1@nnrp1.deja.com>
I am embeding Perl in a C++ program, and I am having problems with
strings that include single quotes. I can't seem to get perl to view
them as "escaped" -- perl just barfs. Any suggestions on getting perl
to handle strings with single quotes? BTW, i have tried adding '\\'
before the quote.
This is my sample string:
(<a'>,<a'>);(<A!>,<a!>)
This is part of my perl code that i use to evaluate the string:
...
sv_setpvf(command, "$string = '%s'; $string =~ %s", OLE2T(*bstrString),
OLE2T(bstrPattern));
dSP; // Initialize the stack pointer.
PUSHMARK(SP); // Remember the stack pointer.
perl_eval_sv(command, G_SCALAR); // Evaluate our command.
...
Thanks,
Jeremy
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 29 Jun 1999 00:51:35 GMT
From: Alberto <figarema@my-deja.com>
Subject: Special Charecters converted from forms
Message-Id: <7l95aj$1e1$1@nnrp1.deja.com>
Hi!
I have this typical "FormMail" CGI script and I'm trying to use for
documents in Spanish.
In Spanish we use certain non-standard charecters, in HTML
they are represaented as:
á é í same for o and u.
Also the ñ and the inverted question mark.
The script does not seem process them well, to convert them back from
the coding. Any ideas how to imporve this? I'm trying to figure out how
but I'm not very used to Perl.
Thanks!
--
EB1CFL - EC1AJY "Morse is not THAT difficult!"
http://acadica.home.pages.de/
http://aacoinma.home.pages.de/
http://members.xoom.com/EB1CFL/
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 29 Jun 1999 03:33:12 GMT
From: prager@prager.at (Martin Prager)
Subject: Sybase OpenClient Problem
Message-Id: <37783e33.1392006@news.inode.at>
I am using sybase with DBI and have the problem, that under certaim
curciumstances (which I dont know but it seems that some browsers can
this produces or when a bad SQL statament is ececuted than the
following status occour:
DBI->connect failed: OpenClient message: LAYER = (5) ORIGIN = (3)
SEVERITY = (5) NUMBER = (6)
Message String: ct_connect(): network packet layer: internal net
library error: Net-Library operation terminated due to disconnect
at /usr/local/httpd/cgi-bin/start.pl line 43
[Mon Jun 28 20:32:06 1999] null: DBI->connect failed: OpenClient
message: LAYER = (5) ORIGIN = (3) SEVERITY = (5) NUMBER = (6)
[Mon Jun 28 20:32:06 1999] null: Message String: ct_connect(): network
packet layer: internal net library error: Net-Library operation
terminated due to disconnect
[Mon Jun 28 20:32:06 1999] null: at /usr/local/httpd/cgi-bin/start.pl
line 43
httpd: [Mon Jun 28 20:32:06 1999] [error] [Mon Jun 28 20:32:06 1999]
null: Cannot connect to SYbase at /usr/local/httpd/cgi-bin/start.pl
line 43.
Sysbase himself works fine, but my perl application can not connect
after I restart the whole thing.
Is there another way to correct the situation (maybe by restarting 1
part? ) and has anybody an idea whats happen?
Ulli
------------------------------
Date: Tue, 29 Jun 1999 00:59:01 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: UK Perl job vacancy
Message-Id: <1du4xmc.1ikianprfv9ptN@p23.tc1.metro.ma.tiac.com>
<Tim.Bunce@ig.co.uk> wrote:
> The Paul Ingram Group has a vacancy for a permanent Perl whizz.
I guess even Perl notables can set bad examples with regards to job
postings. :/
Well, here's the standard treatment. :)
> Founded in 1987, this small established software company is seeking a
> talented Perl programmer.
If it had been established in 1987, would it be a small found software
company?
Found software... Is that like found art?
> You will work for Tim Bunce and Jacqui Caren
> on varied interesting projects. Mostly RDBMS, web, bulk data
> acquisition, processing and reporting on Solaris with some NT.
Yawn... I thought you said interesting.
> By joining our team you'll be able to:
>
> o Work in a happy informal flexible environment.
>
> o Work with the best software tools and equipment. Whatever you need.
I'll need a Nautilus exercise machine, if I'm expected to be flexible.
(Happy and informal are no problem.)
> o Be part of an experienced team.
...specifically, the waterboy part.
> o Have as much responsibility and freedom as you can handle.
You want responsibility and freedom? You can't handle responsibility
and freedom!
> o Be noticed and have your work appreciated.
I want my work to appreciate at a rate of at least 5% per annum.
> You will be expected to:
>
> o Be self motivated and keen to expand and develop your skills.
If I were self-motivated, I'd already have a job, wouldn't I?
> o Accept responsibility and produce quality work you can be proud of.
Fortunately, I have very low standards for pride.
> o Be sociable, punctual and hard working.
I prefer hubristic, lazy, and impatient.
> o Be able to communicate effectively.
Yeah, whatever.
> o Travel to clients when required (e.g., Leeds, Holland, Denmark).
Is it true what they say about the nightlife in Amsterdam?
(If you know what I mean...)
> Your work will be varied and there are many possibilities depending on
> your skill set. Most likely immediate work will be for BT (DBD::Oracle,
> Net::FTP, and lots of interesting high volume custom Perl scripting,
> mostly Solaris, some NT), and www.SmartAxis.com (smart card e-commerce).
BT? I don't even know what that means.
NT? I wish I didn't know what that means!
> Fluency in Perl 5 is essential. Fluency in RDBMS, SQL, DBI and related
> technologies is highly desirable, along with good UNIX and basic NT
> skills.
Basic NT? Is there any other kind?
> As work here is very varied, familiarity with one or more of
> these would also be advantageous (in no particular order): Oracle,
> FrameMaker, ClearCase, HTML, JavaScript, mod_perl, CGI, XML, Internet
> protocols, ErWin, C, Win32::* modules, Ingres, Grafsman, Delphi.
>
> Salary: 18K-35K depending on skills and experience.
> Start: ASAP.
> Contact: Tim.Bunce@ig.co.uk for informal interview any day/time.
> Location: 140a High Street Godalming, Surrey (just South of Guildford).
Is that the one with the fringe on top?
> Amenities: Godalming is a thriving attractive town in a semi-rural
> setting.
What about the important amenities, i.e. running water and a WC? How
semi-rural are we talking, exactly?
> Transport: 2 minute walk from Godalming main-line train station. Plus
> buses.
Watch your Godalming language!
Plus buses. Plusses bus. Buses plusses. Plusbus busepluss.
> Web site: www.ig.co.uk but it isn't representative of our main work.
That's okay, this response isn't representative of mine.
I'll be in touch!
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
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 6160
**************************************