[17362] in Perl-Users-Digest
Perl-Users Digest, Issue: 4784 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 1 11:17:27 2000
Date: Wed, 1 Nov 2000 08:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <973094708-v9-i4784@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 1 Nov 2000 Volume: 9 Number: 4784
Today's topics:
Re: About killing processes?? <rick.delaney@home.com>
Re: About killing processes?? <lr@hpl.hp.com>
Re: CGI file uploading <amonotod@netscape.net>
Re: Collecting data <amonotod@netscape.net>
Re: Converting long integers to hex and vice versa <EUSWMCL@am1.ericsson.se>
Re: Creating a new user in FreeBSD (Martien Verbruggen)
Re: Device Modem : ioctl disabled <phil_xxx@my-deja.com>
Re: Having a brain fade dottiebrooks@my-deja.com
How can Perl on Win32 recognize troublesome Macintosh f <dpc3k@virginia.edu>
Re: In case you were wondering <amonotod@netscape.net>
Re: INTERACTIVE DEBUGGER !!?? <tzz@heechee.beld.net>
Re: Keeping a List of Objects <tzz@heechee.beld.net>
Re: Net::SMTP and attachments <ruedas@geophysik.uni-frankfurt.de>
Re: Perl Question <amonotod@netscape.net>
Re: Perl Question <camerond@mail.uca.edu>
Re: Printing a perldoc (Tom Christiansen)
Re: problem with REFERER <adamf@box43.gnet.pl>
Re: regexp substitution help needed <ren.maddox@tivoli.com>
Re: regular expression <lr@hpl.hp.com>
Re: regular expression <emerado@wpi.edu>
Re: Rounding numbers in perl <tzz@heechee.beld.net>
Re: Rounding numbers in perl Gordon.Haverland@agric.gov.ab.ca
sending webpage form digihoo@hotmail.com
SMS - text messaging <sjd256@yahooNOSPAM.co.uk>
Unicode::Map8 schnurmann@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 01 Nov 2000 14:11:28 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: About killing processes??
Message-Id: <3A00279B.C5069690@home.com>
[posted & mailed]
Esa Vihtonen wrote:
>
> Ok - hereŽs the deal.
>
> I want to run a c-program which will be started using perl script. What
> would be the easiest way for controlling the time that c-program has been
> running and how to kill it if running time gets too long (for example the
> c-program has got into neverending loop)?
Completely untested and most error checking omitted:
$pid = fork;
if ($pid) {
exec 'c_program';
die "exec failed: $!";
}
else {
eval {
local $SIG{ALRM} = sub { die "alarm clock restart" };
alarm 10;
waitpid($pid, 0);
alarm 0;
};
if ($@ and $@ !~ /alarm clock restart/) {
warn "c_program timed out\n";
kill TERM => $pid;
}
}
Be sure to look up all those functions in perlfunc. Also see perlfaq8:
How do I timeout a slow event?
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Wed, 1 Nov 2000 06:29:59 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: About killing processes??
Message-Id: <MPG.1469c8c1d77c79798ae8a@nntp.hpl.hp.com>
In article <8tp08e$t2d$1@juuri.cc.lut.fi>, esa.vihtonen@lut.fi says...
> Ok - hereŽs the deal.
No big deal.
> I want to run a c-program which will be started using perl script. What
> would be the easiest way for controlling the time that c-program has been
> running and how to kill it if running time gets too long (for example the
> c-program has got into neverending loop)?
perlfaq8: "How do I timeout a slow event?"
> IŽve never been part of these newsgroups but if someone could help me with
> the problem, iŽd be very happy =)
You can get a good start by skimming the titles of the questions in the
voluminous Perl FAQ.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 01 Nov 2000 14:12:09 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: CGI file uploading
Message-Id: <8tp8bh$se2$1@nnrp1.deja.com>
In article <8tousl$l07$1@nnrp1.deja.com>,
stupot999@my-deja.com wrote:
> i am trying to find out how to use cgi to allow
> people to upload files to my server. i have made
> the neccessary html page all i need toknow is how
> to get it to be uploaded.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Hey, I get to say it again: Deja has newgroup search as well as newgroup
post! Check it out:
http://www.deja.com/dnquery.xp?ST=QS&DBS=2&groups=comp.lang.perl.misc&QR
Y=upload+cgi&svcclass=dncurrent
HTH,
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 01 Nov 2000 14:09:02 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Collecting data
Message-Id: <8tp85m$sa0$1@nnrp1.deja.com>
In article <u9r94wrq1p.fsf@wcl-l.bham.ac.uk>,
nobull@mail.com wrote:
<snipped some very good recommendations on remote execution>
> > `F:\scriptRun.pl`; #F drive which I map to Unix box by using
> > Samba
> >
> > Is it possible? If not any suggestion? Thanks.
>
> This is closest to the Samba approach, but you need to simply open the
> file and, of course, configure Samba appropriately.
Are you sure about that? Seems to me it'd be run as a local process,
not the remote process that the OP seemed interested in. At this point,
he's using the Samba box as a network storage device, not as a remote
procedure call (RPC) server. Although, you have to wonder, is the
script bound to Unix, or can it be run under Win32? If the latter, then
it really doesn't matter where(1) it gets called from, as long as it has
access to all partitions and libraries it needs access to...
(1) When I say where, I am referring to whether it would be a remote
Unix process, or a local Win32 process.
Just my thoughts,
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 01 Nov 2000 09:29:29 -0500
From: William Cardwell <EUSWMCL@am1.ericsson.se>
Subject: Re: Converting long integers to hex and vice versa
Message-Id: <3A0028C9.2663DCAB@am1.ericsson.se>
Steffen Beyer wrote:
>
> In article <39FDEA65.6AB712C5@am1.ericsson.se>, William Cardwell <EUSWMCL@am1.ericsson.se> wrote:
>
>
> test.pl:
> -------------------- cut here -------------------- cut here --------------------
> #!perl
>
> use Bit::Vector;
>
> $v = Bit::Vector->new_Dec(80,"06625632382998574462");
> print $v->to_Hex(), "\n";
>
> -------------------- cut here -------------------- cut here --------------------
>
> [sb@muccpu1]~>perl test.pl
> 00005BF2F98C58F4757E
>
> Hope this helps! :-)
>
> Best regards,
> --
> Steffen Beyer <sb@engelschall.com>
> http://www.engelschall.com/u/sb/whoami/ (Who am I)
> http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
> http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)
Thanks so much for this...quite compact. I will read up on Bit::Vector.
Regards,
Will Cardwell
------------------------------
Date: Thu, 2 Nov 2000 01:58:57 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Creating a new user in FreeBSD
Message-Id: <slrn900btg.ac5.mgjv@martien.heliotrope.home>
On Wed, 01 Nov 2000 15:12:44 +0300,
Shtirlitz <s_h=t-i_r@astelit.ru> wrote:
> On Wed, 1 Nov 2000 22:09:33 +1100, mgjv@tradingpost.com.au (Martien
> Verbruggen) wrote:
>
> >On Wed, 01 Nov 2000 12:59:49 +0300,
> > Shtirlitz <s_h=t-i_r@astelit.ru> wrote:
> >> Hello!
> >>
> >> How can I create new uaser account under FreeBSD?
> >
> >You use the tools that FreeBSD provides for that. To find out which ones
> >they are, ask on a FreeBSD group, read the manual pages, or visit
> >www.freebsd.org. You do not do this with Perl.
>
> So, I need to run an external FreeBSD util ( adduser ) ?
That's what I would do. It's much too much work, and much too error
prone to try to write those tools yourself. By all means wrapper the
tools in something of your own, maybe something that presents a little
menu, prompts for input, allows addition of a user, removal of one,
archival of a user's home directory, and does all the right things the
right way, and checks for errors. But do call the standard tools that
come with your system to do the real work.
I've stopped using wrapper tools a long time ago. I normally now call
adduser, or useradd, or whatever the system offers directly, or I edit
the NIS master files manually. Once all that is done, I run a script on
the appropriate hosts that creates home directories (or removes them),
mailboxes, copies skeleton files based on the role of the person, and
dumps a welcome mail in their mailbox. There are other things that
happen based on all kinds of parameters, one of which is the phase of
the moon.
But I guess that every beginning sysadmin at some time in their life
wants to write their wrappers :)
Martien
--
Martien Verbruggen | Since light travels faster than
Interactive Media Division | sound, isn't that why some people
Commercial Dynamics Pty. Ltd. | appear bright until you hear them
NSW, Australia | speak?
------------------------------
Date: Wed, 01 Nov 2000 15:03:20 GMT
From: Phil xxx <phil_xxx@my-deja.com>
Subject: Re: Device Modem : ioctl disabled
Message-Id: <8tpbbi$v2e$1@nnrp1.deja.com>
Still looking for some help on this one!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 01 Nov 2000 14:24:14 GMT
From: dottiebrooks@my-deja.com
Subject: Re: Having a brain fade
Message-Id: <8tp923$sv0$1@nnrp1.deja.com>
In article <4j100tc1ggfajesmg2s39mhvmpjtrd50qj@4ax.com>,
Bart Lateur <bart.lateur@skynet.be> wrote:
> dottiebrooks@my-deja.com wrote:
>
> >I need to do some work on all combinations of a variable number of
> >fields. For example, if the current run has 3 variables (A, B, C), I
> >need to pull input for analysis of A, AB, AC, ABC, ACB, B, BA, BC,
> >BAC,... The next run could have 4 variables, for example.
>
> This sound like a job for a binary counter. Actually, you can use an
> ordinary counter, and use each bit of it as a flag, indicating if you
> need to include that "variable".
>
> sub getemall {
> my @result;
> for my $i (1 .. 1<<@_) {
> push @result, [ map { ($i & 1<<$_)?$_[$_]:() } 0..$#_];
> }
> return @result;
> }
> print "@$_\n" foreach getemall('A', 'B', 'C', 'D');
>
> --
> Bart.
>
Thanks to everyone who responded. This is pretty close. I'm going to
try to get it to include a few results like ADC and ABDC, but this is a
great start. Thanks again.
Russ
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 1 Nov 2000 09:58:42 -0500
From: "Doug Coppage" <dpc3k@virginia.edu>
Subject: How can Perl on Win32 recognize troublesome Macintosh filenames?
Message-Id: <8tpb3b$eog$1@murdoch.acc.Virginia.EDU>
Greetings, Earth Creatures!
I have put in place a simple Perl script on our department's WinNT server
that traverses the trees of public directories and deletes all files that
are more than N days old. It works fine *except* that filenames made by
sneaky Macintosh users can have characters that are illegal in Windows and
important in Perl, e.g. "Report 10/04/00". Hmm: those strokes are nasty.
The Perl script finds these files in a loop using readdir (as attested by a
print statement), but a test like
if ( -f $filespec )
returns FALSE. Therefore, calls to find the ages of these files fail, as do
attempts to rename them or to perform all other file tests or operations.
So, without some way to get past the funky filename characters, the Perl
script is powerless.
I have manipulated the files using DOS commands and the Windows menus, and
yes, they are files of the ordinary variety (MS Word docs, TIFFs, etc.),
only with troublesome chars in the filenames.
Q: Is there another way to grab these files and manipulate them via Perl?
Any suggestions would help very much.
Thanks,
---Doug Coppage
===========================================
Douglas P. Coppage, dpc3k@virginia.edu
Microcomputer Support Specialist
ITC - Academic Computing for the Health Sciences
University of Virginia, Charlottesville, VA
http://www.med.virginia.edu/achs
===========================================
------------------------------
Date: Wed, 01 Nov 2000 14:36:06 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: In case you were wondering
Message-Id: <8tp9om$tp3$1@nnrp1.deja.com>
In article <39ff4410.361e$235@news.op.net>,
mjd@plover.com (Mark-Jason Dominus) wrote:
>
> In article <SpGL5.195$v37.180435@news.uswest.net>,
> Jerome O'Neil <jerome.oneil@360.com> wrote:
> >mjd@plover.com (Mark-Jason Dominus) elucidates:
> >
> >> For the record, the dish I ordered was chicken livers sauteed in
> >> pomegranate molasses.
> >
> >And what was the final verdict?
>
> It was tasty, but disappointingly mundane. I would not have had any
> idea that it had been cooked in pomegranate molasses if I had not been
> told.
>
> Despite his assertion to the contrary, ("I ordered something vaguely
> meat-like and safe") Nat ordered a dish of braised dandelion greens.
> I liked them; he didn't.
>
And do you now go out into your backyard every summer, killing the
grass so that the dandelions can thrive? My wife's cousin has
fermented dandelion wine the last several years...
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 01 Nov 2000 09:27:09 -0500
From: Ted Zlatanov <tzz@heechee.beld.net>
Subject: Re: INTERACTIVE DEBUGGER !!??
Message-Id: <m3hf5rojia.fsf@heechee.beld.net>
tchrist@perl.com (Tom Christiansen) writes:
> In article <39ff5a6c.1926823@news.one.net.au>, Christopher James <chris@hitsquad.com> wrote:
> >You guys know of any interactive visual debugger for perl ?
> >Wanna watch my variables and stuff...
>
> First, see perldebug(1), or see the appropriate chapter in the
> current Camel. Certainly it can "watch your variables and stuff".
>
> As for the visual part, I guess that means keeping your eyes open. :-)
It would be unfair to omit the Devel::Ptkdb module, which is very nice
for beginners. It is on CPAN (http://search.cpan.org). I have found
it useful many times.
--
Teodor Zlatanov <tzz@iglou.com>
"Brevis oratio penetrat colos, longa potatio evacuat ciphos." -Rabelais
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: 01 Nov 2000 09:44:16 -0500
From: Ted Zlatanov <tzz@heechee.beld.net>
Subject: Re: Keeping a List of Objects
Message-Id: <m3d7gfoipr.fsf@heechee.beld.net>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:
> There are situations where all (or some) objects of a class must be
> notified (updated) in case of an event. So the new() method pushes
> a reference to each object on an array to have them all accessible.
> We don't want the objects to collect indefinitely on the list, so
> the next step is to write a DESTROY method that removes an object
> when it gets out of scope. The catch is that an object *doesn't* go
> out of scope as long as it is on the list, so the DESTROY method is
> never called. (Well, it is called during global destruction, but
> that's too late to be useful.)
It seems that you want to have your cake and eat it too - you want to
keep references to objects, but also have those objects go out of
scope automatically. I don't think that's possible with plain
references.
> Is there a general solution to this problem? The situation can't be
> rare.
There must be an explicit release of the object when it is no longer
needed, if you explicitly keep a reference to it. So the notification
list manager, on its own volition or through a method invoked by the
object, should be the one to remove the object reference from the
list.
I think you are blurring the line between garbage collection,
reference counting, and similar interpreter-side functionality with
the program-side functionality of event notification.
--
Teodor Zlatanov <tzz@iglou.com>
"Brevis oratio penetrat colos, longa potatio evacuat ciphos." -Rabelais
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Wed, 01 Nov 2000 15:46:44 +0100
From: Thomas Ruedas <ruedas@geophysik.uni-frankfurt.de>
Subject: Re: Net::SMTP and attachments
Message-Id: <3A002CD4.BB72023D@geophysik.uni-frankfurt.de>
Thanks to Rick Delaney and MNJP; I tried it with MIME::Lite now, and it
works fine.
--
Sign the Linux Driver petition:
http://www.libralinux.com/petition.english.html
------------------------------------------------------------------------
Thomas Ruedas
Institute of Meteorology and Geophysics, J.W.Goethe University Frankfurt
e-mail: ruedas@geophysik.uni-frankfurt.de
http://www.geophysik.uni-frankfurt.de/~ruedas/
------------------------------------------------------------------------
------------------------------
Date: Wed, 01 Nov 2000 14:24:46 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Perl Question
Message-Id: <8tp934$svd$1@nnrp1.deja.com>
I've reordered your message, so I can make fun of you, but I still have
an answer at the bottom...
In article <I9UL5.3$zf7.232@news1.cableinet.net>,
"Graeme Turner" <graemeturner@blueyonder.co.uk> wrote:
> Hello, I am at University and for my dissertation I aim to make an
> online commentary system for football.
<snipped, moved below>
> I would really appreciate any help
> Thanks
> Graeme
How can it then be YOUR disseratation? Would you give credit in your
paper to all who helped you? If so, would that hold down your grade,
and possibly prevent your degree being granted? Hmmm?
>
> I aim to have a java applet which allows the user to update events
> during a game. Any events entered will be broadcast to all people
> connected to the socket.
>
> Does anyone know how to pass numerous variables into a java applet
> from a perl script (I will be obtaining several values from a mysql
> database). Once the Java applet has finished, how can I get values
> of the variables inside the applet back into a CGI script??
>
> There will be a lot of variables being passed into and out of the
> applet. It would need to be a POST method used to send the data back
> out of the applet
Why are you doing that? It is possible, you'll just have to use HTTP
methods for both the script and the applet, but the organizational
overhead (keeping track of all the variables) is going to kill you.
Why don't you just access the MySQL from the Java servlet? Go here:
http://www.google.com/search?q=java+mysql
HTH,
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 01 Nov 2000 08:34:46 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Perl Question
Message-Id: <3A002A06.1DA9C9AF@mail.uca.edu>
Tad McClellan wrote:
>
> On Wed, 01 Nov 2000 12:39:04 GMT, Graeme Turner
> <graemeturner@blueyonder.co.uk> wrote:
> > Subject: Perl Question
>
> >I would really appreciate any help
>
> You could greatly increase the chances of getting help if you
> would put the subject of your article in the Subject header
> of your article.
>
> Your article was likely widely ignored.
>
> When you post to clpmisc you are in competition with every other
> poster, and there are lots and lots of them. (and *all* of them
^
insert word "ideally" here :(
> have a "Perl Question")
Comment to above statement: A large percentage of the posts which have
as a subject "Perl (something)" are not about Perl, and thus are even
more widely ignored than those with totally meaningless subject lines,
if memory serves me correctly.
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: 1 Nov 2000 07:23:30 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: Printing a perldoc
Message-Id: <3a002762@cs.colorado.edu>
In article <39ff9d7c.118639452@news.webperception.com>, <mike> wrote:
>How can I convert perldoc DBI to a text file so I can print it?
Huh? That *is* text!
If you have a file with pod in it, the easiest (although perhaps
not the prettiest) way to view just the formatted pod would be:
% pod2text DBI.pm | more
pod2man converts pod into Unix manpage format suitable for viewing
through nroff(1) or creating typeset copies via troff(1). For
example,
% pod2man DBI.pm | nroff -man | more
or
% pod2man DBI.pm | troff -man -Tps -t > tmppage.ps
% ghostview tmppage.ps
and to print a nice copy:
% lpr -Ppostscript tmppage.ps
--tom
------------------------------
Date: Wed, 01 Nov 2000 16:24:55 +0100
From: Adam <adamf@box43.gnet.pl>
Subject: Re: problem with REFERER
Message-Id: <3A0035C7.79A1@box43.gnet.pl>
tzoko@my-deja.com wrote:
...
> I need a perl script, which redirects the user to external link. I need
> this script to modify the HTTP_REFERER. (I don't want to show where
> exactly the user came from.)
>
> I tried with headers, but it doesn't work:
>
> print "Location: http://site_to_go/\n",
> "Referer: http://elsewhere.com/\n\n",
> "Content-type: text/html";
AFAIK:
print "Location: http://site_to_go/\n\n";
should redirect to the specified location.
with CGI.mp:
redirect( "http://site_to_go" );
but anyway, ask that in comp.infosystems.www.authoring.cgi,
not here.
--
Adam.
------------------------------
Date: 01 Nov 2000 08:41:43 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: regexp substitution help needed
Message-Id: <m3aebjah5k.fsf@dhcp11-177.support.tivoli.com>
"Aidan" <Aidan.Finn@ucd.ie> writes:
> Hi,
> I'm new to perl and I'm writing a script that processes html files that have
> had the tags replaced by the word TAG.
> i.e <title> My Page </title> becomes TAG My Page TAG.
> I need to replace all the text words in the file with another tag.
> e.g. TAG TEXT TEXT TAG
> I've found some ways of doing this that dont always succeed so I'm looking
> for a simple substitution that will do this.
>
> s/[\w'-]+/ TEXT /gis;
> will substitute TEXT for all words including TAG;
> Can I get this to substitute all words in the text except for the word TAG.
s/\b(?!TAG)[\w'-]+/TEXT/g;
You apparently want to include ' and - as part of a word, so I have
done the same.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Wed, 1 Nov 2000 06:14:31 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: regular expression
Message-Id: <MPG.1469c52683197d6498ae89@nntp.hpl.hp.com>
In article <kovvvs0lfh3hbf6i3vjhctml9mc3o8oi0l@4ax.com>,
bart.lateur@skynet.be says...
...
> Be aware the the *contents* of $re must be what you would type between
> the slashes, so you might need some extra backslashes when typing in the
> regex.
>
> $re = '\\d+';
> /($re)/o
>
> is pretty much the same as
>
> /(\d+)/
Yes, it is. But your example doesn't require that the backslash be
doubled.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 1 Nov 2000 09:14:12 -0500
From: Edwin Mercado <emerado@wpi.edu>
Subject: Re: regular expression
Message-Id: <Pine.OSF.4.21.0011010913520.6037-100000@reno.WPI.EDU>
Thanks everyone for your help!
=`)
On Wed, 1 Nov 2000, Rick Delaney wrote:
>
> Jeff Yoak wrote:
> >
> > It works in this case, of course, but what can we do such that we match
> > in this case:
> >
> > my $x = 'x';
> > my $re = ??? # something like 'foo$x'
> > $x = 'y';
> > my $test = 'fooy';
> > if ($test =~ /$re/){
> > print "Yes\n";
> > }
> >
> > I had thought qr() was for this, but that turns out not to be the case.
>
> qr is not for making closures but it is helpful here in tandem with a
> postponed regexp:
>
> my $x = 'x';
> my $re = qr/foo(??{$x})/;
> $x = 'y';
> my $test = 'fooy';
> if ($test =~ $re){
> print "Yes\n";
> }
>
> Or you can use a real closure:
>
> my $x = 'x';
> my $re = sub { "foo$x" };
> $x = 'y';
> my $test = 'fooy';
> if ($test =~ &$re){
> print "Yes\n";
> }
>
> --
> Rick Delaney
> rick.delaney@home.com
>
------------------------------
Date: 01 Nov 2000 09:22:38 -0500
From: Ted Zlatanov <tzz@heechee.beld.net>
Subject: Re: Rounding numbers in perl
Message-Id: <m3lmv3ojpt.fsf@heechee.beld.net>
oarend@my-deja.com writes:
> Is there a subroutine of some kind to round a number in Perl? Or does
> anybody have an idea of how one can do it himself? If so, please add
> how you can have a subroutine return a value - I'm not that familiar
> with the language yet.
You should, as other followup posts have suggested, read the FAQ
('perldoc -q round'), but you might also want to take a look at the
recently released CPAN Math::Round module (look on
http://search.cpan.org)
--
Teodor Zlatanov <tzz@iglou.com>
"Brevis oratio penetrat colos, longa potatio evacuat ciphos." -Rabelais
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Wed, 01 Nov 2000 15:15:12 GMT
From: Gordon.Haverland@agric.gov.ab.ca
Subject: Re: Rounding numbers in perl
Message-Id: <3a003294.610930077@news.gov.ab.ca>
On Tue, 31 Oct 2000 19:48:58 +0100, Adam <adamf@box43.gnet.pl> wrote:
>oarend@my-deja.com wrote:
>>
>> Is there a subroutine of some kind to round a number in Perl? Or does
>> anybody have an idea of how one can do it himself? If so, please add
>> how you can have a subroutine return a value - I'm not that familiar
>> with the language yet.
>
>look into:
># perldoc perlfaq4
>Q: "Does Perl have a round() function? ..."
I can't say I've read this part of the FAQ, but when I think of
rounding I go back to some early statistics classes. If the standard
deviation (expected error) of a number starts with a 1, the standard
deviation is allowed to have 2 significant figures, anything else it
can only have 1. The number it is associated with is then rounded to
match the most precise "decade" of this error estimate.
I.e. 1293746.8126763834 +/- 0.00138464585
The 0.00138... gets rounded to 0.0014 (4 decimal places). The number
it is attached to is allowed to go to the 4th decimal place. So, we
have
1293746.8127 +/- 0.0014
Gord
------------------------------
Date: Wed, 01 Nov 2000 15:06:56 GMT
From: digihoo@hotmail.com
Subject: sending webpage form
Message-Id: <8tpbia$vdp$1@nnrp1.deja.com>
hi
i know how to generate and send the <text> results
of a form using perl .. but is there any way to send
the <HTML> (or WYSIWYG) version of the page, as filled
out by the user?
there must be a way to do this (?)
thanks ..
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 01 Nov 2000 14:25:02 +0000
From: Steve <sjd256@yahooNOSPAM.co.uk>
Subject: SMS - text messaging
Message-Id: <3A0027BE.5402@yahooNOSPAM.co.uk>
Hi all,
Can anybody recommend a script that allows a user to
send text messages from a website to a mobile phone.
I have searched on deja and quite a few script sites
without much luck. Recommendations from current users
would be extremely helpful.
Many Thanks in advance for any assistance given.
Regards
Steve
------------------------------
Date: Wed, 01 Nov 2000 15:52:41 GMT
From: schnurmann@my-deja.com
Subject: Unicode::Map8
Message-Id: <8tpe86$1nl$1@nnrp1.deja.com>
Has anyone had problems compiling the Unicode::Map8 module under Win 2K
and VC++ 6?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4784
**************************************