[11724] in Perl-Users-Digest
Perl-Users Digest, Issue: 5324 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 7 22:17:25 1999
Date: Wed, 7 Apr 99 19:00:17 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 7 Apr 1999 Volume: 8 Number: 5324
Today's topics:
Re: Active State 5.09 Perl processes hanging under NT 4 <Ravens@Go-Baltimore.com>
Calculating Shipping <dbickley@up.net>
Re: Calculating Shipping (Bill Moseley)
Re: determining the browser? <cassell@mail.cor.epa.gov>
Financial Calculators & time/date stamps (Gary Harris)
Re: free computer12 <rtaylor@nbnet.nb.ca>
HELP!! ON STRING COMPARING lufan@hotmail.com
Re: How to close all file descriptors ? (Ilya Zakharevich)
Large hash tables rehash hook, gc hook alanr@mpi.com
Re: minimal pattern matching sstarre@my-dejanews.com
Modifying /var/mail/<files> without stepping on local m darryl.eaton@writeme.com
Re: Perl as a first programming language - suitability, (Larry Rosler)
Re: Perl as a first programming language - suitability, <cassell@mail.cor.epa.gov>
perldoc and PAGER (Bill Moseley)
Re: perldoc and PAGER (Ilya Zakharevich)
Re: Problem viewing data retrieved using PERL script on <cassell@mail.cor.epa.gov>
Programming a browser <akihiko42@yahoo.com>
Quantum Variable erica@coffin.org
Re: Quantum Variable (Andrew Allen)
Re: Quantum Variable <jglascoe@giss.nasa.gov>
Re: Quantum Variable (Ilya Zakharevich)
Re: Use Perl as parser? <ebohlman@netcom.com>
Whre did this GREAT Perl Reference go?? sstarre@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 07 Apr 1999 20:41:49 -0400
From: Raven513 <Ravens@Go-Baltimore.com>
Subject: Re: Active State 5.09 Perl processes hanging under NT 4.0
Message-Id: <370BFB4D.4A9F@Go-Baltimore.com>
Bill Morgan wrote:
>
> I just installed Active State Perl 5.09 under NT 4.0. We are running lots of
> Perl CGI scripts from our web server, which is Netscape Enterprise v3.6. It
> looks like some of the processes are hanging around after the scripts finish,
> because every day when I look at the NT task manager, there are 20 or 30
> Perl.exe processes in there that don't go away and are soaking up resources.
> All of our Perl scripts have explicit "exit" statements in them when they
> finish, so I'm not sure what is causing this. Has anyone else experienced
> this problem? Please email any replies as well as posting to this group.
> Thanks!
>
> ---------------------------------------------------------------------------
> William E. Morgan NAVAL SURFACE WARFARE CENTER
> Code N84 email: wmorgan@nswc.navy.mil
> 17320 Dahlgren Rd. phone: (540)653-6088
> Dahlgren, VA 22448 fax: (540)653-1810
Get the Service Pack for Netscape Enterprise Server (v3.6.1). Seems
that the folks at Netscape had a problem with CGI processes hanging on
NT when the browser was closed before the process completed.
Raven513
------------------------------
Date: Wed, 7 Apr 1999 19:42:55 -0400
From: "Don Bickley" <dbickley@up.net>
Subject: Calculating Shipping
Message-Id: <7egqi2$gas@btc3.up.net>
Hello all...
I am trying to create an order form for a client using the "Boutique Shop
Cart". Everything seems to be working ok except for the code in which to
calculate shipping, which, I'm thinking, is basic code.
What I need to do is calculate shipping and handling as $5.00 PER item, any
items 5 or more free shipping. Below is the code, which somehow some way
works at calculating $5.00 per item, but I can't stop it from caculating
items over 5 items. Any help you can give will be appreciated, and I thank
you in advance. Don
<--- HERE IS THE CODE -->
#!/usr/bin/perl5.003
$ConfigFile="boutique.cfg";
############################################################################
###
#
# NOTE: The following subroutine may be customized to calculate shipping
# costs. The following values are passed in:
#
# 1) Total Qty Ordered
# Newly we added :
# 2) Total Items
# 3) Total Weight
# The rest remains the same
# 4) Two-Character Abbreviation of State to be shipped to
# 5) Name of country being shipped to (if available)
# 6) Subtotal of Cost (aside from shipping and tax)
# 7) An array of product numbers ordered
# 8) A corresponding array of quantites ordered
#
# You should have the subroutine calculate and return
# $custom_shipping_cost. Feel free to declare any additional
# local variables you may need.
#
#
############################################################################
###
sub CalculateCustomShippingCost
{
local( $totalQty, $totalItems, $totalWeight,
$state, $country, $subtotal, *prodnos, *qtys ) = @_;
local( $customShippingCost );
#######################################################################
# PLUG YOUR CUSTOM SHIPPING COST ROUTINE IN HERE
if( $totalItems > 0 ) {
if( $country =~ /USA/ ) {
$customShippingCost = ( $totalItems - 1 ) * 0.50 + 5;
} else {
$customShippingCost = ( $totalItems - 1 ) * 5.00 + 5;
}
} else {
$customShippingCost = 0;
}
return $customShippingCost;
}
1;
<-- END CODE -->
------------------------------
Date: Wed, 7 Apr 1999 17:32:39 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Calculating Shipping
Message-Id: <MPG.1175990351b357e2989718@206.184.139.132>
In article <7egqi2$gas@btc3.up.net>, dbickley@up.net says...
> Hello all...
> What I need to do is calculate shipping and handling as $5.00 PER item, any
> items 5 or more free shipping. Below is the code, which somehow some way
> works at calculating $5.00 per item, but I can't stop it from caculating
> items over 5 items. Any help you can give will be appreciated, and I thank
> you in advance. Don
Is this what you mean?
$shiping_items_to_charge = ( $totalItems <= 5 ) ? $totalItmes : 5;
--
Bill Moseley mailto:moseley@best.com
------------------------------
Date: Wed, 07 Apr 1999 16:39:56 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: determining the browser?
Message-Id: <370BECCC.E4C65475@mail.cor.epa.gov>
Nicholas Carey wrote:
>
> On Wed, 07 Apr 1999 12:54:29 -0700, "David L. Cassell"
> <cassell@mail.cor.epa.gov> wrote:
>
> > Or else the goal is to shaft anyone using M$ products. :-)
>
> Or any using...ooh...Netscape products, for that matter.
> (prolly more likely).
A possibility too. I guessed #1 based on the return
address of the poster. However, I've been wrong a *lot*
in the last 24 hours...
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 07 Apr 1999 23:42:02 GMT
From: grharris@otmlcpas.com (Gary Harris)
Subject: Financial Calculators & time/date stamps
Message-Id: <370beba2.9204034@news.gci.net>
Greetings,
I am looking for free financial calculator perl scripts. I want
something that will do what the people at
www.timevalue.com/webcalc.htm are doing, only I want to see if I can
get it cheaper than what they are offering.
Any ideas??
Also, I have used a few of Matt Wright's scripts before. Can someone
tell me where to look in these scripts (formmail, guestbook, etc...)
for where it requests the date/time from the server and give me some
code I can add after these requests to add or subtract hours from the
query?
Case in point: Perl script resides on a server in a different time
zone from where the majority of people would be viewing the page.
Gary Harris
------------------------------
Date: Wed, 7 Apr 1999 21:35:49 -0300
From: "Richard Taylor" <rtaylor@nbnet.nb.ca>
Subject: Re: free computer12
Message-Id: <7egtrl$5u4$1@garnet.nbnet.nb.ca>
Um, Dell is more than 5 years old.
webmaster <webmaster@cnet.com> wrote in message
news:7eg4vf$bsp$9@iceman.tac.net...
> Free Computer at http://giveaways.arecool.net
>
> DELL IS GIVING AWAY 500 FREE PENTIUM 500 Computers to celebrate their 5th
> anniversary.
>
> Hurry and if you are one of the first 500 people you win a new computer!!!
>
------------------------------
Date: Thu, 08 Apr 1999 10:07:30 -0700
From: lufan@hotmail.com
Subject: HELP!! ON STRING COMPARING
Message-Id: <370CE252.61AD@hotmail.com>
hi all,
I want to filter out a set of string I don't want
to write to a file by implementing a solution like this,
- filter.log contains lines of string to FILTER OUT,
123abcd
1234a
kdfkdfj
dfkfdsfd
...
...
filter.log is read by a program like this
open(linkf,"./$linkfilter_file");
@filter_a=<linkf>;
close(linkf);
during this program I doing the comparing,
sub skip_this_link{
my($linkname)=@_;
$ii = scalar (@filter_a);
foreach($i=0; $i<$ii ;$i++){
$filter_name = @filter_a[$i];
# $filter_name = ~s/[\B|\b|\n|\r|\t|\s*|\0]//g;
if ($linkname=~/$filter_name/ ){ # <----- trouble is here
return 1; # matched
}
}
return 0; # NOT MATCHED
}
As <--- points,
$linkname=~/$filter_name/ always CAN'T match the linkname that
contains the filter string even they are identical as print out.
But $filtername=~/$linkname/ works as a part of the work I want.
I wonder if there is any tail char in filter string while
read from the filter.log, thus the the string comparing does not
work. Will appreciate if you could provide a solution for this.
THANKS
lufan
------------------------------
Date: 8 Apr 1999 00:42:31 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: How to close all file descriptors ?
Message-Id: <7egu1n$bfq$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to RJ
<raymondj@removethis.raleigh.ibm.com>],
who wrote in article <370cc7b1.24538875@mdnews.btv.ibm.com>:
> I am having a problem when I fork a new process from a CGI. The web
> client does not end the connection until the newly created process
> ends (the newly created process does not end so the client's
> connection never ends.)
>
> With a little bit of debugging I see that the web server has access to
> the newly created process through file handle 7 (as seen by the new
> process)
>
> Question: How in perl can you close all file handles? (or even a
> particular one without having a perl FILEHANDLE reference.
*Not tested*
{
local *FH;
open(FH, '<&=7') or die "open <&=7: $!";
}
(a hidden auto-close is used here).
Ilya
------------------------------
Date: Thu, 08 Apr 1999 00:43:15 GMT
From: alanr@mpi.com
Subject: Large hash tables rehash hook, gc hook
Message-Id: <7egu31$48v$1@nnrp1.dejanews.com>
I'm working with large hash tables. I've preallocated space for the tables I
know will be big, but have a feeling that I am missing something somewhere.
Is there any way I can get a function called when a hash table is to be
resized? I'd prefer to be called any time any hash table is resized so I can
quickly detect expensive rehashes.
Along these lines, I am concerned about how much memory perl is using and
reclaiming. Ideally I would like to be called before and after the gc, and be
able to call a function that reported perl's gc statistics - how much memory
is in use, how much garbage was collected, etc, so that I can see if the
memory I expect will be reclaimed actually is.
Any suggestions?
Thanks,
-Alan
( I would greatly appreciate if folks would respond to my email address,
alanr@mpi.com. I will summarize the responses to the newsgroup)
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 08 Apr 1999 00:55:25 GMT
From: sstarre@my-dejanews.com
Subject: Re: minimal pattern matching
Message-Id: <7egupp$4tj$1@nnrp1.dejanews.com>
In article <slrn7ghbgd.7mp.sholden@pgrad.cs.usyd.edu.au>,
sholden@cs.usyd.edu.au wrote:
> On Mon, 05 Apr 1999 12:13:00 GMT, sstarre@my-dejanews.com wrote:
> >
> >
> >Methinks that s/// needs another switch. I'm trying to locate all instances
of
> >strings surrounded by a delimiter in a string, such as
>
> Is there any reason you couldn't have tried any of those options before
> posting here. It only took me two minutes, hope posting was worth the wait...
>
> --
> Sam
>
Yes Sam, and the reason was that I wanted to give you another opportunity to
complain that someone didn't do a doctoral research project on a question
before posting it. Honestly, if its SOOOOO difficult to reply without adding
in complaints, why bother? You we're doing so well up to the end too...
Two minutes for someone who already knew the answer. What a surprize! Put
yourself in the poster's position for a change. At least I read the book and
tried cases myself before posting. As for the FAQs that you so fondly refer, I
get broken links more often than assistance.
I do appreciate the reply, yes I do. The insults and slurs I can do without.
-S
> compiling kernels is what I do most, so they do tend to stick to the
> cache ;) --Linus Torvalds
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 7 Apr 1999 19:20:11 -0400
From: darryl.eaton@writeme.com
Subject: Modifying /var/mail/<files> without stepping on local mail agents
Message-Id: <0685A427A719D11197BB00A024D399450ECFC901@delphi.sapient.com>
I am trying to figure out a method to modify inbox files in a /var/mail/
directory. Specifically I want to do so without causing mail to fail to
deliver any new messages while I am modifying the file.
It appears that if an inbox file is locked for too long, mail will
bounce the message. I've looked at the source code for elm, and it
appears to lock the file in the same manner I am trying to lock it
(flock and .lock file).
It seems that if I copy the file and delete it, then that operation is
quick enough not to step on mail, and all mail will be delivered that
was received during the period it was locked. However, as this script
should eventually work for a mailbox with possibly 10,000 parcels of
mail in it, it may take too long to copy it, and incoming mail would be
bounced while the file is locked.
I am working on an HP-UX, and do not have access to maillock. I want to
run this script as a normal user (should I set to mail group?).
I am writing this script in Perl, hence the posting to this group.
Perhaps there is a more appropriate group, I'll keep looking. However,
I figure that someone would have written a perl script before to operate
on inboxes.
Thanks in advance...
Darryl
------------------------------
Date: Wed, 7 Apr 1999 16:31:55 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl as a first programming language - suitability, good books ?
Message-Id: <MPG.11758ac61aefab39989860@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7egnpv$nqm$1@news8.svr.pol.co.uk> on Wed, 7 Apr 1999
23:55:34 +0100, Jonathan <jonathan@meanwhile.freeserve.co.uk> says...
>
> That's certainly a lot of replies. I'm surprised that no one seems to have
> read the Perl For Dummies book or commented on it. I've had a good look at
> it myself and I think it's quite good for its market. I certainly wouldn't
> point a non-programmer at the Llama book - it takes far too much for granted
> about the basics (what an array is, etc.) Llama would be good for a student
> in the first year of university, or someone with a little exposure to any
> language. On the other hand, I don't think it goes as far as references ?
> And Dummies does.
Here is Tom Christiansen's (unbiased :-) review, from
<URL:http://language.perl.com/critiques/index.html>:
Perl5 For Dummies
by Paul E. Hoffman
CAPSULE REVIEW: Barely achieving its two camels [So-So Books], this
book is not only made for dummies, it's guaranteed to keep you one. But
hey, if you like to have your competence and intelligence insulted
everywhere from the title to the text, then this is the book for you.
This book can't figure out the difference between an array and a list,
thinks there's a \v escape, screws up the CGI form decoding (why does
everyone do this?), doesn't understand the difference between programs
and libraries, massively screws up quoting on Win32 paths, spreads FUD
about $_, omits $!, and relegates the true heart and soul of Perl,
pattern matching and hashes, way to the end, in the chapters 14 and 15
respectively. So, it's technically screwed up, has hard-to-read style,
does nearly everything the hard way, hides the good stuff where you
won't find it, and likes to put its reader down. Even more so, it revels
in showing disrespect to anyone who seems to enjoy or be good at
programming. Perhaps this makes dummies feel good.
I guess this just goes to show you that the old adage about
avoiding books with numbers in their titles is right.
<SNIP remainder of thoughtful metalanguage discussion>
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 07 Apr 1999 17:12:25 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
To: Jonathan <jonathan@meanwhile.freeserve.co.uk>
Subject: Re: Perl as a first programming language - suitability, good books ?
Message-Id: <370BF469.C6C0882@mail.cor.epa.gov>
Jonathan wrote:
>
> That's certainly a lot of replies. I'm surprised that no one seems to have
> read the Perl For Dummies book or commented on it. I've had a good look at
> it myself and I think it's quite good for its market.
If you look more closely at it, you'll discover why no one recommended
it. You asked for a *good* book. If you travel to www.perl.org and
check out the book reviews, you'll see why it's not recommended.
'Learn Perl in 21 Days' is better rated.. and has fewer tawdry errors.
> I certainly wouldn't
> point a non-programmer at the Llama book - it takes far too much for granted
> about the basics (what an array is, etc.)
Agreed. I think I said that somewhere in the thread. I think a number
of people did.
> Llama would be good for a student
> in the first year of university, or someone with a little exposure to any
> language. On the other hand, I don't think it goes as far as references ?
> And Dummies does.
>
> The Cookbook is an excellent book, but it's pretty scary looking for a
> beginner (and doesn't address the language at all.)
Yup. Afraid so. Hence the title. :-)
Similarly, the Camel is not for beginners either.
> Regarding suggestions to learn other languages - my own first programming
> language was Basic, the second was Awful - sorry I mean Eiffel. I wouldn't
> inflict a toy or an academically designed purist language on anyone.
> Programming is about all sorts of subtle linguistic textures, idioms, and
> cues that these languages generally don't provide, and Perl does. That's
> certainly why all the talented programmers I know who have worked with
> Eiffel - several of us before using C++ or C, so there was no question of
> rejecting it merely because we used to those very opposite languages
> irst - shudder at its name. (I have a strict rule on condeming languages. I
> don't say that you should never do it, but you only have the right to
> criticise them if you had to use them for at least half a year and were good
> enough to correct the work of whoever made everyone else use the damn thing
> in the first place.)
Well, perhaps BASIC or Pascal or PL/1 would be a better choice for a total
beginner...
> Maybe Python doesn't belong to that club. *Probably* it doesn't. But I do
> understand that it's "verbose" and that it has a high ratio of people
> writing research papers about it to people using it for solving real
> problems. These I take as bad signs. Oh, and I just junk email from some
> silly ass (no one who posted here) telling me that Perl is "good for
> nothing" and that my friend should learn Python instead. This doesn't
> reflect badly on Python at all, but this sort of over defensiveness normally
> means a language is an economic dead goose, and hey, we've all got to eat.
Python is a good language. A very consistent interface. But you have
to *want* to do OOP all the time. And OOP is a big jump for someone with
no programming experience. You might be interested in Python, even
after hearing from an evangelist. You'll notice that Perl's OO style is
very Pythonesque. Hmm. I wonder how that happened. :-)
> And I *know* Perl is good. And Larry Wall certainly meant it as a language
> for people like my friend - look at the intro to the Camel book.
Perl does have something for everyone. But remember that the things
Perlites love about it can sometimes make it miserable for a rank beginner
to wade through. Just look at all the grumpy posts appearing in c.l.p.m.
> Perl can be used to write useful real world programs with only knowledge of
> the basic variable types and functions. It can encompass the idea of "many"
> effectively and simply with its powerful, simple to use arrays and hashes.
> It can provide data types (using hashes) too. There's no equivalent of the
> pointer or the copy constructor to learn (you know what I mean) and it has
> has an incredible expressive power - in Perl you say what you mean, not what
> the language forces you to say (unlike Eiffel - and Pascal looks like Eiffel
> to me.) It handles "unusual" conditions (eg trying to print undefs) with
> human-ish sense, in my book making it a far natural language than any other
> I've seen - the Perl computational model includes the computer behaving with
> common sense behaviour, the first time I've heard of such a thing. Normally
> it's this lack of "common-sense" from a PC that causes more problems for a
> non-programmer starting out than anything else. And come to think of it,
> that anti-"say what you mean" thing is often obstacle number two.
>
> ( I'd even say that Perl might make an excellent children's language, if a
> book was written to use just a simple subset and it shipped with a nice
> turtle graphics package - my one worry here would be the lurking presence of
> the special variables. They are too confusing to explain to a 12 year old,
> but if you don't what happens when one of the kids decides to call a
> variable $_ ? )
>
> Thanks for all replies,
> Jonathan Coupe.
HTH,
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 7 Apr 1999 17:40:41 -0700
From: moseley@best.com (Bill Moseley)
Subject: perldoc and PAGER
Message-Id: <MPG.11759ae04d3a9284989719@206.184.139.132>
I'm running:
This is perl, version 5.005_02 built for MSWin32-x86-object
Copyright 1987-1998, Larry Wall
Binary build 507 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 15:08:32 Nov 14 1998
perdoc Version 1.14: Wed Jul 15 01:50:20 EST 1998
It pages fine when I do a perldoc module, but -f and -q just scroll away.
Anyone know how to get perldoc -f and -q to page?
Also, can someone give a few regular expression examples that you can use
with -q ? How fancy of a re can you use?
Thanks,
--
Bill Moseley mailto:moseley@best.com
------------------------------
Date: 8 Apr 1999 00:48:03 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: perldoc and PAGER
Message-Id: <7eguc3$bje$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Bill Moseley
<moseley@best.com>],
who wrote in article <MPG.11759ae04d3a9284989719@206.184.139.132>:
> I'm running:
> This is perl, version 5.005_02 built for MSWin32-x86-object
>
> Copyright 1987-1998, Larry Wall
>
> Binary build 507 provided by ActiveState Tool Corp.
> http://www.ActiveState.com
> Built 15:08:32 Nov 14 1998
>
> perdoc Version 1.14: Wed Jul 15 01:50:20 EST 1998
>
> It pages fine when I do a perldoc module, but -f and -q just scroll away.
>
> Anyone know how to get perldoc -f and -q to page?
Upgrade. I think I put this on circa _54.
Ilya
------------------------------
Date: Wed, 07 Apr 1999 16:45:14 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
To: vvk@cs.wayne.edu
Subject: Re: Problem viewing data retrieved using PERL script on ORACLE database
Message-Id: <370BEE0A.DC24CA5E@mail.cor.epa.gov>
vinod kudva wrote:
>
> Hello
Hello. BTW, it is considered poor Netiquette to send test
messages to anywhere except alt.test and similar 'testing'
grounds. Be that as it may...
> I have writen a PERL script that accesses ORACLE database and retrieves
> the data. But the browser does not wait for the data to be returned.
> At the UNIX prompt when I run the PERL script, I see the returned data.
> But when I run the script through the browser, the script executes but
> the data is not shown on the browser. Just the short messages that I
> put in the script is returned.
>
> I know that the time taken by the databse to return the data is long.
> Is there some way, that I can make the browser wait for all the data to
> be returned before displaying it?
It's pretty hard to make an educated guess without any more
info than this. Did you use -w and -T on the first line of your
program? Did you use CGI.pm ? Did you use the DBI module to
access Oracle, and if so which DBD did you use? Maybe you could
send us a complete working program [made as small as humanly
possible so that it still demonstrates the problem] and cut-and-
paste that into your ng-reader. If you hurry, you might even
get it here before someone tells you the error is on line 17
[an old hacker joke].
HTH,
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 07 Apr 1999 21:07:42 -0400
From: Akihiko <akihiko42@yahoo.com>
Subject: Programming a browser
Message-Id: <370C015D.9A5CB2BE@yahoo.com>
I'm pretty new to Perl and I was wondering, how feasible is it to
program a graphical web browser all in Perl using Tk for the display?
What features of Perl lend to this type of development? Thanks.
-Akihiko
------------------------------
Date: Wed, 07 Apr 1999 22:49:24 GMT
From: erica@coffin.org
Subject: Quantum Variable
Message-Id: <7egndh$u7l$1@nnrp1.dejanews.com>
I believe I have found the infamous "Quantum String". I will worship for life
anyone who can help me force its behaviour into a single state.
The variable containing this unusual string is called $country.
It appears to have some mysterious escaped character on the end that does not
allow me to concatenate other strings onto the end (they disappear), yet,
executing things along the lines of:
$country =~ m/(.*\w)/;
$country = $1;
Does not force this character off. When I run quotemeta $country, I get (for
example) 'United\ States\'. When I try and strip the \s (plural of \, not the
expression for a space) from the quotemeta result, the \ on the end
reappears! I have tried everything from splitting and rejoining to
substituting anything that's not a character, space, digit, or underscore. I
cannot isolate this elusive character, nor can I strip it. Normally, I would
assume that there is a logic error, but I have a virtually identical string
coming in through another script that behaves perfectly (when quotemeta'd it
looks like 'United\ States'). Help! Has anyone else ever seen this? Is there
anything I can do?
Thanks a bunch.
Erica
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 7 Apr 1999 23:51:52 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Quantum Variable
Message-Id: <7egr2o$gcf$1@fcnews.fc.hp.com>
erica@coffin.org wrote:
: The variable containing this unusual string is called $country.
: It appears to have some mysterious escaped character on the end that does not
: allow me to concatenate other strings onto the end (they disappear), yet,
: executing things along the lines of:
: $country =~ m/(.*\w)/;
: $country = $1;
: Does not force this character off. When I run quotemeta $country, I get (for
: example) 'United\ States\'. When I try and strip the \s (plural of \, not the
: expression for a space) from the quotemeta result, the \ on the end
: reappears! I have tried everything from splitting and rejoining to
: substituting anything that's not a character, space, digit, or underscore. I
: cannot isolate this elusive character, nor can I strip it. Normally, I would
: assume that there is a logic error, but I have a virtually identical string
: coming in through another script that behaves perfectly (when quotemeta'd it
: looks like 'United\ States'). Help! Has anyone else ever seen this? Is there
: anything I can do?
what does 'print ord chop $country;' yield?
Andrew
------------------------------
Date: Wed, 07 Apr 1999 20:00:12 -0400
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: erica@coffin.org
Subject: Re: Quantum Variable
Message-Id: <370BF18C.48BDF073@giss.nasa.gov>
[courtesy copy of post sent to cited author]
erica@coffin.org wrote:
>
> I believe I have found the infamous "Quantum String". I will worship for life
> anyone who can help me force its behaviour into a single state.
>
look at the ASCII codes for each character in your string:
printf "'%s' => %03d\n", $_, ord foreach split '', $country;
perhaps you're dealing with some odd vertical tab or something.
hth,
Jay Glascoe
--
"If you substitute other kinds of intellectual property
into the GNU manifesto, it quickly becomes absurd."
--Cal Keegan
------------------------------
Date: 8 Apr 1999 00:46:40 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Quantum Variable
Message-Id: <7egu9g$bic$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to
<erica@coffin.org>],
who wrote in article <7egndh$u7l$1@nnrp1.dejanews.com>:
> I believe I have found the infamous "Quantum String". I will worship for life
> anyone who can help me force its behaviour into a single state.
>
> The variable containing this unusual string is called $country.
> It appears to have some mysterious escaped character on the end that does not
> allow me to concatenate other strings onto the end (they disappear), yet,
> executing things along the lines of:
> $country =~ m/(.*\w)/;
> $country = $1;
>
> Does not force this character off. When I run quotemeta $country, I get (for
> example) 'United\ States\'. When I try and strip the \s (plural of \, not the
> expression for a space) from the quotemeta result, the \ on the end
> reappears! I have tried everything from splitting and rejoining to
> substituting anything that's not a character, space, digit, or underscore. I
> cannot isolate this elusive character, nor can I strip it. Normally, I would
> assume that there is a logic error, but I have a virtually identical string
> coming in through another script that behaves perfectly (when quotemeta'd it
> looks like 'United\ States'). Help! Has anyone else ever seen this? Is there
> anything I can do?
In addition to other suggestions: run in debugger:
perl -d yourscript
go to the line of your script
c your-line-num
and use examiner
x $country
Ilya
------------------------------
Date: Thu, 8 Apr 1999 01:10:41 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Use Perl as parser?
Message-Id: <ebohlmanF9uJ9t.IEv@netcom.com>
Gary Fritz <fritz@frii.com> wrote:
: Sorry if this is a FAQ, but I couldn't find it anywhere, soo...
: I'd like to write a Perl script to manipulate a C-like language. I want to
: strip out comments, munge the identifier names, etc.
Take a look at the various Parse::* modules on CPAN. There are lexical
analyzers (Parse::Lex), a yacc-style parser generator (Parse::Yapp) and
hybrids (Parse::RecDescent).
------------------------------
Date: Thu, 08 Apr 1999 01:19:41 GMT
From: sstarre@my-dejanews.com
Subject: Whre did this GREAT Perl Reference go??
Message-Id: <7eh074$62c$1@nnrp1.dejanews.com>
http://sgra.jpl.nasa.gov/html_dwm/web_info/wdl/webnut/index.html
This used to be a site called Webmaster in a Nutshull, part of which was a
whole section on Perl. It was usually my first stop for reference material
for Perl, HTML, etc.. Without warning it vanished, and the webmaster isn't
answering questions. Anyone else use it? Anyone else know if it moved, or had
mirrors perchance?
Thanks & Hugs,
S
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 5324
**************************************