[11044] in Perl-Users-Digest
Perl-Users Digest, Issue: 4644 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 13 17:03:11 1999
Date: Wed, 13 Jan 99 14:00:18 -0800
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, 13 Jan 1999 Volume: 8 Number: 4644
Today's topics:
Re: __DATA__ (Abigail)
Re: __DATA__ (Tad McClellan)
Re: Capturing output from a program in PERL <uri@ibnets.com>
Re: Capturing output from a program in PERL (Abigail)
Changing date display (Tim Crowe)
Creating an htaccess file - how do I supply program inp <michael@datahost.com>
Re: Executing Script (Mode ?) <wcj@iti-oh.com>
Re: How can I compare two arrays? <uri@ibnets.com>
Re: How to Timeout a Perl Socket Connect?? <shum@cig.mot.com>
Re: inlclude html in mail thru perl <david@kasey.umkc.edu>
Logic flow hudacmi2433@my-dejanews.com
Re: Mysterious "Killed" response - help needed. (Greg Ward)
Re: Mysterious "Killed" response - help needed. (Clinton Pierce)
Newbie "use strict" question nospam@here.com
Re: perl cgi (win95) doesn't work with CGI.pm (Edwin Litterst)
Re: Perl Criticism <chatmaster@c-zone.net>
Re: Perl Criticism (Gregory Snow)
Re: Perl Criticism (Randal L. Schwartz)
Problem with frames <swettboy@ncats.net>
Problems with perlcc <wcj@iti-oh.com>
Re: Regular Expression Question (Abigail)
Re: Simple regexp (I think =b) (Greg Ward)
Re: substituting nth occurrence of character (Tad McClellan)
Re: Using a Form in HTML and a Perl Script. (Tad McClellan)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Jan 1999 21:34:56 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: __DATA__
Message-Id: <77j3i0$e1j$2@client2.news.psi.net>
om7@cyberdude.com (om7@cyberdude.com) wrote on MCMLXI September MCMXCIII
in <URL:news:77id37$por$1@nnrp1.dejanews.com>:
%% Can someone please tell me where to find out more about __DATA__ and how and
%% when to use it. I've tried looking in Programming Perl, but didn't find much
%% help there with regards to how and what to use it for and I don't have access
%% to the man pages.
If you don't have the man pages, you don't have perl.
Abigail
------------------------------
Date: Wed, 13 Jan 1999 15:14:16 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: __DATA__
Message-Id: <8b2j77.bc5.ln@magna.metronet.com>
om7@cyberdude.com wrote:
: Can someone please tell me where to find out more about __DATA__ and how and
: when to use it.
It is covered in the perldata.pod man page.
: I don't have access
: to the man pages.
Must be rough without access to the Internet in this day and age...
The perldata man page:
ftp://ftp.rge.com/pub/languages/perl/doc/manual/html/pod/perldata.html
Or snatch _all_ of the the HTMLified man pages from a link on:
http://language.perl.com/info/documentation.html
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Jan 1999 15:53:34 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: Capturing output from a program in PERL
Message-Id: <39emoy51yp.fsf@ibnets.com>
>>>>> "MJW" == Michael J Wrobel <mjw@hrb.com> writes:
MJW> What is the easiest way to capture output from a program in PERL?
use the snark trap algorithm.
or RTFFAQ.
uri
--
Uri Guttman Hacking Perl for Ironbridge Networks
uri@sysarch.com uri@ironbridgenetworks.com
------------------------------
Date: 13 Jan 1999 21:36:03 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Capturing output from a program in PERL
Message-Id: <77j3k3$e1j$3@client2.news.psi.net>
Michael J. Wrobel (mjw@hrb.com) wrote on MCMLXI September MCMXCIII in
<URL:news:369D12F8.B84762CD@hrb.com>:
\\ What is the easiest way to capture output from a program in PERL?
``
Abigail
------------------------------
Date: Wed, 13 Jan 1999 21:34:49 GMT
From: nospam.kane00tc@angis.usyd.edu.au (Tim Crowe)
Subject: Changing date display
Message-Id: <369d0ede.2357143@news.usyd.edu.au>
I hope someone may help with this small problem.
I'm using a script written by someone else which I modified to run a
message board on my site. It works perfectly except that when a new
message is displayed it shows the date it was posted on the topic line
(which I want it to do) EXCEPT that the server I host it on is in the
USA and I run the site from Australia so there is a time delay of some
15-20 hours. Can I modify the following statement in the script so I
can automatically add on a certain amount of hours to the time
reported by the server.
open(TEMPFILE,"|date +\"%a %d %b %Y\" >> $tempfile");
Thanks for any help.
Tim
Please remove "nospam" from my e-mail address to reply
------------------------------
Date: Wed, 13 Jan 1999 14:05:50 -0800
From: Michael Stearns <michael@datahost.com>
Subject: Creating an htaccess file - how do I supply program input?
Message-Id: <369D17EC.79D1@datahost.com>
Hello:
I have a text file that looks like this:
user1,pass1
user2,pass2
user3,pass3
I would like to convert it to an htpasswd file.
I understand how to parse the file, and I believe I can use the perl
system or open functions to run 'htpasswd', but...
I don't know how to handle the fact that htpasswd returns two prompts
for a password and a password confirmation. How can I supply these
values to the htpasswd program at the appropriate time?
Thanks,
-- Michael
---------------------------------------------------------
Michael Stearns Datahost
michael@datahost.com 37540 Wallace Creek Rd
phone: 541-746-6418 Springfield, OR 97478
fax: 541-746-7176
pager: 541-718-2752
---------------------------------------------------------
------------------------------
Date: Wed, 13 Jan 1999 16:23:35 -0500
From: Bill Jackson <wcj@iti-oh.com>
To: Kevin Richard Mullen <mullenk@cae.wisc.edu>
Subject: Re: Executing Script (Mode ?)
Message-Id: <369D0ED7.85F59417@iti-oh.com>
Try running 'which perl'. This will tell you where your perl executable is
located.
Bill
Kevin Richard Mullen wrote:
> I am learning Perl on a Sun Ultra 10. (Unix System V Release 4.0). When
> I write a script and then try to run it, the system complains that it
> cannot find the command. I tried changing the mode so that the file is
> an executable, but still the system will not run my script. (Yes, first
> line of code is #! /usr/bin/perl -w ) I have resorted to typing the
> command :
>
> perl -w try1.prl
>
> in order to get it to run. Advice ?
>
> KRM
> --
------------------------------
Date: 13 Jan 1999 16:07:23 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: How can I compare two arrays?
Message-Id: <39d84i51bo.fsf@ibnets.com>
>>>>> "IZ" == Ilya Zakharevich <ilya@math.ohio-state.edu> writes:
IZ> [A complimentary Cc of this posting was sent to Uri Guttman
IZ> <uri@ibnets.com>],
>> well, i don't seem to run into those bugs then. i don't push the
>> envelope with most of my perl programs, because i don't have to to get
>> the job done. i estimate i use no more than 20-40% of core perl. my
>> current projects are almost pure text munging with no cutting
>> edge stuff. most (i think) would run fine under 5.001!
IZ> You do not need to be at the cutting edge to hit bugs. They are
IZ> everywhere. Most probably you hit them all the time, but consider it
IZ> normal.
so tell me what basic regex stuff and string munging stuff is broken
pre-5.005? i have seen bug reports on p5p and nothing is close to the
simple code i am writing.
IZ> What stuns me most is the tolerance of Unix weenees to bugs in
IZ> software. Somehow it feels that this tolerance is *greater* than one
IZ> of the DOSISH worlds (this is probably due to my higher expectations
IZ> w.r.t. Unix-related people - the expectations which somehow are not met).
if i hit a bug and the code didn't heave the way i expect it to, i would
be pissed and force an upgrade. that hasn't happened here. you seem to
not grasp the small size of subset of perl i am using on these
programs. just hashes, arrays, basic regexes, string stuff, etc.
it is not a greater tolerance for bugs but an understanding of how they
can or don't affect me. if there is a bug in some obscure area which i
don't go near, then does the bug exist for me? i am for it getting fixed
but i am not for getting that version if it has other baggage i don't
need. when 5.005_03 gets out i will install it at home. i may encourage
them here to do it. i don't know if i will tell them to install
5.005_02.
also 5.004_4 is supposed to have a maintenance track to fix those bugs
you refer to. where is that? 5.005 requires recompiling o all XS code so
installing it can be a pain.
uri
--
Uri Guttman Hacking Perl for Ironbridge Networks
uri@sysarch.com uri@ironbridgenetworks.com
------------------------------
Date: Wed, 13 Jan 1999 14:54:22 -0600
From: Edmond Shum <shum@cig.mot.com>
Subject: Re: How to Timeout a Perl Socket Connect??
Message-Id: <369D07FE.690E58BE@cig.mot.com>
Use alarm call:
sub connectserver
{
$SIG{"ALRM"} = 'sig_alrm_connect';
alarm 60;$timeout = 0; # timeout after 60 sec
$connect = connect(SOCK,$that) ? 1 : 0;
$SIG{"ALRM"} = '';alarm 0; # reset ALRM trap
($connect,$timeout) ;
}
sub sig_alrm_connect { $timeout = 1;}
This way you can tell if $connect == 1, you have a successful
connection;
if $connect == 0, then check for $timeout.
$timeout == 0 means connection refused by remote server;
$timeout == 1 means connect failed due to network timeout.
Hope it helps
--
Edmond Shum System and Network Administration
Motorola CIG email: shum@cig.mot.com
Arlington Heights, IL phone: 847-632-6702
------------------------------
Date: Wed, 13 Jan 1999 15:13:47 -0600
From: David L Nicol <david@kasey.umkc.edu>
To: jasjeetv@pugmarks.com
Subject: Re: inlclude html in mail thru perl
Message-Id: <369D0C8B.F30D0A83@kasey.umkc.edu>
jasjeetv@pugmarks.com wrote:
> Can we include html part in mails thru perl. Similar to the send page option
> used in netscape, where your entire page comes in the mail. Can this be done
> in perl or if you could suggest me some other way.
here you go
my $message=<<"BASTA";
From: $FromEmail
To: $ToEmail
Subject: $Subject
Content-Type: text/html
<html>
Here's how to order The Perl Journal using tipjar.com<br>
<form action=http://www.tipjar.com/cgi-bin/dogive>
<input type=hidden name=recipient value="subscriptions@tpj.com">
My email address:<input type=text name=from value="$ToEmail"><br>
<textarea name="message" rows=6 cols=60>
Name: _______________________________________________
E-mail address: _____________________________________
Subscription address: _______________________________
_____________________________________________________
_____________________________________________________
_____________________________________________________
Number of subscriptions: _____ for ____ years at _____ each
New subscription? ______ Renewal? ______ Gift subscription? ______
For every eight back issues, get four free.
Or order just the last year for $22 U.S., $29 int'l.
Back issues (1 through 12): _____________________ at ____ each
</textarea><br>
Total payment: <input type=text name="amount" size=6><p>
</form>
<p>
I am trusting that The Perl Journal does not mind me using subscribing
to it as an example; I have not discussed this with them. If you have a
credit
card, <a href="http://www-mit.tpj.com/tpj/ordering"> you can use this
form.</a>
</html>
BASTA
open MAIL,"|/usr/lib/sendmail -t";
print MAIL $message;
close MAIL;
______________________________________________________________________
David Nicol 816.235.1187 UMKC Network Operations david@news.umkc.edu
You are free to believe that Microsoft is a charitable non-profit.
------------------------------
Date: Wed, 13 Jan 1999 21:15:56 GMT
From: hudacmi2433@my-dejanews.com
Subject: Logic flow
Message-Id: <77j2e2$e93$1@nnrp1.dejanews.com>
My main routine consists of a series of subroutines. After returning from
any oneI may need to STOP execution (elegantly) Is DIE the right way or
elegant way?
#MAIN
blah...
blah...
&sub1;
&sub2;
if( $condition) {
&sub3;
&sub4;}else{
DIE???
}
#End MAIN
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 13 Jan 1999 20:59:28 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: Mysterious "Killed" response - help needed.
Message-Id: <77j1fg$s64$1@news0-alterdial.uu.net>
Tero Toivanen <tttoivan@cc.hut.fi> wrote:
> I have made a script of about 600 lines (splitted
> to a couple of files) and thought it was ready and
> working properly.
>
> It works just fine if I run it only once. But if
> I run it for example 100 times (with a for loop),
> it does its work 80-90 times, then collapses and
> gives me a mysterious response "Killed". The script
> does not collapse in the same place and same
> line every time..
I assume you mean a *shell* for loop, not a Perl for loop. (I also
assume you're running under some Unix variant. It would probably help
if you told us exactly what OS and version; somebody familiar with that
system might be able to help then.) Or at least a for loop external to
your script -- it could be a tiny Perl script that runs the main script
100 times. Whatever.
I dimly recall having seen a similarly near-useless "Killed" message;
can't remember if it was under IRIX or Linux (the Unices with which I
have the most experience). Even more dimly, I think it was the result
of an (accidentally) insanely huge malloc(). In any case, it was due to
a signal from the kernel. That makes me think you might be getting hit
by a signal. Use your (big) script's termination status to determine
this.
For instance, if your big script is being run by the following tiny Perl
script:
for $i (1 .. 100)
{
system "mybigscript", @args;
die "mybigscript failed!\n" unless $? == 0;
}
then you could change it to the following:
for $i (1 .. 100)
{
system "mybigscript", @args;
die "mybigscript killed by signal " . ($? & 0x0F) . "\n" if $? & 0x0F;
die "mybigscript exited with status " . ($? >> 8) . "\n" if $?;
}
or something like that. You might want smarter logic so you only get
one message, but you get the idea. RTFM on $? ('perldoc perlvar') for a
bit more info; 'man wait(2)' or 'man waitpid(2)' (depending on your OS;
modern Unices should have both, but I'm not sure which would have a more
useful man page) for more than you want to know.
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Wed, 13 Jan 1999 20:34:04 GMT
From: cpierce1@mail.ford.com (Clinton Pierce)
Subject: Re: Mysterious "Killed" response - help needed.
Message-Id: <36a802ac.3210159584@news.ford.com>
[Courtesy CC sent to poster in E-Mail]
On Wed, 13 Jan 1999 19:05:13 +0200, Tero Toivanen <tttoivan@cc.hut.fi>
wrote:
>Hello!
>
>I have made a script of about 600 lines (splitted
>to a couple of files) and thought it was ready and
>working properly.
>
>It works just fine if I run it only once. But if
>I run it for example 100 times (with a for loop),
>it does its work 80-90 times, then collapses and
>gives me a mysterious response "Killed". The script
>does not collapse in the same place and same
>line every time..
>
>Now I need your help to get this script working.
>
>What causes this "Killed" message? I fear it has something
>to do with the memory. I have a feeling it cannot be "out
>of memory" because I have declared all the possible variables
>locally.. Could it be some kind of "Stack Overflow" or
>"Segmentation fault"? I have tried to search information about
>this "Killed" message, but there does not seem to be too much
>documentation of it.
>
>Thanks for your time and spare in advance,
>
What kind of system are we talking about? UNIX? VMS? Win32? What
version of perl? 4? 5.002? 5.005? If it's Unix, what kind? AIX?
IRIX? Linux?
A little more info is needed, Tero.
--
Clinton A. Pierce "If you rush a Miracle Man, you get rotten
cpierce1@ford.com miracles" --Miracle Max, The Princess Bride
http://www.geeksalad.org
------------------------------
Date: Wed, 13 Jan 1999 20:25:13 GMT
From: nospam@here.com
Subject: Newbie "use strict" question
Message-Id: <369d0104.975055@mars.dsu.edu>
With Perl for Win32 form www.activestate.com build 508 it recommends
using "use strict". This then causes perl to complain about any
global variables that you don't refer to as $main::variablename. My
question is, what is the best way to handle this? Below is a little
bit of my code. For some of my global vars I'm using "use vars" to
"declare" them (is that right?), but with the rest of them, I make
them local to my program with the "my" keyword. Both of these work,
but which is better, or should I be using fully qualified references
to all of my global variables instead?
Thanks,
JIM
#********Includes**********
use strict;
use Getopt::Std;
#********Constants*********
#********Global Variables*********
#These vars are used in getopts.pl
use vars qw ($opt_d $opt_g $opt_x $opt_f);
my $Domain;
my $DomainController;
my $UserNameFile;
my $ExcludeGroup;
my $Group;
------------------------------
Date: Wed, 13 Jan 1999 21:07:04 GMT
From: el@fiz-karlsruhe.de (Edwin Litterst)
Subject: Re: perl cgi (win95) doesn't work with CGI.pm
Message-Id: <369d072e.630147@news>
Clay Irving wrote:
>Oh, the pain -- Perl on Windows 95... Nonetheless, this is the version I
>have:
>
> C:\tmp>\perl\bin\perl -v
>
> This is perl, version 5.004_02
I am using exactly the same version.
>This is example program using CGI.pm:
[Example deleted]
> C:\tmp>\perl\bin\perl foo.pl
> Ambiguous use of title => resolved to "title" => at foo.pl line 8.
> (offline mode: enter name=value pairs on standard input)
> Content-type: text/html
My demo script also works when called from the command line.
Nevertheless, your example also works called as CGI program.
For me it looks like the CGI module is hijacking output to STDOUT
and changing something. I have to look into the internals of CGI.pm.
Indeed, this doesn't seem to be a win95 related problem. The same
thing happens when running under solaris. Shame for me for not trying
this - but I was 100% sure this should work.
Usually (for production) I don't call a perl cgi directly but via a
small cgi (written in C) which contacts a "stateful" server taking
care of more instances of the same stuff. When called this way stdout
works as expected.
Thanks for your help,
Eddie
PS: I am impressed about how many people were willing to help me.
Thanks to all!
------------------------------
Date: Wed, 13 Jan 1999 13:53:01 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Perl Criticism
Message-Id: <369D15BD.84432C27@c-zone.net>
dturley@pobox.com wrote:
>
> In numerous articles topmind@technologist.com wrote a bunch of stuff he has
> not been able to defend:
>
> This is going nowhere. I hereby pledge to never read or repsond to any post
> from this person again. Why don't we all make the same promise and let him
> just fade away. If this person had anything to contribute to Perl he would do
> so by providing code, not name calling. Every reply just keeps him coming
> back, ignore him, killfile him, he will go away.
>
> This thread is dead for me.
>
> ____________________________________
> David Turley
> dturley@pobox.com
> http://www.binary.net/dturley/
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
I'm at that point now as well. The humor has faded.
PS: I copied his posting, right out of the archive... Now I'm a liar?
(He can't spell very well either. :-)
--
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application
Copyright ) 1999 TRG Software and The Link Worm.
------------------------------
Date: 13 Jan 1999 21:28:08 GMT
From: snow@biostat.washington.edu (Gregory Snow)
Subject: Re: Perl Criticism
Message-Id: <77j358$16bg$1@nntp6.u.washington.edu>
In article <slrn79p4ti.34e.dformosa@godzilla.zeta.org.au>,
David Formosa (aka ? the Platypus) <dformosa@zeta.org.au> wrote:
>In article <77hkaq$4oe$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>>In article <slrn79lors.fmt.sholden@pgrad.cs.usyd.edu.au>,
>> sholden@cs.usyd.edu.au wrote:
>[...]
>>> I actually look forward to seeing your new project to create a better perl.
>>> I just doubt you actually want to do any more than talk about your ideas,
>>> as evidenced by the details required for implementation missing from your
>>> web pages.
>>>
>>
>>I am not skilled at building interpreters.
>
>Then find someone how is and shears your views and then them to build it.
Or here is an even easier way (you don't need patch or to deal with
the source code) that should be right up the alley of an applications
programmer.
There are already preproccessors available for perl (see
Devel-PreProcessor for one), you can use one of those (or similar) to
read through someones code and if there are any of the things you
don't like, give an error message and quit proccessing. Write the
extra functions into a module and your language (or at least a
testable prototype) can be implemented simmilar to "use strict".
When I first learned of "use strict", I thought that it would not
catch on, but look at how much it is used now (I even use it myself
now). If you had something simmilar, posted it to CPAN, and gave some
demonstrations of how it helped, then you claims could easily be
tested by if it caught on and who used it. If it is as good as you
claim it will be, then code review could be replaced with the manager
checking random scripts for the "use ultrastrict" (or whatever you
choose to call it) at the top of all scripts (and if a manager can't
do that, he won't be in buisness long enough for spaggetti code to put
him under).
>
>--
>Please excuse my spelling as I suffer from agraphia. See
>http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
>How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
>
I wish I had a good excuse for my bad spelling :)
--
-------------------------------------------------------------------------------
Gregory L. Snow | Hanlon's Razor:
(Greg) | Never attribute to malice that which is
snow@biostat.washington.edu | adequately explained by stupidity.
------------------------------
Date: 13 Jan 1999 13:57:44 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Perl Criticism
Message-Id: <m11zky6dk7.fsf@halfdome.holdit.com>
>>>>> "Staffan" == Staffan Liljas <staffan@ngb.se> writes:
Staffan> [...] In Unix, a smart SysMan aliases 'rm' [...]
Nope, only the dumb ones do that. The smart ones alias "del" to "rm -i",
and tell the lusers to use "del" instead of "rm".
And no, I'm not joking. Overloading builtin operations so they have
a *different* behavior from printed documentation is asking for trouble,
and trouble willingly comes.
Just another longterm Unix sysadm,
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Wed, 13 Jan 1999 16:15:33 -0500
From: "Snotsleeve" <swettboy@ncats.net>
Subject: Problem with frames
Message-Id: <369d0728.0@news.ncats.net>
Does anyone know if it's possible to have a form in one frame that calls a
CGI script in another frame?
------------------------------
Date: Wed, 13 Jan 1999 16:38:23 -0500
From: Bill Jackson <wcj@iti-oh.com>
Subject: Problems with perlcc
Message-Id: <369D124E.70395442@iti-oh.com>
I am running Perl 5.00502 on Solaris 2.5.1 using gcc-2.8.1.
I am trying to create a binary executable of my perl programs using
perlcc.
(Don't ask me why, I had a reason but now I'm not sure why myself)
Anyway, I'm getting an undefined symbol 'runops' when the program
tries to link.
Any ideas?
Bill
------------------------------
Date: 13 Jan 1999 21:33:15 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Regular Expression Question
Message-Id: <77j3er$e1j$1@client2.news.psi.net>
parab0la@my-dejanews.com (parab0la@my-dejanews.com) wrote on MCMLXI
September MCMXCIII in <URL:news:77hbp8$u10$1@nnrp1.dejanews.com>:
--
-- I'm try to match the pattern /helloworld/ or /byeworld/. Is there any way
-- that I can combine them in one regexp, something like /\(hello|bye\)world/ ?
Yes. Is there any reason you can't find the answer in perlre?
Abigail
------------------------------
Date: 13 Jan 1999 21:04:44 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: Simple regexp (I think =b)
Message-Id: <77j1pc$s64$2@news0-alterdial.uu.net>
Ketan Patel <ketanp@BLAHNOSPAMBLAHxwebdesign.com> wrote:
> I have the following snippet of code:
>
> $url = "http://blah.com/blah.html";
> $request = new HTTP::Request('GET', '$url');
> $request = get($url);
>
> $price = ??????
>
> After that, somewhere in $request there is a price in the form of
> "blahblah>$xxx.xx<blahblah" where the price is xxx.xx (or xx.xx). The
> only '$' in $request is the one right before the price and the price is
> followed by a '<'. How could I get $price to equal '100.00' if the
> string is "blahblah>$100.00<blahblah" (by the way, xxx.xx is different
> all the time)?
Yep, it's a very simple regexp:
($price) = ($request =~ /\$(\d+\.\d\d)</);
Ie. scan $request for the first dollar sign (must be escaped!). When
it's found, look for a sequence of one or more digits, a dot, then
exactly two digits. Finally, this must be followed by an open angle
bracket. Thanks to the parentheses, the digits-dot-digits are saved;
and thanks to the assignment to ($price), the saved text winds up in
$price.
Once you understand this, go back and reread the perlre man page, or the
section pn pattern-matching in Chapter 2 of the Camel Book. It's really
a *lot* easier to understand that stuff the first time through with some
working examples in front of you!
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Wed, 13 Jan 1999 15:30:52 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: substituting nth occurrence of character
Message-Id: <ca3j77.pg5.ln@magna.metronet.com>
matt_1@my-dejanews.com wrote:
: I need some help with a regex substitution. I am trying to substitute/replace
: the fifth of occurrence of a : in a file similar to this:
: text 10/10/10 12:12:12 text text 12:12:12 text:text text
------------------
#!/usr/bin/perl -w
use strict;
my $line = 'text 10/10/10 12:12:12 text text 12:12:12 text:text text';
print "$line\n";
$line =~ s/((?:.*?:){4}.*?):/$1~/; # replace fifth colon with tilde
print "$line\n";
------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 13 Jan 1999 15:03:43 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Using a Form in HTML and a Perl Script.
Message-Id: <fn1j77.bc5.ln@magna.metronet.com>
Jamie Bekkers (jtb@bekkers.com.au) wrote:
: Thanks Ted,
You're welcome James.
: That is not my problem, I wanted someone to help me create a html form to
: pass variables to the script.
Well you were right then.
This is the wrong newsgroup.
We discuss Perl here.
There is a different newsgroup for discussing HTML:
comp.infosystems.www.authoring.html
Of, if you want to discuss the <form> HTML element:
comp.infosystems.www.authoring.cgi
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
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 4644
**************************************