[9300] in Perl-Users-Digest
Perl-Users Digest, Issue: 2895 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 17 21:07:43 1998
Date: Wed, 17 Jun 98 18:00:29 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 17 Jun 1998 Volume: 8 Number: 2895
Today's topics:
Re: ?CGI scripts & Explorer (Bob Trieger)
Re: ?CGI scripts & Explorer (Abigail)
Re: A funny problem with "use integer" <alisdair@illusion.co.uk>
Re: A funny problem with "use integer" (Ilya Zakharevich)
Re: A funny problem with "use integer" (Allan M. Due)
Re: AIX Question (Martien Verbruggen)
Excel - Perl conversion Juli@my-dejanews.com
Re: generating sets from lists of lists <rpsavage@ozemail.com.au>
HELP : MsqlPerl1.11 make test Error <sulper@lgic.co.kr>
Help with comparing/pattern matching julih@earthlink.net
Re: Help With files, please (Bob Trieger)
Re: htpasswd in perl? (Gabor)
Re: I need help with my ^M problem. (Tad McClellan)
Re: I need help with my ^M problem. (Bob Trieger)
Killing STDOUT within a CGI script? <boonen@virtual-affairs.nl>
Overriding a method (Matt Ackeret)
Perl and Multicast <nroth@connix.com>
Re: Perl CGI NT 4.0 follow up (Bob Trieger)
Please HELP convert a SIMPLE 2 Line DOS Batch File!! <sales@doug-robinson.com>
Re: Please HELP convert a SIMPLE 2 Line DOS Batch File! (Larry Rosler)
Re: Please HELP convert a SIMPLE 2 Line DOS Batch File! (Ilya Zakharevich)
Re: Please HELP convert a SIMPLE 2 Line DOS Batch File! (Larry Rosler)
Re: Pod::Text -- Unix only? (Stuart McDow)
Re: Puzzle challenge (clarified) (Martien Verbruggen)
Re: Q: how to set regex options on the fly (Mike Stok)
Re: Q: how to set regex options on the fly (Craig Berry)
Re: REVIEW: Perl CGI Programming - No Experience Requir (Rahul Dhesi)
Sayings of the Week Nomination <peterm@zeta.org.au>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 17 Jun 1998 22:43:46 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: ?CGI scripts & Explorer
Message-Id: <6m9gud$78l$2@strato.ultra.net>
steele@cybersol.com (steel) wrote:
-> Hi,
->
-> I have a very basic perl cgi guestbook script that
-> works fine with Netscape but won't write when
-> I use Internet Explorer.
Yes, use Netscape when you want it to work and Explorer when you don't.
Or perhaps, you could ask in a newgroup that might have the slightest thing to
do with your problem.
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-239-0341
and hang up when the recording starts. "
------------------------------
Date: 18 Jun 1998 00:11:02 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: ?CGI scripts & Explorer
Message-Id: <6m9lum$blt$9@client3.news.psi.net>
steel (steele@cybersol.com) wrote on MDCCLI September MCMXCIII in
<URL: news:steele-1706981332300001@tc1-modem81.cybersol.com>:
++ Hi,
++
++ I have a very basic perl cgi guestbook script that
++ works fine with Netscape but won't write when
++ I use Internet Explorer.
++
++ Any suggestions?
1-800-CALL-BILL
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: Thu, 18 Jun 1998 00:34:10 +0100
From: Alisdair McDiarmid <alisdair@illusion.co.uk>
Subject: Re: A funny problem with "use integer"
Message-Id: <4857D99EC7%alisdair@illusion.co.uk>
Please excuse the reformatting.
In message <6m99g8$ku3@news-central.tiac.net>
mike@stok.co.uk (Mike Stok) wrote:
> In article <6m95m5$juj$1@mathserv.mps.ohio-state.edu>,
> Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> >[A complimentary Cc of this posting was sent to Bernard Cosell
> ><bernie@fantasyfarm.com>],
> >who wrote in article <3588ecbd.65423351@ganymede.rev.net>:
> >> Anyone know what's going on here?
> >
> >Yes. Upgrade.
>
> What should he upgrade? On my x86 linux box 5.004_04 and 5.004_66
> versions both produce [incorrect output] but my alpha based
> machine with perl 5.004_04 says [the correct output]
Nick Clark's RISC OS Perl 5.004_04 port produces the incorrect
output and the NetBSD/arm32 version produces the correct output
(on the same machine).
> I'm not saying that getting onto 5.004_04, the current stable
> release, is a bad thing - just wondering if it'll cure this
> particular problem.
It doesn't in my case.
[cc'd to nick@illusion.co.uk]
--
Alisdair McDiarmid \ <mailto:alisdair@illusion.co.uk>
Illusion Software \ <http://www.illusion.co.uk/software/>
Illusion Web Design \ <http://www.illusion.co.uk/web/>
010000EF2F2064616E67657261206E616A6261722D616A6F0202FD000EF0A0E1
Version: 2.6.3ia
Charset: noconv
iQB1AwUBNYhhFMI9N74S3HIZAQHLpwL/dk3Dn15JHMvPS73+fgT/fO8lIc3AoEz4
dhxwy0314CUgAdDYrLTywbCWZp8gLcat/tMXh8HoNhQsS2uUuXfTeKxbWFUSPCYZ
OVPAm1osd+PCuKkFTGZE0do/6cs4dlXG
=JqGw
-----END PGP SIGNATURE-----
------------------------------
Date: 18 Jun 1998 00:13:28 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: A funny problem with "use integer"
Message-Id: <6m9m38$n13$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Alisdair McDiarmid
<alisdair@illusion.co.uk>],
who wrote in article <4857D99EC7%alisdair@illusion.co.uk>:
> Nick Clark's RISC OS Perl 5.004_04 port produces the incorrect
> output and the NetBSD/arm32 version produces the correct output
> (on the same machine).
Looks like an atoi() issue. One may try to provide
print "a=", $a+0, ", b=", $b+0, "\n";
too (or whatever are the names of the variables).
Ilya
------------------------------
Date: 18 Jun 1998 00:46:43 GMT
From: due@murray.fordham.edu (Allan M. Due)
Subject: Re: A funny problem with "use integer"
Message-Id: <6m9o1j$8an$0@206.165.146.32>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
In article <6m9m38$n13$1@mathserv.mps.ohio-state.edu>, Ilya Zakharevich
(ilya@math.ohio-state.edu) posted...
|Looks like an atoi() issue. One may try to provide
|
| print "a=", $a+0, ", b=", $b+0, "\n";
|
|too (or whatever are the names of the variables).
|
|Ilya
|
Well, I still think it is a memory allocation issue, as I hypothesized
in my other post. Let's use another example. What do you all obtain as
output for the following script?
-------------
#!/usr/local/bin/perl
#use strict;
#If 4 byte memory storage is used to store
#integers under use integer
#then we should expect problems to begin when
#attempting to add 1 to 2147483647.
#At that point the output should wrap to the other end of
#the range (-2147483648) and then decrease
use integer ;
my $a = "2147483645" ;
for (my $I = 0; $I <=4; $I++) {
print $a + $I," \n";
}
---------------
My output is:
2147483645
2147483646
2147483647
-2147483648
-2147483647
Which is just what I would expect if only 4 bytes where used to store
the integers under use integer. To me this is not a bug but not quite a
feature. More a price to be paid for more speed.
--
Allan M. Due
Due@Murray.Fordham.edu
The beginning of wisdom is the definitions of terms.
- Socrates
------------------------------
Date: 17 Jun 1998 23:23:48 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: AIX Question
Message-Id: <6m9j64$i53$2@comdyn.comdyn.com.au>
In article <6m7pue$941$1@nnrp1.dejanews.com>,
jcamp@plexi.com writes:
> Ok, I'm developing on a Rehat linux machine, and GDBM works fine. But the
> production is on an IBM AIX machine. When a GDBM database gets 5 or 6 20k
> records, it returns the following error:
>
> [14/Jun/1998:14:50:27] failure: for host nywa140950.btco.com trying to POST
> /cgi-bin/euro/faq/admin.cgi, cgi-parse-ou
> tput reports: the CGI program /www/wwwdev/ns-cgi-bin/euro/faq/admin.cgi did
> not produce a valid header (name without
> value: got line "lseek error at /www/wwwdev/ns-cgi-bin/euro/faq/admin.cgi
> line 363.")
This seems to be stderr output from perl saying something like:
lseek error at /www/wwwdev/ns-cgi-bin/euro/faq/admin.cgi line 363.
Since the script that you included has nothing that could produce that
error, it seems that it's originating somewhere else. Check that
script.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: Thu, 18 Jun 1998 00:07:39 GMT
From: Juli@my-dejanews.com
Subject: Excel - Perl conversion
Message-Id: <6m9lob$48m$1@nnrp1.dejanews.com>
I am looking for a script that will convert excel into perl.
Any idea if a script like this exists? and where I could possibily obtain it?
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 17 Jun 1998 23:44:36 GMT
From: "Ron Savage" <rpsavage@ozemail.com.au>
Subject: Re: generating sets from lists of lists
Message-Id: <01bd9a4a$5be602e0$43ea1286@steelres-pcm657.resmel.bhp.com.au>
Perhaps try:
Combinatorial Algorithms
2nd ed
A Nijenhuis & H Wilf
Academic Press
0-12-519260-6
Joel Coltoff <joel@wmi0.wmi.com> wrote in article
<6m8ioi$sf7@netaxs.com>...
> I'm looking for a clever solution to the following problem. I've
> got a small number of lists of lists. I want to generate all the
> combinations of sets that can be formed from these lists. The problem
[snip]
------------------------------
Date: Thu, 18 Jun 1998 09:16:00 +0900
From: sulper <sulper@lgic.co.kr>
Subject: HELP : MsqlPerl1.11 make test Error
Message-Id: <35885C3F.5B43DA2@lgic.co.kr>
I'm failing the 'make test' under Solalis2.5, running perl 5.003,
Msql2.0.
Everything else seems to be okay... no compile time problems.
Here are the results of my "make test":
make test
================================================================================
PERL_DL_NONLAZY=1 /usr/bin/perl -I./blib/arch -I./blib/lib
-I/home1/util/lib/per
l5/sun4-solaris/5.003 -I/home1/util/lib/perl5 -e 'use Test::Harness
qw(&runtests
$verbose); $verbose=0; runtests @ARGV;' t/*.t
t/msql..............MSQL's message: syntax error at line 2 near ", time"
at t/ms
ql.t line 326.
MSQL's message: syntax error at line 2 near ", time" at t/msql.t line
330.
MSQL's message: syntax error at line 2 near ", time" at t/msql.t line
330.
MSQL's message: syntax error at line 2 near ", time" at t/msql.t line
330.
Cannot create table: query [create table TABLO02 ( name char(40) not
null,
num int, country char(4), time real )] message [syntax error
at line
2 near ", time"]
FAILED tests 28-68
Failed 41/68 tests, 39.71% okay
Test returned status 255 (wstat 65280)
t/msql2.............ok
Failed 1 test script, 50.00% okay. 41/82 subtests failed, 50.00% okay.
Error 29
=================================================================================
Your quick response will be helpfull for me.
Thank You.
------------------------------
Date: Wed, 17 Jun 1998 22:01:38 GMT
From: julih@earthlink.net
Subject: Help with comparing/pattern matching
Message-Id: <6m9ec1$ohg$1@nnrp1.dejanews.com>
unless (open(LIST, "list.pl")) {
die ("Can't open list\n");
}
$rep_name = "RIA";
while (<LIST>) {
if ($_ =~ "$rep_name") {
substr($_,3) =~ tr/a-z/A-Z/;
print "Rep name found keep in caps $_\n"; exit;
}
else{
substr($rep_name,0) =~ tr/a-z/A-Z/;
substr($rep_name,1) =~ tr/A-Z/a-z/;
print "Rep name not found keep capitalize $rep_name\n";
exit;
}
}
What I'm doing is comparing a name against a file,
if the name exists in the file, keep it in caps,
else, take the name and capitalize the first letter.
When I use =~ in the If statement name is capitalized.
When I use = in the If statement the entire name is capitalized.
This is the only way I can get them to work separately, but not together.
Any help is appreciated - julih@earthlink.net
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 17 Jun 1998 22:55:50 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Help With files, please
Message-Id: <6m9hl2$78l$3@strato.ultra.net>
[ posted and mailed ]
dasha@shpl.ru wrote:
-> I have a diferent files (www.myhost.com/file.htm, file1.htm , file2,htm)
-> and i want choose one of them
-> in simple form and then print this file into browser.
print "Location: http://www.myhost.com/file.htm\n\n";
-> And this must be done by perl script...
Why in the world must this be done by a perl script? Is it homework?
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-239-0341
and hang up when the recording starts. "
------------------------------
Date: 17 Jun 1998 21:44:56 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: htpasswd in perl?
Message-Id: <slrn6oge70.pjp.gabor@localhost.vmunix.com>
In comp.lang.perl.misc, Joseph A. DiVerdi, Ph.D. <diverdi@XTRsystems.com> wrote :
# In article <8clnqwgmx2.fsf@gadget.cscaper.com>, Randal Schwartz
# <merlyn@stonehenge.com> wrote:
#
# > Need help with a script I am working on that will create
# > passwords the same as htpasswd executable.
#
# Randal,
#
# Here is a complete code snippit that shows you how to do it and actually
# works. The script is executed as follows:
#
# encrypt plain_text_password [user_specified_salt]
#
# Obviously, I have called the script 'encrypt'. You can have the script
# generate its own salt or you can enter your own value. It prints the
# encrypted value on the next line.
[snip]
<sarcasm>
This is just too funny. Someone explaining to Randal Schwartz how to do
something in Perl. Priceless! :) I guess I shouldn't have bought
Programming Perl which was co-written by him.
</sarcasm>
------------------------------
Date: Wed, 17 Jun 1998 16:15:05 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: I need help with my ^M problem.
Message-Id: <pkb9m6.hei.ln@localhost>
Bobby Chan (kwb_cha@alcor.concordia.ca) wrote:
: . There is no problem with UNIX based input, only Windows based.
Fitting, that...
: Is there any way to remove that ^M?
tr/\r//d; # delete carriage returns
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 17 Jun 1998 23:01:21 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: I need help with my ^M problem.
Message-Id: <6m9hvc$78l$4@strato.ultra.net>
[ posted and mailed ]
kwb_cha@alcor.concordia.ca (Bobby Chan) wrote:
->
-> Hi...
->
-> I'm taking a class on CGI/Perl programming and I can't figure out
-> how to get rid of the ^M ...........
If you set the type to ascii when you FTP the scripts to UNIX you won't get
the ^Ms.
Use s/\cM//; in perl to fix the ones you already FTP'd incorrectly.
Or there is also a script win2unix that will strip them for you and most
likely exists on your Unix host.
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-239-0341
and hang up when the recording starts. "
------------------------------
Date: Thu, 18 Jun 1998 00:05:41 +0200
From: Lon Boonen <boonen@virtual-affairs.nl>
Subject: Killing STDOUT within a CGI script?
Message-Id: <35883DAF.70F1@virtual-affairs.nl>
Hallo everybody,
I am developing a CGI script that runs on a NT Server.
Funny thing about it is that I want it to send some strange mime-type to
the browser, thus waking up some clientside helper application, that
starts talking to my server...
Now I want my CGI script to wait until the helper application and the
server are finished talking so I can use their communication results.
BUT! If my CGI-script sends the weird mime-type to STDOUT, output will
be spooled and will not arrive at the browser and thus the helper
application won't start.
Even if I use streaming output ($|=1;) the browser is not convinced that
it should spawn the helper application because it notices that the
socket connection to the CGI script is still open (since the script is
still alive) and for all the browser knows the script might send more
bytes...
The only way I know of triggering the browser to start processing input
is by ending the CGI-script. But that I don't want because I would like
to wait for the results of the helper-application.
At last: my question. Is it possible to sort of 'kill' 'STDOUT' or
whatever without killing the CGI-script and thereby telling the browser
that it can start processing its input (and so starting the helper
application since the input is some strange mime-type)?
Am I making things clear? I would be very obliged (at least I think I
would be very obliged, since my english isn't that good, but I think I
just wrote I would be very happy).
Lon Boonen
lonbeans@xs4all.nl
------------------------------
Date: 17 Jun 1998 23:53:13 GMT
From: mattack@area.com (Matt Ackeret)
Subject: Overriding a method
Message-Id: <6m9kt9$1ricj$1@iris.area.com>
First - I admit I'm being a hypocrite and asking a very simplistic question
that would probably annoy me on other newsgroups. I've got "Programming Perl"
on order from altbookstore, but hope someone can give me one example first.
(I have Learning Perl and the CGI programming book, neither of which answer
this question.)
>From the Perl documentation for LWP::UserAgent
$ua->redirect_ok
This method is called by request() before it tries to do any
redirects. It should return a true value if the redirect is
allowed to be performed. Subclasses might want to override
this.
The default implementation will return FALSE for POST
request and TRUE for all others.
Could someone give me an example of how to override that to return true?
I believe this is the reason why an earlier sample I posted doesn't work,
because the host is redirecting but it's defaulting to false (which somehow
the host is recognizing.. and giving an invalid search response back.)
--
mattack@area.com
------------------------------
Date: Wed, 17 Jun 1998 18:29:35 -0400
From: Nicci Tynen <nroth@connix.com>
Subject: Perl and Multicast
Message-Id: <Pine.BSI.3.95.980617180902.12371D-100000@comet.connix.com>
Please respond to nicci@orincon.com
Hi,
I am using java and multicast to monitor my system logs. I have written
a Perl script that checks to make sure the necessary processes are
running. This script broadcasts that the processes are up or down to a
multicast address. What happens is when I run the perl monitoring
script, the perl mutlicast will cause the java multicast messages to be
corrupted. If I don't run the perl script, it doesn't happen. I know
I'm doing something wrong with the way perl is sending messages to the
group.
Here's what the send code looks like, maybe someone can spot what I'm
doing wrong.
#! /usr/local/bin/perl
.
.
.
use Socket;
use Sys::Hostname;
.
.
.
$iaddr = gethostbyname("228.5.6.7");
$proto = getprotobyname('udp');
$port = ('5800');
.
.
.
socket(SOCKET, PF_INET, SOCK_DGRAM, $proto) || die "Couldn't get socket: $!";
$paddr = sockaddr_in($port, $iaddr);
$OKSOCKETSEND = "SYSMON $TIME M systems online";
send(SOCKET, $OKSOCKETSEND, 0, $paddr) || die "Couldn't send information";
close(SOCKET);
If anyway has any idea what is missing, please let me know.
TIA,
nicci
------------------------------
Date: Wed, 17 Jun 1998 23:09:20 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Perl CGI NT 4.0 follow up
Message-Id: <6m9ieb$78l$5@strato.ultra.net>
[ posted and mailed ]
edgar@sbrt.com wrote:
-> Setup:
-> Win NT 4.0 running IIS
-> Perl version 5.004
->
-> I have executed the self extracting perl .exe under InetPub\scripts\perl
Sounds like you have your perl interpreter now installed in your script or
cgi-bin directory. Do you have any clue how dangerous this is? If I were you,
I'd delete it the minute I read this response and install it somewhere outside
of the httpd server's tree, like say in it's default directory c:\perl\bin
Please don't ask me for any other advice, it is all over the net if you look
for it.
Good luck
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-239-0341
and hang up when the recording starts. "
------------------------------
Date: Wed, 17 Jun 1998 14:57:41 -0700
From: Doug Robinson <sales@doug-robinson.com>
Subject: Please HELP convert a SIMPLE 2 Line DOS Batch File!!
Message-Id: <35883BD5.3227@doug-robinson.com>
OK, I admit it--I don't know anything about Perl!! (I just got the
"Perl for Dummies" book last night!)
But I have an immediate, pressing need to convert a simple 2-line DOS
batch file to a Perl script and I haven't learned enough about it to do
it. Here it is:
md 5
echo "This is some text" > c:\5\t.txt
That's it. It creates a directory and then directs the text in quotes
into a file called t.txt.
Could someone PLEASE send me the Perl equivalent? I'd be forever in
your debt! I know it's so simple, but I can't find anyone at my ISP to
help me even do this!
Thanks (and no laughing)!!
Doug
------------------------------
Date: Wed, 17 Jun 1998 16:06:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Please HELP convert a SIMPLE 2 Line DOS Batch File!!
Message-Id: <MPG.ff1ebd98296db6e989698@nntp.hpl.hp.com>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
In article <35883BD5.3227@doug-robinson.com>, sales@doug-robinson.com
says...
> OK, I admit it--I don't know anything about Perl!! (I just got the
> "Perl for Dummies" book last night!)
>
> But I have an immediate, pressing need to convert a simple 2-line DOS
> batch file to a Perl script and I haven't learned enough about it to do
> it. Here it is:
>
> md 5
> echo "This is some text" > c:\5\t.txt
>
> That's it. It creates a directory and then directs the text in quotes
> into a file called t.txt.
>
> Could someone PLEASE send me the Perl equivalent? I'd be forever in
> your debt! I know it's so simple, but I can't find anyone at my ISP to
> help me even do this!
>
> Thanks (and no laughing)!!
> Doug
OK, just this once. Provided you promise to learn. The example is
written to get you into good habits for the future. You are now forever
in my debt!
#!perl -w
use strict;
my $dir = 'c:/5';
my $file = 't.txt';
-d $dir or mkdir $dir, 0 or die "a horrible death, because $!";
open OUT, ">$dir/$file" or die "even more gruesomely, $!";
print OUT "This is some text\n";
close OUT;
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 18 Jun 1998 00:10:47 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Please HELP convert a SIMPLE 2 Line DOS Batch File!!
Message-Id: <6m9lu7$mi4$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Larry Rosler
<lr@hpl.hp.com>],
who wrote in article <MPG.ff1ebd98296db6e989698@nntp.hpl.hp.com>:
> OK, just this once. Provided you promise to learn. The example is
> written to get you into good habits for the future. You are now forever
> in my debt!
> open OUT, ">$dir/$file" or die "even more gruesomely, $!";
> print OUT "This is some text\n";
> close OUT;
You did not check errors on close(), so do not know whether your
print() succeeds.
Ilya
------------------------------
Date: Wed, 17 Jun 1998 17:45:02 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Please HELP convert a SIMPLE 2 Line DOS Batch File!!
Message-Id: <MPG.ff202e96f92f019989699@nntp.hpl.hp.com>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
In article <6m9lu7$mi4$1@mathserv.mps.ohio-state.edu>, ilya@math.ohio-
state.edu says...
> [A complimentary Cc of this posting was sent to Larry Rosler
> <lr@hpl.hp.com>],
> who wrote in article <MPG.ff1ebd98296db6e989698@nntp.hpl.hp.com>:
> > OK, just this once. Provided you promise to learn. The example is
> > written to get you into good habits for the future. You are now forever
> > in my debt!
>
> > open OUT, ">$dir/$file" or die "even more gruesomely, $!";
> > print OUT "This is some text\n";
> > close OUT;
>
> You did not check errors on close(), so do not know whether your
> print() succeeds.
>
> Ilya
It might have been worse. I was tempted to omit the close() entirely and
default it to wrap-up, but decided that was bad pedagogy :-)
The conditions under which close() might fail are bizarre in any case.
As this isn't a pipe, I'm not sure what they might be.
If one wants to know whether print() succeeds, shouldn't one ask print()
or die? But no one *ever* does that. I know print() can fail on a full
file system, for example, but would that necessarily be reflected by a
failure to close()?
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 17 Jun 1998 23:30:09 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Pod::Text -- Unix only?
Message-Id: <6m9ji1$3ve$1@ns1.arlut.utexas.edu>
murrayb@vansel.alcatel.com (Brad Murray) writes:
>
> truly cross-platform and not just multi-unix
This is confusing. Multi-unix is cross-platform.
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: 17 Jun 1998 23:14:08 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Puzzle challenge (clarified)
Message-Id: <6m9ik0$i53$1@comdyn.comdyn.com.au>
In article <6m8mtm$n1t@sjx-ixn10.ix.netcom.com>,
jeff@yoak.com (Jeff Yoak) writes:
> rjk@coos.dartmouth.edu (Ronald J Kimball) wrote:
>>Daniel Grisinger <dgris@perrin.dimensional.com> wrote:
[snip]
>>> 2. Some messengers scrambled the order of the message, others forgot
>>> parts of it. None did both, all did one.
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>>That makes it rather easy.
>>
>>Find two messages with words in a different order. The longer one must
>>contain all the words and be in the wrong order.
>
> Why couldn't one messenger forget two words and the other forget only
> one?
I think that it depends on how you read that condition. You can
interpret it as 'No messenger made both _types_ of mistake. All
messengers made one type of mistake, but could make this mistake
multiple times' (i.e. forget more than one word, or scramble the order
three times). You could also read it as 'No messenger made both
mistakes. All messengers made one mistake', which I think is what
Ronald Kimball read it as. Of course that would be equivalent to
saying: 'All messagers made one mistake exactly'.
>> All messages which
>>contain the same number of words are also in the wrong order.
>
> I must be missing something. If two messengers each forgot n words,
> why wouldn't they all be in the correct order?
Again, this comes down to how you read that condition.
That's why mathematicians, logicians and philosophers are always so
annoyingly precise :)
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | 75% of the people make up 3/4 of the
Commercial Dynamics Pty. Ltd. | population.
NSW, Australia |
------------------------------
Date: 17 Jun 1998 22:13:37 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Q: how to set regex options on the fly
Message-Id: <6m9f2h$o8t@news-central.tiac.net>
In article <6m9acq$jan$1@nnrp1.dejanews.com>,
<Matthew.Wickline@usa.net> wrote:
>I'm writting a subroutine which will take some args, build an
>annonymous subroutine based on those args, and then return a
>reference to that anonymous sub. No problem there.
>
>For the purposes of this message, we'll assume that the *only*
>difference in these subroutines is the options used on a m//
>operator burried within the anonymous subroutines. Depending on
>the args given, there may be any/some/all of the imsx options.
Look for the description of (? ... ) in the perlre manual page and all
should become clear.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: 17 Jun 1998 22:37:41 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Q: how to set regex options on the fly
Message-Id: <6m9gfl$e5a$1@marina.cinenet.net>
Matthew.Wickline@usa.net wrote:
: I'm writting a subroutine which will take some args, build an
: annonymous subroutine based on those args, and then return a
: reference to that anonymous sub. No problem there.
:
: For the purposes of this message, we'll assume that the *only*
: difference in these subroutines is the options used on a m//
: operator burried within the anonymous subroutines. Depending on
: the args given, there may be any/some/all of the imsx options.
:
: Is there an easier way to do this than to code out some 2^4
: anonymous subroutines and do an equivilant of a case?
:
: Is there a way to have those options be set on the fly, and
: then just have one anonymous sub coded with a variable placed
: where those options would be?
One way is to create the matchers on the fly, with the required
options:
#!/usr/bin/perl -w
# rxsub - demonstrates construction of an anonymous sub with
# configurable regex options inside.
sub makeSub
{
local $opts = shift;
eval "sub { my \$str = shift; \$str =~ /x/$opts }";
}
my @subs = map { makeSub($_) } ('', 'i', 'g', 'ig');
my $test = 'abc xXxx q xX';
foreach my $sub (@subs) {
print join ':', &$sub($test);
print "\n";
}
This outputs
1
1
x:x:x:x
x:X:x:x:x:X
The only other way that springs immediately to mind is to put the desired
options into a global variable, then interpolate then in (?imsxg) form
into the regex. I leave the details as an exercise for someone with more
time. :)
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 18 Jun 1998 00:36:46 GMT
From: c.c.eiftj@54.usenet.us.com (Rahul Dhesi)
Subject: Re: REVIEW: Perl CGI Programming - No Experience Required
Message-Id: <6m9neu$dus$1@samba.rahul.net>
In <pudge-1706980805290001@dynamic464.ply.adelphia.net> pudge@pobox.com
(Chris Nandor) writes:
>Here it is, your definition, which was
>already 100 percent inferrable from the above information:
> an array is a variable. a list is not.
>That simple. Go home now.
I will buy that, if everybody else will agree with you.
My next question is: If the only difference between the two is that one
is in a single variable, and the other is explicitly enumerated, why are
we making such a a big deal of this difference? We don't make a big
deal of the fact that the interger held in $i is differnt from the
integer explicitly denoted by 15. If the ONLY difference between two
things is that one is in a variable and the other is not, that's hardly
a difference worth arguing about.
--
Rahul Dhesi <dhesi@spams.r.us.com>
------------------------------
Date: Thu, 18 Jun 1998 09:53:37 +1000
From: "Peter G. Martin" <peterm@zeta.org.au>
Subject: Sayings of the Week Nomination
Message-Id: <35885701.BF2E6107@zeta.org.au>
In comp.lang.perl.misc, Tom Christiansen said:
> Maybe it's just that time of the mornin, but I take umbrage here.
Yeah, Tom: some of us had noticed.... :-)
--
peterm
Peter G. Martin, Tech.Writer & Perl User, The Scribe & Chutney Trust
peterm@zeta.org.au, http://www.zeta.org.au/~peterm
ROZELLE, Australia +61 2 9818 5094
------------------------------
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 2895
**************************************