[6489] in Perl-Users-Digest
Perl-Users Digest, Issue: 114 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 14 00:08:59 1997
Date: Thu, 13 Mar 97 21:00:21 -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 Thu, 13 Mar 1997 Volume: 8 Number: 114
Today's topics:
Re: Am I hosed? (Can't compile modules) <rra@cs.stanford.edu>
cgi and pearl tutorials manages@cse.mrt.ac.lk
Re: cgi and pearl tutorials (Tad McClellan)
Hiding path name during download <boylesr@mail.mcm.edu>
Re: How can I include another perl script within a perl dbelcher@cyberhino.com
Re: Is possible in perl run a string like a piece of pr rosenthd@erols.com
Re: MacPerl5 <jerrym@ibmoto.com>
Re: matching whitespace? (Brian L. Matthews)
Math with lists?? <morrowc@mrj.com>
PERCEPS C++ documentation generator: version 1.4 releas <mpeskin@mail.utexas.edu>
Perl 5.004beta1 binary for EMX (OS/2,DOS,Win*) availabl (Ilya Zakharevich)
Perl Browser <rajat@cs.uh.edu>
Perl-style regular expressions for C/C++? (Alex Clark)
Perl-Win32 Digest Format (Sun Tong)
pipes and STDIN/STDOUT <cammy@ivillage.com>
Re: Pointers problem <fawcett@nynexst.com>
Re: random perl core dumps with obscure message (Ilya Zakharevich)
Re: remote to remote ftp from cgi <tchrist@mox.perl.com>
Re: remote to remote ftp from cgi <tchrist@mox.perl.com>
Re: Signal catching with alarm (Charles DeRykus)
Re: What language do Perl REs recognize? (Mark-Jason Dominus)
Re: Who makes more $$ - Windows vs. Unix programmers? <carla@ici.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Mar 1997 20:44:12 -0800
From: Russ Allbery <rra@cs.stanford.edu>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Am I hosed? (Can't compile modules)
Message-Id: <qumybbrnkv7.fsf@cyclone.stanford.edu>
[ Posted and mailed. ]
Tom Phoenix <rootbeer@teleport.com> writes:
> On Wed, 12 Mar 1997, Ross Carlson wrote:
>> I have an SGI Indy Webforce workstation that came very bare bones, and
>> without the SGI developer's package. As a result, I have no compiler!
>> (ARGH)
> I don't know for sure, but you may be able to get a compiler like gcc
> for your system. Check your favorite GNU archives (and maybe ask in a
> newsgroup which discusses your hardware) to find out.
Unlike pretty much every other OS vendor, SGI not only doesn't ship a
compiler with their base OS, they don't even ship the standard header
files. And, since those header files are copyrighted, no free compiler
distribution can either.
Which basically means you get to buy IDO if you want a compiler. gcc
won't help.
--
Russ Allbery (rra@cs.stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: Thu, 13 Mar 1997 20:23:43 -0600
From: manages@cse.mrt.ac.lk
Subject: cgi and pearl tutorials
Message-Id: <858228408.25640@dejanews.com>
I want to find some perl and cgi tutorials. I'd prefer text format but
others are okay. Can anybody send me those or let me know where to
download those ?
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Thu, 13 Mar 1997 22:06:39 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: cgi and pearl tutorials
Message-Id: <fsiag5.dt.ln@localhost>
manages@cse.mrt.ac.lk wrote:
: I want to find some perl and cgi tutorials.
^^^^ ^^^^^^^^^
Perhaps you have heard of a great resource for searching past
Usenet articles called Dejanews?
Did you find something unsatisfactory with the three hundred
and seventy four (374) hits found when you use Dejanews to search
for 'tutorial' in the comp.lang.perl.misc newsgroup?
What, exactly, do those lack?
It would also appear that when you searched the new Perl FAQ
before posting (as all good net citizens do. You _are_ a good
net citizen, right?), you missed this in FAQ part 3:
--------------------
=head2 Where can I learn about CGI or Web programming in Perl?
For modules, get the CGI or LWP modules from CPAN. For textbooks,
see the two especially dedicated to web stuff in the question on
books. For problems and questions related to the web, like "Why
do I get 500 Errors" or "Why doesn't it run from the browser right
when it runs fine on the command line", see these sources:
The Idiot's Guide to Solving Perl/CGI Problems, by Tom Christiansen
http://www.perl.com/perl/faq/idiots-guide.html
Frequently Asked Questions about CGI Programming, by Nick Kew
ftp://rtfm.mit.edu/pub/usenet/news.answers/www/cgi-faq
http://www3.pair.com/webthing/docs/cgi/faqs/cgifaq.shtml
Perl/CGI programming FAQ, by Shishir Gundavaram and Tom Christiansen
http://www.perl.com/perl/faq/perl-cgi-faq.html
The WWW Security FAQ, by Lincoln Stein
http://www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html
World Wide Web FAQ, by Thomas Boutell
http://www.boutell.com/faq/
--------------------
: I'd prefer text format but
: others are okay.
: Can anybody send me those or let me know where to
: download those ?
I know where there are 374 clues vvvvvvvvv
: -------------------==== Posted via Deja News ====-----------------------
^^^^^^^^^
Now, for CGI tutorials, you are in the wrong newsgroup.
This is the Perl newsgroup.
The CGI newsgroup is comp.infosystems.www.authoring.cgi.
Your selection there appears more limited. Only three hundred
forty five matches...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 14 Mar 1997 03:50:31 GMT
From: "Roy" <boylesr@mail.mcm.edu>
Subject: Hiding path name during download
Message-Id: <01bc302c$271568a0$468c53c6@rboyles>
I'm hoping someone here can help me with this problem. First off, I am in
the learning stages of Perl. I am running on an NT 4.0 server with Web
Commander. I have installed Perl for Win32. Basically, I have a form
where certain information is required to be able to download files. After
the input data has been entered, I pass the filename to download to a
script and I want to be able to automatically start the download WITHOUT
showing the path information during the download.
I have tried:
print "Location: /path/path/filename\n\n";
It always starts a download, but that always returns the full path in the
browser. I don't want that!
I have tried:
print "Content-type: application/zip\n\n";
That starts a download too, but it starts a download of the 'script file'
that issued that command. I don't want that either!
I have read through all the documentation I can find on the Web but have
come up with a blank. Am I missing something here?? Are there some
parameters I can pass to the "Content-Type:..." statement or some other way
to do this?
Feel free to reply here or to my e-mail address below.
Thanks in advance...
--
Roy
********************************
* royboy@camalott.com *
********************************
------------------------------
Date: Thu, 13 Mar 1997 20:01:11 -0600
From: dbelcher@cyberhino.com
Subject: Re: How can I include another perl script within a perl script ??? Help
Message-Id: <858304299.30642@dejanews.com>
In article <3324876C.2233@exabyte.com>,
Kris Houghton <krisho@exabyte.com> wrote:
>
> In the korn shell you can use a . include file but how is this done in perl.
>
> script1
> !# /usr/local/bin/perl
> print "help";
> exit
>
> script2
> !# /usr/local/bin/perl
>
> # How can I use the stuff in perl script1 in perl script2.
>
> use ???
> require ???
> &script1 ???
> include ???
>
> If anyone has any examples or documentaion please respond.
Two methods are available, depending on what you want to achieve:
Method #1 - Use "require" in script2 to load the contents of script1.
This makes the variables and subroutines in script1 available to script2,
but script2 continues to execute.
script1
...
...
sub print_help {
print "help";
exit;
}
...
script2
...
require script1; # script 1 code is now assimilated & available
...
...
&print_help; # launched as if it had always been in script2
...
Method #2 - Use "exec" in script2 to transfer execution to script1.
There is no retained memory of script2 variables or subroutines.
script1
...
...
...
script2
...
exec "script1";
...
You can also use the fork command to initiate a new process, but that's
probably more exotic than you "require".
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Fri, 14 Mar 1997 04:03:31 GMT
From: rosenthd@erols.com
Subject: Re: Is possible in perl run a string like a piece of program?
Message-Id: <5gails$k2s@boursy.news.erols.com>
Maurizio Belluati <Maurizio.Belluati@cselt.stet.it> wrote:
>Hello,
>We've a perl application that need to read math functions stored (like
>strings) in a file. After read the function we need to process it. So a
>possible solution is to write a subroutine that read the function parse
>its string rappresentation end return the result. It could be better if
>in perl there is a function that receives as input a piece of perl code
>(so we write the function in perl syntax) and run it.
>Does perl have it?
>Thank you for any help.
>Maurizio.Belluati@cselt.stet.it
Try using the eval function.
Dan
------------------------------
Date: Thu, 13 Mar 1997 09:30:14 -0600
From: Jerry Monsen <jerrym@ibmoto.com>
Subject: Re: MacPerl5
Message-Id: <33281D86.2781@ibmoto.com>
Juergen Seeger wrote:
>
> Is anyone here who is using MacPerl?
> JS
>
Yes...
Jerry
------------------------------
Date: 13 Mar 1997 17:15:43 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: matching whitespace?
Message-Id: <5ga8rv$e7i$1@halcyon.com>
In article <u02ohcoga0m.fsf@ml.com>,
Brent B. Powers Swaps Programmer x2293 <powers@ml.com> wrote:
|astroweb@astron (alex filippenko) writes:
| > how do I match an intederminate amount of whitespace...
|I could answer, but I'm 20 Minutes away from any news reader :)
Too bad you really weren't. If you were, you might not have posted an
incorrect answer.
/\s/ only matches *1* whitespace character
/\s*/ and /\s+/ match sequences of them (0 or longer and 1 or longer,
respectively)
Brian
--
Brian L. Matthews Illustration Works, Inc.
For top quality, stock commercial illustration, visit:
http://www.halcyon.com/artstock
------------------------------
Date: 14 Mar 1997 03:11:26 GMT
From: "Chris Morrow" <morrowc@mrj.com>
Subject: Math with lists??
Message-Id: <01bc3025$0c9a6720$470ea0cd@home.mrj.com>
I have a question:
Can you add 2 lists together and them remove the duplicate values in the
new list?
so, something like:
@A=(a, b, c, d, e)
@B=(c, d, e, f, g)
@C = @A - @B
@C now equals (a,b,c,c,d,d,e,e,f,g)
and I want to actually get (a,b,c,d,e,f,g) in one array and another array
that is (c,d,e) if possible...or maybe if I could just get (c,d,e) array...
I worked out a funky associative array uniq() function but it was a bit
kludgey and I'd rather do a subtraction/difference or something like
that...
Thanks for the help!
-Chris
------------------------------
Date: Thu, 13 Mar 1997 21:44:43 -0500
From: Mark Peskin <mpeskin@mail.utexas.edu>
Subject: PERCEPS C++ documentation generator: version 1.4 released
Message-Id: <3328BB9B.2781@mail.utexas.edu>
PERCEPS is now at version 1.4:
New Features:
To save time, PERCEPS now only generates new output files if the
associated header or template files have been modified since the last
build, sort-of like the make command. This saves a LOT of time when
documenting large projects.
Also, this new version also allows comments describing a class to be
placed before, as well a within, the class definition. This allows
better conformance with many folks' current commenting styles and make
PERCEPS compatible with the code style guidelines imposed at some
companies.
You can get a copy of the new version at:
http://friga.mer.utexas.edu/mark/perl/perceps/
ITS COMPLETELY FREE (no spam here), so go ahead & try it.
What is PERCEPS?:
The Perl C++ Surveyor
PERCEPS is a Perl script designed to parse C++ header files and
automatically generate documentation in a variety of formats based on
the class definitions and comment information found in those files.
This allows you to comment your code and generate useful documentation
at the same time with no extra effort.PERCEPS can be useful as a
documentation tool for C++ class libraries or as a simple but effective
collaboration tool for other projects.
Unlike some other documentation generation systems, PERCEPS does not
produce a fixed output format. Instead it uses "template" files that
can be freely modified to produce an almost unlimited variety of output.
The example template files included with the distribution produce html
pages, but Tex, RTF, plain text or other formats are also possible.
__________________________________
Mark Peskin \_______ _______/
University of Texas @ Austin \ . . /
Electrical and Computer Engineering \ / Procrastinate
Microelectronics Research Center |^ ^| Now!!
http://friga.mer.utexas.edu/mark/ \_/
------------------------------
Date: 14 Mar 1997 03:09:03 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Perl 5.004beta1 binary for EMX (OS/2,DOS,Win*) available
Message-Id: <5gafgf$ba$1@mathserv.mps.ohio-state.edu>
Look in
$CPAN/ports/os2/ilyaz/5.003_93
you may start your CPAN search via
http://www.perl.com/CPAN
In fact it may take several days to reach your favorite CPAN site, so
you may try to download it from
ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl/os2/5.003_93
Keep in mind that I may not be able to fix bugs reported after
midnight Thursday Eastern Time (until the summer!), so be very quick
if you want a test drive.
Though the release _93 is called beta, it is much more solid than
whatever we have seen before (with a possible exception of 4.036 and
the classified 1.0 ;-). So if you plan to upgrade your perl before
summer, it may be _the_ time to do it.
I'm pretty sure in the binary itself, but had no time to check binary
installer (OS/2 only). So test yourself ;-)
Ilya
------------------------------
Date: Thu, 13 Mar 1997 21:22:30 -0600
From: Rajat Aggarwal <rajat@cs.uh.edu>
Subject: Perl Browser
Message-Id: <3328C476.6B@cs.uh.edu>
Hi,
I am trying to write a perl program that will take a URL and retrieve
the document from the URL. Also, it should retrieve all embedded
documents within that specified URL. I looked at the client/Server
example in the Learning Perl book, but did not help much. I understand
that http protocol just does anonymous ftps. I am not sure on how to
implement this in Perl. Any suggestions on how to do this would be
greatly appreciated.
Thanks,
Rajat
------------------------------
Date: 14 Mar 1997 03:09:10 GMT
From: aclark@ccu1.auckland.ac.nz (Alex Clark)
Subject: Perl-style regular expressions for C/C++?
Message-Id: <5gafgm$6tl$1@scream.auckland.ac.nz>
In the course of my recreational/professional programming, I use a
variety of different languages, two of my favourites being C++ and (more
recently) Perl. I have found Perl to be utterly brilliant for whipping
up quick text-processing programs, obligatory CGI apps and the
occasional interactive program that does not require any sort of fancy
user interface.
On returning to C++'s sparse native string handling capabilities, I
often find myself wishing I could do if (/^(.*) (.*)/) {...}, rather
than char str1[81],str2[81]; strcpy(str1,str); char *spc=strchr(str1,'
'); if (spc) {spc[0]=0; strcpy(str2,spc+1);}...
Ok, so there are nicer ways of handling the latter case, like with
standard class libraries... but... if anyone has, or knows where I can
find, some source for straightforward regular expressions in C/C++, I
would be very grateful.
Thanks, Alex.
.--------------------------.
|aclark@ccu1.auckland.ac.nz|
.--------------------+--------------------------+------------------------.
| I'm not paranoid, everyone IS trying to kill me |
| I'm not a megalomaniac, I really AM the greatest person who ever lived |
+--------------------------------------------------------------------.---'
| Note: you do NOT have permission to send unsolicited Email to this |
| address, and especially may not include on mailing lists without |
| my request. .---------------------------+--------------------------'
`-------------+ God Damn the Spammer Man! |
`---------------------------'
------------------------------
Date: Thu, 13 Mar 1997 21:00:45 -0600
From: tsun@fs.com (Sun Tong)
Subject: Perl-Win32 Digest Format
Message-Id: <cUSapFSFTlInternetMail-970314025817Z-167@email.fs.com>
Hi,
I subscribed to Perl-Win32 Digest and find the format somewhat different
from standard RFC 1123. So I wrote a small AWK program (posted bellow)
to please my digest reader.
It works fine. But since I am learning perl, I want to make it a perl
script. Will someone do it for me please? I know awk2perl will do it,
but... I've found perl is a real elegant language and I want my first
perl script goes on to the right track.
What's more, may I require _my program_ a little more function? ;-) I
wish my program read from a file given from the command line, and write
to same file name with a defined extension. Then unlink it on exit. I
suppose it is not a big deal.
Many thanks to your generous help!
======
Enclosed message 1: Awk script, Try it -- It's useful
#.....................................
#To leave this list, send an email message to ListManager@ActiveWare.com
#with the body:
# leave Perl-Win32-Users
#NTList compliments of Internet Shopper
# http://www.net-shopper.co.uk/software/ntmail/ntlist.htm
#
#-----------------------------------------------------------------------
-
#--
#2 Message:0002
#2
#-----------------------------------------------------------------------
-
#--
#From: #### <####@XXX>
BEGIN {
SkipLenN=13 # Normal skip line #
SkipLen1=6 # Message:0001 skip line #
}
/^\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.
\
.\.$/ {
for(i=1;i<SkipLenN;i++){
getline
}
$0="\n------------------------------\n"
}
# deal with the first Message, which has no "..." ahead
/^----------------------------------------------------------------------
-
-$/ {
for(i=1;i<SkipLen1;i++){
getline
}
$0="--------------------------------------------------------------------
-
-\n"
}
{
print
}
======
Enclosed message 2: RFC 1123 info
A digest message is a conventional message consisting of a header and
body conforming to RFC 822 as clarified in RFC 1123. There is no fixed
size. Limitations may exist in intermediate mail gateways which
restrict the size. The typical digest size is 15,000 characters.
The header of a digest message should identify the digest in the Subject
line by listname, the key word, Digest, the volume number (usually a
sequential number either starting at 1 or the last two digits of the
year and incremented by one starting with the first issue of the next
calendar year), and an issue number starting at one for the first issue
of a new calendar year.
The body of a digest message must consist of a Preamble, one or more
enclosed messages, and a Trailer.
The Preamble usually contains a table of contents consisting of the
subject line contents of the enclosed messages, usually indented or
centered, and also may contain brief administrative or other
announcements.
The Preamble must be separated from the remainder of the message by a
line of 70 hyphens followed by a blank line.
Each enclosed message is a conventional message consisting of a header
and body, separated by a blank line. If they exist in the original
message header, the following lines must be retained as-is in the
reconstructed header: Date:, From:, To:, Cc:, Subject:, Message-ID:, and
Keywords:, rearranged to appear in that order. Retaining the Summary:
line is optional. Lines include continuation lines as defined in the
RFCs. All other header lines should be discarded, especially Received
lines. All leading and trailing blank lines should be removed from the
message body. The message body may be scanned to replace with a blank
the first character of any lines of exactly and only 30 hyphens.
Each enclosed message must be separated from the the remainder of the
digest message by a blank line before and after a line of 30 hyphens.
Sun Tong
-- tsun@fs.com (MsMail)
Test email: st@fs.com (MsExchange)
------------------------------
Date: Thu, 13 Mar 1997 17:53:29 -0500
From: Camille Currim <cammy@ivillage.com>
Subject: pipes and STDIN/STDOUT
Message-Id: <33288569.1D36@ivillage.com>
Im looking to write a perl script that would take an input string with a
bunch of variables, munge those variables, and then feed them as STDIN
to a binary that is expecting them as STDIN. Ive found some examples of
bidirectional pipes in perl on the CPAN site but none that quite seem to
work in my situation. Any suggestions would be _really_ appreciated.
--
-------------------------------
Camille Currim
Senior Systems Architect
ivillage, Inc.
cammy@ivillage.com
-------------------------------
------------------------------
Date: 13 Mar 1997 22:04:31 -0500
From: Tom Fawcett <fawcett@nynexst.com>
Subject: Re: Pointers problem
Message-Id: <8jn2s75g3k.fsf@nynexst.com>
rowe@excc.exeter.ac.uk (John Rowe) writes:
> I would like to use pointers as the keys to an associative array and
> would hope that the following test program would do it:
>
> [script deleted]
>
> Have I made some dreadful error? Is there a way of doing this?
No, there isn't. Keys of hashes must be strings. Perl will happily
convert a reference into a string when you use it as a key, but the
key stays a string:
$hash = {"one" => 1};
$hash2{$hash} = "foo";
print $hash2{$hash}, "\n";
foreach $key (keys %hash2) {
print $key, ": ", ref($key) ? "ref of type " . ref($key)
: "not a ref", "\n";
}
Hash values can be pointers, though, so if you really need to get the
pointer back you could always stash it away with something like:
$real_pointer{$pointer} = $pointer;
-Tom
------------------------------
Date: 14 Mar 1997 02:12:16 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: random perl core dumps with obscure message
Message-Id: <5gac60$r0m$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Kelly Hall
<hall@imall.com>],
who wrote in article <Pine.WNT.3.96.970313165715.147I-100000@boho.imall.com>:
> TIMEOUT is set in the alarm signal handler. alive_parent sees if our
> parent is pid=1, and if so, exits.
Signals and Perl do not mix well. The situation is _a tiny bit_ better
with 5.004, beta of which you should grab. And rewrite your signal
handler _very_ accurately, best if it is like this:
$TIMEOUT = 0;
$SIG{ALRM} = sub {$TIMEOUT=1; return}
(empty return and assigning to preexisting variable are
critical). However, keep in mind that approx. 2-3% of duratinon of
subroutine entry/exit frame still look prone to being disturbed by
signals.
Ilya
------------------------------
Date: 14 Mar 1997 04:29:00 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: remote to remote ftp from cgi
Message-Id: <5gak6c$j09$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
clay@panix.com (Clay Irving) writes:
:If you are thinking "ftp and Perl," get Net::FTP
This is really good advice, for a vast variety of applications.
There are many wheels on this perl vehicle, and not all need
be remade from scratch. It's hard to overstate the need to
check the modules list first.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Let me put it to you this way: computers are my business. --Andrew Hume
------------------------------
Date: 14 Mar 1997 04:19:45 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: remote to remote ftp from cgi
Message-Id: <5gajl1$j09$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, clay@panix.com (Clay Irving) writes:
Clay, what are these quotes for:
:$ftp = Net::FTP->new("$target");
:$ftp->login("$user","$password");
:if (!($ftp->put("$filename"))) {
Someday they may make you very unhappy.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
The human mind ordinarily operates at only ten percent of its capacity
--the rest is overhead for the operating system.
------------------------------
Date: Fri, 14 Mar 1997 01:50:03 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Signal catching with alarm
Message-Id: <E70FrG.A5B@bcstec.ca.boeing.com>
In article <01bc2e99$7d00a700$1fc270ce@ras_schramm.scripps.com>,
Rich Schramm <schramm@one.net> wrote:
>Hi,
>
> I am writing a script that measures the elapsed time of retrieving a given
> URL. The condition I am actually testing for will be when a URL does not
> come back in a reasonable period of time. Therefore, I need to make the
> program work so that after a given number of seconds, the "get" will abort
> and return an exit code to indicate the problem.
>
> Enter the alarm function. I am running alarm (twice actually to print the
> return code to verify that the alarm is actually being set),
I'd eliminate the second alarm. After all, the alarm call itself
failing is unlikely to be one of the "usual suspects...".
Mixing sleep with alarm isn't advised either.
A pseudo sleep'll work better:
my $sleep_start = time();
my $alarm = 10;
{ redo until time()-$sleep_start > $alarm-1 }
HTH,
--
Charles DeRykus
ced@carios2.ca.boeing.com
------------------------------
Date: 14 Mar 1997 02:01:35 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: What language do Perl REs recognize?
Message-Id: <5gabhv$ioo@picasso.op.net>
Keywords: angular, geochemical, goody, skin
In article <33274678.73835889@news.swva.net>,
Bernie Cosell <bernie@fantasyfarm.com> wrote:
>I was wondering if anyone has characterized the languages accepted by Perl
>Regular Expressions. The class is larger than the Regular Languages but
>isn't the context-free languages... what is it?
There was some discussion of this a few months ago. I cross-posted to
comp.theory, but nobody bit. It may not have a name. You might want
to see <4fj49k$j7m@monet.op.net> and its followups. In particular,
Cris Moore of Santa Fe Institute speculated in
<4g08d4$sfl@tierra.santafe.edu> that this class of languages was
equivalent to those recognized by the `queue automata', and provided a
reference.
>I didn't recall that there was a class of languages between regular
>and CF,
A class is just a set. What you've said is sort of like saying that
you didn't realize there was a set of integer in between the perfect
squares and the nonprime numbers. Of course, constructing such an
in-between set is simple: Take the squares, and toss in some nonprime
number that isn't a square, like 6. The resulting set, {1, 4, 6, 9,
16, 25, ... } is in beween the squares and the nonprimes.
Analagously, there are lots of sets of languages between the regular
languages and the context-free languages. Just find a context-free
languae that isn't regular, toss it into R, and there you go. For
example, let P(x,y) be the language of all palindromes over the
symbols x and y, and let PP be the class of languages P(x,y) for all
possible choices of x and y. Then (Union(PP,R)) is a class of
languages that is larger than R but smaller than CFL.
However, the class of languages matched by Perl regular expressions is
*not* in between R and CFL. For example,
/^(a*)b\1b\1$/
is *not* context-free.
>also, any ideas on what sort of machine implements Perl REs?
Well, there isn't necessarily such a machine in the sense you mean.
(You want a machine with a simple definition, I suppose. Otherwise,
the Perl regexp compiler code furnishes an example of just such a
machine!) But perhaps the queue automata reference from above will
yield something useful.
Note to comp.theory people: Perl regular expressions are like ordinary
regular expressions, except that they support `backreferencing'. The
Perl regular expression (X) in Perl matches the same strings that X
does, but also implicitly assigns the matched string to a register;
the Perl regular expression \1 will only match the string that is in
this register.
This means, for example, that the regular expression
(a*)b\1
represents the language {a^n b a^n : n is a natural number}, and
(a*)(b*)\1\2
represents the language {a^n b^m a^n b^m : n and m natural numbers}.
Similarly, the Perl regular expression
(.*)\1\1
represents the language { www : w is any string }. (`.*' in Perl
matches an arbitrary string.) Of course, none of these is regular in
the usual sense. However, it is well-known folk knowledge that no
Perl regular expression represents the context-free languages of
balanced parentheses or of palindromes. (I have never seen a proof of
this, however.)
I am redirecting followups to comp.theory.
--
mjd@pobox.com Mark-Jason Dominus
mjd@plover.com Plover Systems, Philadelphia, PA
------------------------------
Date: Thu, 13 Mar 1997 20:28:17 -0500
From: Alicia Carla Longstreet <carla@ici.net>
Subject: Re: Who makes more $$ - Windows vs. Unix programmers?
Message-Id: <3328A9B1.79AC@ici.net>
Ling Wang wrote:
> Windoze programmer & administrators usually are cheaper because
> they mostly migrated from the novell or pc-tech world. Their scope
> of the environment is limited, knowing mainly file and print.
> Unix people usually come from an environment where in depth
> knowledge of the given environment exists, also knowing the
> scope of the whole infrastructure.
> I see WIndoze people who click this and click that, but don't
> know what to do when error messages pops up besides clicking the
> OK button. (If it was on a UNIX environment, an easy ldd & manybe
> truss would have solved the issue easily.)
> Easy solutions that could have been solve with a script is almost
> unheard of in the Windoze administration world. If a task has
> to be done, then buy some software to do it(And it has to have
> a GUI.)
You are making a lot of nasty and possibly false assumptions. I know
some Windows programmers who know more about their system than any Unix
jock I have ever met. Further, a lot of work gets done in a DOS box on
Windows with a variety of scripting languages (one of the best being the
one included with 4DOS). There are also several very good batch
languages available for Windows 3.x, Windows 95, and Windows NT. Not to
mention the autoexec.bat and config.sys files that most network systems
(even Windows 95) make use of to start things going.
I am sorry that you experience with Windows people has been so sad, but
I suspect that your experience is severly limited.
--
********************************************
* Alicia Carla Longstreet carla@ici.net
********************************************
The first element of greatness is fundamental humbleness
(this should not be confused with servility);
the second is freedom from self;
the third is intrepid courage,
which, taken in its widest interpretation,
generally goes with truth;
and the fourth-the power to love-
although I have put it last, is the rarest.
Margot Asquith
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
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 114
*************************************