[12327] in Perl-Users-Digest
Perl-Users Digest, Issue: 5927 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 9 02:08:18 1999
Date: Tue, 8 Jun 99 23:00:18 -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 Tue, 8 Jun 1999 Volume: 8 Number: 5927
Today's topics:
[Announce] Turbo Perl Shareware <turboperl@erols.com>
Re: CGI.pm & submit butt...ons (Ronald J Kimball)
Converting Perl to C cor75@my-deja.com
Re: encoding an N bit two's complement value as hex. (Larry Rosler)
Re: Get Date in Perl <outlaw_torn@mailexcite.com>
Re: Get Date in Perl <uri@sysarch.com>
help using large memory from perl perrin@primenet.com
How to query a table on Win32 jbell1999@my-deja.com
Re: How to query a table on Win32 <jeff@vpservices.com>
Re: How write a perl program that connects to a remote smnayeem@my-deja.com
Installing perl5 on AIX, problem with DB (Alan Bailey)
Re: Interpreter. <fabrice@centropolisfx.com>
Job posting - Vancouver BC Canada <webmaster@walkaboutwebs.com>
logon to widget (with code)? hboutwel@ix.netcom.com
Newbie int() question (George)
Re: Newbie int() question <uri@sysarch.com>
Re: perl cgi and apache (David Efflandt)
Re: Problem to read DOS directory from SCO UNIX (David Efflandt)
quotemeta dalehend@flash.net
Regexpr for loop to handle e-address list dalehend@flash.net
Rounding excessive trailing decimals <tonyboy@earthling.net>
Re: Rounding excessive trailing decimals (Andrew Johnson)
Re: Signal/sleep hidden interaction? (Charles DeRykus)
Re: Simple newbie question... (Shawn O'Donnell)
Re: URL as a variable?? (David Efflandt)
Re: URL as a variable?? (Ronald J Kimball)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 8 Jun 1999 22:08:00 -0400
From: "Will Smith" <turboperl@erols.com>
Subject: [Announce] Turbo Perl Shareware
Message-Id: <7jki9k$fdq$1@autumn.news.rcn.net>
I am glad to announce
============================================
TurboPerl Software Version 1.20
============================================
You remember when Pascal was turbo-charged, well TurboPerl is a
turbo-charged interactive Perl programming environment for Windows. Try it,
you'll like it.
Beginners will find that TurboPerl's interactive environment makes learning
Perl easier and faster. It is now easy to modify your perl code and quickly
see what happens. Experienced Perl programmers will appreciate a quicker
edit/run cycle.
Requires Windows 95/98 or NT.
Copyright (c) 1999 by William P. Smith.
All rights reserved.
---------------------------------------------------------------------------
Download Free Shareware version
http://www.erols.com/turboperl
------------------------------
Date: Tue, 8 Jun 1999 23:58:22 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: CGI.pm & submit butt...ons
Message-Id: <1dt3qzo.4qll2u19tvpqgN@p139.block2.tc3.state.ma.tiac.com>
Luis F. Salas <unclelui@grin.net> wrote:
> * the name of the submit button on the 2nd page is the same as on
> the first one (i.e. 'abutton'). That's ok, right? It seems to me
> that that IS the way to do it.
>
> * I moved the moveon() to main, but it goes through it without
> waiting for the user to click either button on the second page.
> In other words, page displays fine, but it won't wait for the user
> to press the buttons on the 2nd page (so it can go to a third page,
> depending which button (i.e Change or Send) was cliked on).
> Why???!!!!
The moveon() subroutine should not be called until after the user clicks
on one of the submit buttons. It seems that you want the ACTION for
this FORM to refer to the *same* CGI script, which is a perfectly
acceptable thing to do. You just need a way to distinguish whether this
script is being called to create or form, or is being called to process
the form.
I like to use the extra path info for that.
The script would look something like this:
use strict;
use CGI;
my $q = new CGI; # [even though I'm using the object-oriented form
# of the CGI module here, many people now prefer
# the functional form]
my $path_info = $q->path_info() || '';
if ($path_info eq '/go') {
# process the form here
# ...
moveon(); # here's where your moveon() function would be called
# ...
} else {
# output the form here
# ...
my $url = $q->url();
print <<EOHTML;
...
<FORM METHOD="GET" ACTION="$url/go">
...
EOHTML
# observe how the ACTION for this form is the url of this script,
# with the extra path info '/go' added to the end
# ...
}
If the script is called normally, then it will output the page
containing the form. When the form is submitted, the script is called
again, but this time the extra path info tells it to process the form.
HTH!
--
_ / ' _ / - 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: Wed, 09 Jun 1999 00:52:11 GMT
From: cor75@my-deja.com
Subject: Converting Perl to C
Message-Id: <7jkdro$58v$1@nnrp1.deja.com>
Is there a program that can convert Perl script to C source code?
Thanks,
Cory
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 8 Jun 1999 21:13:19 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: encoding an N bit two's complement value as hex.
Message-Id: <MPG.11c789a1fb391d28989b9c@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <375D9EFA.4AA1903F@raytheon.com> on Tue, 08 Jun 1999 17:53:47
-0500, Robert Bell <rabell@raytheon.com> says...
> I am wanting to print an integer value as a two's complement
> encoded hex string.
>
> I have looked at sprintf and it does not give control over the
> size of the hex string. I am needing it to represent a 10 bit
> two's complement encoding (9 bits of value, 1 sign bit).
>
> sprintf appears to give me 31 bits of value and 1 bit of sign.
>
> Anyone have any ideas?
I can only guess at some of what you mean. By 'a 10 bit two's
complement encoding (9 bits of value, 1 sign bit)', I will assume you
mean that the range of numbers is 01000 (-512) to 0777 (+511). Then
this simple code fills out the sign bit to make an integer that Perl can
handle naturally.
#!/usr/local/bin/perl -w
use strict;
my $max = 0777; # or (1 << 9) - 1
for ( 01000, 01001, 01777, 0, 1, 0776, 0777 ) {
my $x = $_; # Might want $x = $_ & 01777; to be sure.
$x |= ~$max if $x > $max;
printf "%4d 0x%8.8X%5d\n", $_, $x, $x;
}
__END__
Output:
512 0xFFFFFE00 -512
513 0xFFFFFE01 -511
1023 0xFFFFFFFF -1
0 0x00000000 0
1 0x00000001 1
510 0x000001FE 510
511 0x000001FF 511
If that doesn't meet your needs, perhaps it will give you some basis for
experimenting further.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 09 Jun 1999 01:17:52 GMT
From: outlaw_torn <outlaw_torn@mailexcite.com>
Subject: Re: Get Date in Perl
Message-Id: <7jkfbo$5oa$1@nnrp1.deja.com>
Blah blah blah...let me get my violin for your sob story.
Apathy is a mans best friend. Populate the world with y2k bugs I
say...hahahahah...lets see some fuckers squirm then. It won't bother me
none.
In article <x7674y7f9h.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> wrote:
> oooooooh! i have been hurt to the bone. such wit, wisdom and eloquence
> has won me over to your myopic point of view. you have made me swear
off
> ever answering a usenet post again, especially here where i have been
> posting ever since the beginning of usenet in 1934. and i will never
> correct you or any other wrong posts again as it is better to leave
> fixing those mistakes as an exercise to the newbie. how else will they
> learn how to program perl poorly? (say perl poorly 3 times fast and
you
> will show what you know).
>
> BTW that was sarcasm, not the vulgar, childish rant of someone who
> hasn't yet faced real world criticism in their pitiful little life.
wait
> until you get out of grade school and face some real heat. your
cursing
> will win you many punches in your psychic guts. i hope you have fun
> puking out your heart in every public place you into which you ever
show
> your pimply face.
>
> how's that for some insults? no cursing (which i reserve for very big
> schmucks like bottommind. you aren't worth being that angry about.). i
am
> laughing at you as is the rest of this group. even the newbies can
tell
> what is useful and baldersdash here.
>
> as for answering the original post, others did it correctly answer it
so
> i didn't followup. but seeing your blatantly wrong and assinine
comment
> about printing out the values os localtime and figuring it out was the
> straw. it was one of the most insulting and useless posts here in a
long
> time. your comment on not having the docs was a close second. if you
> don't have them and are not sure, then you could have browsed them at
> www.perl.com to verify your misbegotten thought.
>
> 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
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 08 Jun 1999 23:15:44 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Get Date in Perl
Message-Id: <x7g1425ajj.fsf@home.sysarch.com>
>>>>> "ot" == outlaw torn <outlaw_torn@mailexcite.com> writes:
ot> Blah blah blah...let me get my violin for your sob story.
ot> Apathy is a mans best friend. Populate the world with y2k bugs I
ot> say...hahahahah...lets see some fuckers squirm then. It won't bother me
ot> none.
i don't have any sob story so what are you referring to? your apathy is
your issue. propogating stupidity in this group is an issue for the
readers of this group. so if you want to play here, stand up on that box
and take it like the little boy you are. otherwise don't ask for help
with your own perl problems (which you did yesterday). with an attitude
like that, you won't go far in any profession especially in this one so
get out while you are (a) behind.
i can't blacklist you here but i am sure i can influence others to do
so. so go elsewhere with your bullshit. at least the long flame wars
this group has seen in the past were with plain jerks who didn't
understand perl (and computer languages in general). you are just a
simpleton who is so far over his head that you don't even know you have
drowned and are in your own personal hell.
enjoy,
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: Wed, 09 Jun 1999 02:18:52 GMT
From: perrin@primenet.com
Subject: help using large memory from perl
Message-Id: <7jkiu6$6qm$1@nnrp1.deja.com>
I'm having trouble getting perl to use available RAM on a large Linux
machine. The box is a redhat 6.0 machine with 2GB RAM and 1GB swap.
I'm loading huge amounts of stuff into hash tables. The problem is, my
program dies with an "out of memory" error at about 560MB. There's
plenty of RAM left and it still dies.
At first I suspected some kind of security measure in Linux was stopping
me, but I was able to go far past 560MB using a little C program without
any problems. Then I tried switching to perl's malloc, and giving it
options for -DPACK_MALLOC and -DTWO_POT_OPTIMIZE, all to no avail.
Here is a code snippet that exhibits the same problem as my program:
perl -e 'for ($i = 0; $i < 9999999; $i++) { $hash{$i}= $i; }'
Does anyone have any ideas?
- Perrin
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 09 Jun 1999 02:11:46 GMT
From: jbell1999@my-deja.com
Subject: How to query a table on Win32
Message-Id: <7jkigt$6mt$1@nnrp1.deja.com>
Hi, all,
Are there any existing modules that I can use
as an interface to do some SQL on a table in .dbf
format(dbaseIII), which do the similar job like
DBI does on unix? I'm using ActivePerl for WindowsNT.
Many thanks.
---
Regards,
Jim
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 9 Jun 1999 04:31:29 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: How to query a table on Win32
Message-Id: <375DED8F.A1547ED2@vpservices.com>
DBI works on win32 just fine. There is a DBD::xbase module that handles
.dbf files. Get activePerl (free from www.activestate.com), read the
docummentation on the included ppm (perl package manager), and use ppm
to install DBI and DBD:xbase.
--
Jeff
jbell1999@my-deja.com wrote:
>
> Hi, all,
>
> Are there any existing modules that I can use
> as an interface to do some SQL on a table in .dbf
> format(dbaseIII), which do the similar job like
> DBI does on unix? I'm using ActivePerl for WindowsNT.
>
> Many thanks.
>
> ---
> Regards,
> Jim
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
------------------------------
Date: Wed, 09 Jun 1999 03:57:53 GMT
From: smnayeem@my-deja.com
Subject: Re: How write a perl program that connects to a remote Oracle database server without configuring any connections? NT
Message-Id: <7jkont$8ld$1@nnrp1.deja.com>
In article <375D340F.E76C7600@pyramid.de>,
Dominik Leinfelder <dominikl@pyramid.de> wrote:
> Lim Chong Sun schrieb:
>
> > No text!
>
> No way!
>
> I think _minimum_ requirements you'll need is a tnsnames.ora file,
where
> your server and the DB you want to access is defined. It's included in
> some kind of client, which garants you access to the DBserver...
> Further I dont't think, simply downloading oraperl or DBD:ORACLE stuff
> will help much w/o client...
>
> If I'm wrong or someone has other experience - pls pls pls tell me
(us)
I know how to connect to oracle on the local machine, however to connect
to the remote server we need to have the SQL*Net client installed and
have to find some way of passing the HostString which identifies the
remote database on the tnsnames.ora file. But i dont know how to send
this HOSTSTRING to the DBD interface, anyone knows... ?
thanks
smnayeem
smnayeem@agni.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 09 Jun 1999 02:37:29 GMT
From: awbaileyUSENET@uiuc.edu (Alan Bailey)
Subject: Installing perl5 on AIX, problem with DB
Message-Id: <375dd219.10610435@news-proxy.cso.uiuc.edu>
I'm trying to install perl-5.005_03 on AIX 4.3
Here's an excerpt from running Configure (nevermind the WHOA THERE):
---------
<db.h> found.
*** WHOA THERE!!! ***
The previous value for $i_db on this machine was "undef"!
Keep the previous value? [y] n
Checking Berkeley DB version ...
I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB.
---------
Now I know that it's a problem with the DB stuff, but can anyone give
me some more hints?
And another question, do the other DBM types (SDBM, NDBM, ODBM)
inherit from the normal Berkeley DB or in some way depend on it? I'm
having trouble when i run make after this with building NDBM, and was
wondering if the two problems were related.
Specifically,
it gives on of the warnings like so: (I don't remeber it right now)
Missing Library: (probably unharmful) -lndbm
but I'm sure you guys know what I'm talking about.
So could anyone give me some help on either of these problems, or if
they are related?
Thanks
Alan
,-=-=-=-=-=-=-=-=-=-=-=-=-
| Alan Bailey
| awbailey @ uiuc.edu
| www.iit.edu/~bailela/
`-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Tue, 08 Jun 1999 19:09:18 -0700
From: Fabrice Ceugniet <fabrice@centropolisfx.com>
Subject: Re: Interpreter.
Message-Id: <375DCCCE.64B29137@centropolisfx.com>
Bill Jones wrote:
>
> In article <375C6B3E.9C5D2D0@centropolisfx.com>, Fabrice Ceugniet
> <fabrice@centropolisfx.com> wrote:
>
> >
> > The Perl application I am writing would need an interpreter.
> > Does anyone have an idea of what already exist in Perl. Is there
> > any lex/yacc equivalent in Perl ? Is it possible to give Perl a
> > grammar ?
> > Thanks for the input,
>
> Uhhh, run that by me again... ?
>
> Perl understands Perl perfectly well.
> What is the problem you are having with
> perl evaluating/executing itself?
This is a solution. Thanks.
f.
>
> /^\?$/;
> -Sneex- :]
> __________________________________________________________________
> Bill Jones | FCCJ DSS | Life is a 'Do it yourself' thing...
> http://www.fccj.org/cgi/mail?dss
>
> Jacksonville Perl Mongers
> http://jacksonville.pm.org
> jax@jacksonville.pm.org
>
> 'Be not the first by whom the new are tried,
> nor yet the last to lay the old aside...'
--
xx Fabrice Ceugniet Centropolis Effects LLC
xx 10950 W. Washington Blvd Studio B Culver City CA 90232
xx fabrice@centropolisfx.com phone: 310 204 7300 (x148)
------------------------------
Date: Wed, 09 Jun 1999 05:04:03 GMT
From: Duane Nickull <webmaster@walkaboutwebs.com>
Subject: Job posting - Vancouver BC Canada
Message-Id: <375DF44E.752C5D80@walkaboutwebs.com>
G'day all:
I apologize in advance for this intrusion onto perl related discussion.
We are in need of two full time Perl/Unix/Linux programmers in
Vancouver, BC Canada. In a final bid of desperation, I decided to post
this message.
if (anyone is in the area || knows of someone who is looking for work
here) {
please send me an E-mail Privately
{
Thank you.
D. Nickull
webmaster@walkaboutwebs.com
------------------------------
Date: Wed, 09 Jun 1999 00:36:43 -0400
From: hboutwel@ix.netcom.com
Subject: logon to widget (with code)?
Message-Id: <375DEF5B.CD7D2DFC@ix.netcom.com>
I need to know how to print password and user name to a widget.
The code below would grab the url, parse the text and spit the
results out to the browser, except that the page is password
protected by a Front Page form/widget/whatever.. Using a query
string to pass on user name and password doesn't work.
Code examples, FAQs and any other suggestions appreciated.
Many thanks
Here's the code:
#!/usr/bin/perl
## Script Logs on to page and spits out text to browser.
use CGI;
use CGI::Carp (fatalsToBrowser);
use LWP::Simple;
$q = new CGI;
print $q->header;
$URL =
"http://http://www.vegasodds.com/members/scores.htm";
## The above urls is protected with a Front Page Widget. Where and how
do I print username and password?
unless (defined ($page = get($URL))) {
die "There was an error getting URL: $URL\n";
}
@page = split(/\n/,$page);
&page_header;
$start=0;
foreach $line (@page){
print "$line\n" if($start == 1);
if($line =~ /Computer Sports World, Inc./){
$start = 1;
}
last if($line =~ /keep it going/);
}
&page_footer;
sub page_header{
print<<HTML;
<CENTER><FONT SIZE=5 FACE=ARIAL>
Yesterday's Scores for</FONT>
</CENTER><P><P><CENTER><PRE>
HTML
}
sub page_footer{
print<<HTML;
</PRE> </CENTER><P>
HTML
}
------------------------------
Date: Wed, 09 Jun 1999 03:13:19 GMT
From: fred222@mauimail.com (George)
Subject: Newbie int() question
Message-Id: <fred222-ya023580000806992311010001@news.bellatlantic.net>
I'd appreciate some help on how to use int(). I seem to recall that this
function takes a number and rounds it to the nearest integer, but when I
write int($whatever), $whatever does not change and Perl complains that int
is used in void context.
I'm afraid I am rather a newbie to Perl and Linux; I would greatly
appreciate any help which anyone could afford me. If any replies could be
cross-emailed to me at the following address without the NOSPAM, I would
greatly appreciate it:
yurtle@bellatlantic.netNOSPAM
Best regards,
George
--
Just another hacking head >l-d
------------------------------
Date: 08 Jun 1999 23:22:18 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Newbie int() question
Message-Id: <x7aeua5a8l.fsf@home.sysarch.com>
>>>>> "G" == George <fred222@mauimail.com> writes:
G> I'd appreciate some help on how to use int(). I seem to recall
G> that this function takes a number and rounds it to the nearest
G> integer, but when I write int($whatever), $whatever does not change
G> and Perl complains that int is used in void context.
why do you seem to recall rather than try to read the docs on int?
to quote perldoc -f int:
=item int EXPR
=item int
Returns the integer portion of EXPR. If EXPR is omitted, uses $_.
so you see it returns a value. and it is not rounded but truncated.
G> appreciate any help which anyone could afford me. If any replies could be
G> cross-emailed to me at the following address without the NOSPAM, I would
you post here, you read here.
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: 9 Jun 1999 02:32:45 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: perl cgi and apache
Message-Id: <slrn7lrk7v.in.efflandt@efflandt.xnet.com>
On Tue, 08 Jun 1999 13:35:49 GMT, fezzzza <fezzzza@yahoo.com> wrote:
>
>Please help I cant seem to get my perl script running on apache on red
>hat 6.0 I get a server error
>
>on looking at the error logs I get a [error[ (2) no such file or
>directory :exec of /home/httpd/cgi-bin/hello.cgi failed
This does not necessarily mean that the server cannot find the script, it
could mean that bash cannot find a file called '!' (see below).
>I have set all the directorys and and to chmod 777 and inable the suid
>bit flag on perl.
Never give any file 777 permission. CGI is usually 755.
>in the script the firslt line is !#/usr/bin/perl I have tried moving
>the perl file to the cgi-bin and chaing it to !#perl
That explains it, the #! is reversed. Try #!/usr/bin/perl
>perl /home/httpd/cgi-bin/hello.cgi it works fine
But that does not tell you if the first line is wrong or if the script
contains nasty DOS carriage returns. You should test it WITHOUT the
'perl' in front of it. Or from cgi-bin just type './hello.cgi' (without
quotes).
--
David Efflandt efflandt@xnet.com
http://www.xnet.com/~efflandt/
------------------------------
Date: 9 Jun 1999 03:02:10 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Problem to read DOS directory from SCO UNIX
Message-Id: <slrn7lrlv5.in.efflandt@efflandt.xnet.com>
On Tue, 8 Jun 1999 08:23:54 +0300, Boris Bakulin <bakulin@eximb.kiev.ua> wrote:
>
>#!/usr/bin/perl
>
>use File::Copy;
>my $my_dir = "C:/";chdir($my_dir) || die "Can't change directory! $!";
>
>>From SCO Unix I want to read DOS directory and I can't do it.
>Ansqer is 'No such file or directory'
Do an 'ls -al' in the directory containing the script, and if you do not
see a directory called 'C:' then consider that error statement true.
Whether you can use mount (see 'man mount') to actually mount your DOS
drive there depends upon whether the drive is on the same machine (dual
boot?). Although, you might more typically mount it at /mnt/dos_c or
/mnt/win95c.
>I read FAQ but didn't find answer
Probably wrong FAQ and wrong newsgroup. You need a FAQ about mounting
local (or remote?) hard drives in Unix.
>If anybody can help ,please
>
>Boris
--
David Efflandt efflandt@xnet.com
http://www.xnet.com/~efflandt/
------------------------------
Date: Wed, 09 Jun 1999 05:53:56 GMT
From: dalehend@flash.net
Subject: quotemeta
Message-Id: <375e014a.43139140@news.flash.net>
I have quotemeta to put the backslash before a non-alphanumeric
character. How about taking it out? Is there a function to take the
backslash out?
------------------------------
Date: Wed, 09 Jun 1999 04:26:06 GMT
From: dalehend@flash.net
Subject: Regexpr for loop to handle e-address list
Message-Id: <375debc9.37631571@news.flash.net>
Does have an example that I can expand on in order to parse a quoted
email list that can be 1 or more lines. In other words -
"john\@town.com ben\@town.com younme\@work.com
sebastian\@town.org isaac\@town.org"
I want to expand on it in order to delete and add to the list. Thanks
for any replies
------------------------------
Date: Tue, 08 Jun 1999 23:20:40 -0400
From: "Anthony Lalande" <tonyboy@earthling.net>
Subject: Rounding excessive trailing decimals
Message-Id: <7jkmc9$9kc@tandem.CAM.ORG>
Greetings,
I can't seem to find a way to have PERL return a shortened version of a
number such as (1.94456543 -> 1.94 or 1.9).
Can anyone help me with this?
Regards,
- Anthony Lalande
------------------------------
Date: Wed, 09 Jun 1999 04:02:16 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Rounding excessive trailing decimals
Message-Id: <cHl73.2146$WL.67842@news2.rdc1.on.home.com>
In article <7jkmc9$9kc@tandem.CAM.ORG>,
Anthony Lalande <tonyboy@earthling.net> wrote:
! Greetings,
!
! I can't seem to find a way to have PERL return a shortened version of a
! number such as (1.94456543 -> 1.94 or 1.9).
!
! Can anyone help me with this?
help yourself to the copious documentation and faqs:
perlfaq4.pod: Does Perl have a round() function?
What about ceil() and floor()? Trig functions?
regards
andrew
--
Reality is that which, when you stop believing in
it, doesn't go away.
-- Philip K. Dick
------------------------------
Date: Wed, 9 Jun 1999 03:47:07 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Signal/sleep hidden interaction?
Message-Id: <FD1JuJ.Fo7@news.boeing.com>
In article <7jh0l2$tjf$1@nnrp1.deja.com>, <dhosek@quixote.com> wrote:
>I'm writing a simple daemon script which effectively has a loop along
>the lines of
>
>while ($ok) {
> sleep 50;
> ping_test(foo,10);
>}
> .....
> eval {
> open (PING, "ping -c 1 $_[0] |")
or die "can't fork a pipe: $!";
> ....
> };
> close (PING);
or die "can't close pipe: $?";
> .......
>There's more but this is essentially the key stuff. I also have a
>handler in place to catch sighup which should restart the daemon, but it
>seems that when the program's in sleep status, it doesn't hear the
>sighup. What do I need to do to make this work?
Strange. What OS? How do you daemonize and what does
the SIGHUP handler look like? That may provide some
needed clues.
(Also, I've added some advisable error checks on your
open and close calls)
Regards,
--
Charles DeRykus
------------------------------
Date: Wed, 09 Jun 1999 00:58:49 -0400
From: shawn@ultranet.com (Shawn O'Donnell)
Subject: Re: Simple newbie question...
Message-Id: <shawn-0906990058490001@d183.dial-1.cmb.ma.ultra.net>
In article <uocpv3bk3zt.fsf@evelake.pdl.cs.cmu.edu>, Nat Lanza
<magus@cs.cmu.edu> wrote:
> mark@islandnet.com (Mark Morley) writes:
>
> > Seems to me the only real solution is to change the lookup function to
> > indicate a failure via some other result code.
>
> This would be why we have 'undef'.
Yes, and 'defined'. I think undef and "" will create the same problem as
0 and "0" unless Mark uses defined for the test.
Mark--your problem is a symptom of trying to send special cases and error
codes through the same channel as real results. undef goes a long way
towards solving the problem, so long as you can manage to outlaw undef as
a valid result.
For accounts of the perils awaiting those who use the same channel to
communicate successful values and errors, consult your local newspaper
exactly three months and one day from now. (Tip courtesy the Perl Psychic
Hotline.)
--Shawn
------------------------------
Date: 9 Jun 1999 03:30:19 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: URL as a variable??
Message-Id: <slrn7lrnk0.in.efflandt@efflandt.xnet.com>
On Mon, 7 Jun 1999 20:48:22 -0700, Blake Starkenburg
<support@webintention.com> wrote:
>Is it possible or is the URL of a current browser window set to a variable.
>I know I can get the $QUERY_STRING or $SERVER_NAME but is it possible to get
>the complete URL, say this was displayed in the browser address bar
>
>http://www.something.com/aplace/cgi-bin/?name=one&place=two
>
>is that set as a variable???? is it possible to call it in a PHP or Perl
>script??
>All help is greatly appreciated
You can piece it together from (Apache example):
"http://$ENV{HTTP_HOST}$ENV{SCRIPT_NAME}$ENV{PATH_INFO}$ENV{QUERY_STRING}"
or if using CGI.pm it is: self_url
--
David Efflandt efflandt@xnet.com
http://www.xnet.com/~efflandt/
------------------------------
Date: Tue, 8 Jun 1999 23:58:25 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: URL as a variable??
Message-Id: <1dt3u7b.1hine52z6mruoN@p139.block2.tc3.state.ma.tiac.com>
Blake Starkenburg <support@webintention.com> wrote:
> Is it possible or is the URL of a current browser window set to a variable.
> I know I can get the $QUERY_STRING or $SERVER_NAME but is it possible to get
> the complete URL, say this was displayed in the browser address bar
>
> http://www.something.com/aplace/cgi-bin/?name=one&place=two
>
> is that set as a variable???? is it possible to call it in a PHP or Perl
> script??
> All help is greatly appreciated
#!/usr/local/bin/perl
use CGI qw(:standard);
print self_url();
__END__
HTH!
--
_ / ' _ / - 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 5927
**************************************