[8661] in Perl-Users-Digest
Perl-Users Digest, Issue: 2278 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 8 20:07:19 1998
Date: Wed, 8 Apr 98 17:00:28 -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, 8 Apr 1998 Volume: 8 Number: 2278
Today's topics:
5.005 stvhoof@netvision.net.il
Re: @INC and avoiding -I (Craig Berry)
A puzzling problem (W Schipper)
Re: Explicit file handling: Cannot update file (Perl fo (Oliver Heidelbach)
greediness problem matching date expressions? help <nagare@emrtc.nmt.edu>
Re: greediness problem matching date expressions? help (Douglas Wilson)
Help w/rename pleez... <mark@imp.net>
Re: How do I sort without having a space before the rec stvhoof@netvision.net.il
Re: HOW TO DETERMINE EXECUTABLE VERSION IN WIN95 (Martien Verbruggen)
Re: Korn to Perl, Help! stvhoof@netvision.net.il
LWP that works with SLL stvhoof@netvision.net.il
MVS stvhoof@netvision.net.il
Re: MVS <trawick@ibm.net>
Re: Password Problem <rootbeer@teleport.com>
PID, fork(), exec() question again... (Michael Shavel)
Re: Problems with "use integer" in combination of CGI.p <rootbeer@teleport.com>
Re: Read file and interpolate contents as string? <grinch@whoville.com>
Re: Read file and interpolate contents as string? (Maurice Aubrey)
Re: RMS should be invited to O'Reilly's "Free Software atai@ece.ucsd.edu
Re: RMS should be invited to O'Reilly's "Free Software <stutz@dsl.org>
Re: scanf substitute in perl <grinch@whoville.com>
search operator question <jeremyhough@hotmail.com>
Re: search operator question <jdf@pobox.com>
Re: serpinski gasket almost-1-liner needs polishing (Ronald L. Parker)
Re: serpinski gasket almost-1-liner needs polishing <scribble@pobox.com>
Re: Simple Unix Question, ( Simple for you maybe ) (Martien Verbruggen)
Re: Strange "Modification of a read-only value attempte <james.a.squire@boeing.com>
Re: Trouble running html2ps perl script on NT4.0 (Martien Verbruggen)
Re: Trying to Match two lists <falkenl@hotmail.com>
UNIX, system(), and text that isn't output. <Nathaniel.Meyers@ucop.edu>
Why can't I WRITE/CREATE files from perl5 CGI script (Brian Zisk)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 08 Apr 1998 17:01:23 -0600
From: stvhoof@netvision.net.il
Subject: 5.005
Message-Id: <6ggs3j$4dm$1@nnrp1.dejanews.com>
When is 5.005 coming out?
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 8 Apr 1998 22:59:04 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: @INC and avoiding -I
Message-Id: <6ggvfp$3uk$1@marina.cinenet.net>
Larry Rosler (lr@hpl.hp.com) wrote:
: Build Administrator wrote:
: > On an NT4 system, how/where does @INC get initialized?
: >
: > I'm unable to use modules and INC is pointing to the wrong directories.
: > If I attempt to append to it at run time (prior to a use directive),
: > the use directive is flagged and the script won't run.
:
: Have you tried prepending to @INC in a BEGIN block (preferably the first
: BEGIN in 'main')? After that, the 'use' directives in the program
: proper should behave correctly. (This should work on Windows or UNIX,
: whatever.)
Or equivalently, just do: use lib '/path/to/add';
(Before your other 'use', of course.)
---------------------------------------------------------------------
| 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: 8 Apr 1998 23:03:30 GMT
From: schipper@morgan.ucs.mun.ca (W Schipper)
Subject: A puzzling problem
Message-Id: <6ggvo2$rql$1@coranto.ucs.mun.ca>
I have written a filter to convert email message headers to a format
that will allow us to upload an archive of listserv discussions to a
Webcat database. Basically this involves taking information from the
From:, Date, and Subject: lines, parsing it, and constructing additional
headers, etc. A bit tricky for a novice, but fun, and I learned more
about Perl and the Camel book than I thought possible, or possibly even
wise.
But I am having a problem that I can't find a solution for, and so ask
for your collective advice. A number of headers (most notoriously
the ones that begin "Received: ..." are followed by several additional
lines that begin with a tab or a series of spaces to look like indents.
Here is what I tried to do:
if ($Newline =~ /^Received:/){
$Newline = <>;
until ($Newline =~ /^\w+/){
$Newline = <>;
}
}
That works fine for most of the headers, but not all. The problematic
headers look like this:
>From owner-medtextl@POSTOFFICE.CSO.UIUC.EDU Thu Jan 1 11:24:05 1998
Received: from grape.EASE.LSOFT.COM (grape.ease.lsoft.com
[206.241.12.34])
by piva.ucs.mun.ca (8.8.8/8.8.7) with ESMTP id LAA24936
for <schipper@MORGAN.UCS.MUN.CA>; Thu, 1 Jan 1998 11:24:04 -0330
(NST)
Received: from PEAR.EASE.LSOFT.COM (206.241.12.19) by
grape.EASE.LSOFT.COM (LSMT
P for OpenVMS v1.1b) with SMTP id <4.6B920D76@grape.EASE.LSOFT.COM>;
Thu, 1 Jan
1998 9:53:01 -0500
Received: from POSTOFFICE.CSO.UIUC.EDU by POSTOFFICE.CSO.UIUC.EDU
(LISTSERV-TCP/IP release 1.8b) with spool id 7432054 for
MEDTEXTL@POSTOFFICE.CSO.UIUC.EDU; Thu, 1 Jan 1998 08:53:52
-0600
Received: from acad (acad.winthrop.edu [192.203.180.3]) by
postoffice.cso.uiuc.edu (8.8.5/8.8.5) with SMTP id IAA50906
for
<medtextl@postoffice.cso.uiuc.edu>; Thu, 1 Jan 1998 08:53:51
-0600
X-VMS-To: smtp%"medtextl@postoffice.cso.uiuc.edu"
Message-ID: <98010109542047@winthrop.edu>
Date: Thu, 1 Jan 1998 09:54:20 -0500
Reply-To: Medieval Texts - Philology Codicology and Technology
<MEDTEXTL@POSTOFFICE.CSO.UIUC.EDU>
Sender: Medieval Texts - Philology Codicology and Technology
<MEDTEXTL@POSTOFFICE.CSO.UIUC.EDU>
From: JO KOSTER TARVERS <tarversj@WINTHROP.EDU>
Subject: AOES?
To: Multiple recipients of list MEDTEXTL
"1998.all" 60316 lines, 3098922 characters
Subject: AOES?
To: Multiple recipients of list MEDTEXTL
<MEDTEXTL@POSTOFFICE.CSO.UIUC.EDU>
WINTHROP UNIVERSITY Electronic Mail
Message
The script eliminates the lines beginning with Received:, and the
following lines that begin with spaces or a tab, except for the two
after the 4th "Received:". I've tried everything I can think --
additional if statements in the until loop (to look for /^\s+/ or
/^\t|^\t/, but nothing i try seems to work. Can anyone see what the
problem with my bit of code is?
Many thanks.
Bill
<schipper@morgan.ucs.mun.ca>
------------------------------
Date: 8 Apr 1998 23:35:03 GMT
From: oheiabbd@zedat.fu-berlin.de (Oliver Heidelbach)
Subject: Re: Explicit file handling: Cannot update file (Perl for OS/2)
Message-Id: <CmxVjOhTikQl-pn2-0UOFvNCE2dcO@oheiabbd.dialup.fu-berlin.de>
On Wed, 8 Apr 1998 00:47:30, Tom Phoenix <rootbeer@teleport.com>
wrote:
> On 7 Apr 1998, Oliver Heidelbach wrote:
>
>
> > while (<LOG1>) {
> > s/diffs/diff/;
> > print LOG1; # no effect here!
>
> Check out the FAQ's info on updating text files. Also, on many systems,
> you must seek() when switching from read to write, or vice versa, even if
> you're already in the right place.
>
Thanks for the hint. Difficult to find, but on the second
read-through I had it.
Thanks again.
Regards,
Oliver
------------------------------
Date: Wed, 08 Apr 1998 16:11:40 -0600
From: Josh England <nagare@emrtc.nmt.edu>
Subject: greediness problem matching date expressions? help
Message-Id: <352BF61C.B4EAF1C2@emrtc.nmt.edu>
I am having a problem matching dates which roll-over past the year
2000. I have a perl program which builds a regular expression for the
date range as follows:
(Apr\s{1,2}([3][0-1]|[2][0-9]|[1][2-9]).{12}98)|((May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s{1,2}([3][0-1]|[1-2][0-9]|[1-9]).{12}98)|((Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s{1,2}([3][0-1]|[1-2][0-9]|[1-9]).{12}([9][9]))|((Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s{1,2}([3][0-1]|[1-2][0-9]|[1-9]).{12}([0-0][0-9]|[1][0-0]))|((Jan|Feb|Mar|Apr)\s{1,2}([3][0-1]|[1-2][0-9]|[1-9]).{12}11)|(May\s{1,2}([1-4]).{12}11)
This is supposed to match dates in the range from 4/12/98 - 5/4/11, but
matches such dates as:
Fri Mar 20 15:18:15 1998
Fri Jun 16 16:43:12 2017
and doesn't match: Tue Apr 3 07:27:55 2018
I don't understand what is going on. Is it a greedyness problem with
the .{12}? The above regexp looks to me like it should work. Can
anyone help me?
Thanks in advance for any replies.
-Josh England
------------------------------
Date: Wed, 08 Apr 1998 23:38:44 GMT
From: dgwilson@gte.net (Douglas Wilson)
Subject: Re: greediness problem matching date expressions? help
Message-Id: <6gh1jf$gor$1@gte1.gte.net>
On Wed, 08 Apr 1998 16:11:40 -0600, Josh England
<nagare@emrtc.nmt.edu> wrote:
Why are you using a regexp?
Its not at all clear, and probably not very efficient.
Hope that helps,
Douglas Wilson
>I am having a problem matching dates which roll-over past the year
>2000. I have a perl program which builds a regular expression for the
>date range as follows:
>(Apr\s{1,2}([3][0-1]|[2][0-9]|[1][2-9]).{12}98)|((May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s{1,2}([3][0-1]|[1-2][0-9]|[1-9]).{12}98)|((Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s{1,2}([3][0-1]|[1-2][0-9]|[1-9]).{12}([9][9]))|((Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s{1,2}([3][0-1]|[1-2][0-9]|[1-9]).{12}([0-0][0-9]|[1][0-0]))|((Jan|Feb|Mar|Apr)\s{1,2}([3][0-1]|[1-2][0-9]|[1-9]).{12}11)|(May\s{1,2}([1-4]).{12}11)
>
>This is supposed to match dates in the range from 4/12/98 - 5/4/11, but
>matches such dates as:
>Fri Mar 20 15:18:15 1998
>Fri Jun 16 16:43:12 2017
>
>and doesn't match: Tue Apr 3 07:27:55 2018
------------------------------
Date: Wed, 8 Apr 1998 19:31:41 -0400
From: "Mark Polakow" <mark@imp.net>
Subject: Help w/rename pleez...
Message-Id: <6gh2h4$s82$1@viper.america.net>
This is a petty newbee question but I can't seem to rename my files, this
isn't working:
rename ($root$file, $rename) or die print "Unable to re-name, $!";
I am using Perl for win32 and other file functions such as unlink have
worked fine. I have tried with " and with ' and I am at a loss! Thanks in
advance for any help.
------------------------------
Date: Wed, 08 Apr 1998 17:13:12 -0600
From: stvhoof@netvision.net.il
Subject: Re: How do I sort without having a space before the record?
Message-Id: <6ggspo$54d$1@nnrp1.dejanews.com>
> print FILE "@newlines\n";
> When I run this it sorts but it puts a space in front of every record
> except the first one. How do I stop that?
Change the line to this:
print FILE @newlines;
The double quotes (") in your version are causing the spaces to be stuck in
there.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 8 Apr 1998 22:56:54 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: HOW TO DETERMINE EXECUTABLE VERSION IN WIN95
Message-Id: <6ggvbm$di0$2@comdyn.comdyn.com.au>
In article <6fp1hi$2q3$1@nnrp1.dejanews.com>,
qvanegeren@frxsoft.com writes:
> I have a bunch of executables in a directory and I need a way to figure out
> the Version of each of these executables. I know there has to be a way to do
> this in PERL! I have looked in the Win32::AdminMisc package and found
I doubt a little bit if there is a generic way to do this in any
language. What do you mean by the 'version number' of the executable?
Normally a version number is chosen by the programmer in some way, and
included (or not) in the code, somewhere in some way. As far as I
know, there is no standard version number.
Maybe you should make sure, by asking on one of the windows programmer
groups, if such a thing exists at all. Maybe they can then help you
find the right terminology, system calls, whatever.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd. | inexactitude.
NSW, Australia |
------------------------------
Date: Wed, 08 Apr 1998 17:06:50 -0600
From: stvhoof@netvision.net.il
Subject: Re: Korn to Perl, Help!
Message-Id: <6ggsdq$4tg$1@nnrp1.dejanews.com>
Try:
open SQL, "|sqlplus userid/passwd >> $FILES";
print SQL <<EOF ;
select file_name FNAME
from sys.dba_data_files
order by file_name;
exit
EOF
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 08 Apr 1998 16:57:15 -0600
From: stvhoof@netvision.net.il
Subject: LWP that works with SLL
Message-Id: <6ggrrq$45t$1@nnrp1.dejanews.com>
Is there something like LWP that will work with an SLL server (https instead
of http)?
Tzadik
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 08 Apr 1998 17:09:50 -0600
From: stvhoof@netvision.net.il
Subject: MVS
Message-Id: <6ggsjd$4ul$1@nnrp1.dejanews.com>
Anybody know about a version of Perl that runs on MVS (not VMS!)?
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 08 Apr 1998 19:52:17 -0400
From: Jeff Trawick <trawick@ibm.net>
Subject: Re: MVS
Message-Id: <m3k98zub0u.fsf@k5.localdomain>
I have used 5.003 on OS/390 V2R4 (a.k.a. MVS).
I downloaded it from the MKS (Mortice Kern
Systems) web site. No, I don't know the URL :(
That is what all those web searchers are for :)
I haven't used it much on MVS, but what I used worked
fine.
A recent Perl Journal issue had an article about Perl
on MVS.
--
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...
------------------------------
Date: Wed, 8 Apr 1998 16:26:57 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Mikhail Galbmillion <galbmill@21st-century-comm.com>
Subject: Re: Password Problem
Message-Id: <Pine.GSO.3.96.980408162128.20192Z-100000@user2.teleport.com>
On Wed, 8 Apr 1998, Mikhail Galbmillion wrote:
> Newsgroups: comp.lang.perl.misc
> I created .htaccess file for authorized access of Web pages
> and my problem is : Is that possible to fetch user password
> from Apache HTTP server?
Why ask us? We know only about Perl, if even that much! :-)
If this is possible (or not) it depends upon the abilities and interfaces
of the Apache web server. If you can't find the answer in the server's
docs, you could ask in the newsgroup about it.
In case it's not obvious: I'm not trying to flame you. I'm merely pointing
out that another newsgroup (that is, one about the server) will be able to
give you a better and more-complete answer than we could give here (in a
newsgroup about Perl). Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 08 Apr 1998 19:26:38 -0400
From: mshavel@erols.com (Michael Shavel)
Subject: PID, fork(), exec() question again...
Message-Id: <mshavel-0804981926380001@130.9.16.207>
Hi
In the last post, I asked for an example to fork a process manually.
Thank you very much to all who answered. The example worked well up
until the point of getting the PID number back. In my script I have perl
call an sqr statment IN THE BACKGROUND. When I check the PID number
returned in $pid, I get a number that is one (1) off from the actual
process that is running. Example: When I run the script it tells me the
fork() has produced a pid number of 1234 but when I do a ps -ef I see that
the process I called has a PID number of 1235. (If I try and kill 1234 it
tells me it does not exist)
I see that perl has a getppid() function. In this case getppid() would
give me back 1232. Is there any function that will give me back the PID
number of a child's child. Because it seems that when I call a process in
the background, a process id number is first given to the background shell
and THEN to my process, hence the difference of one.
I hope I made my self clear and also hope someone has an answer for me.
Here is the code I am using now...
#!/usr/bin/perl
$pid =0;
print "Starting\n";
$c="sqr trsdmp.sqt report/report -RT -F/export/transfer/trsdmp.lis 03/03/1998";
if ($pid = fork){
print "PID num is $pid\n";
waitpid($pid,0);
}
else {
# I need to get the PID number of $c
#What I am getting is the PID of the background shell
exec("$c . &") or die "Exec Failed:$!";
}
Thanks very much
Mike shavel
mshavel@erols.com
------------------------------
Date: Wed, 8 Apr 1998 16:29:56 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Bert Tijhuis <B.Tijhuis@inter.nl.net>
Subject: Re: Problems with "use integer" in combination of CGI.pm
Message-Id: <Pine.GSO.3.96.980408162829.20192b-100000@user2.teleport.com>
On Wed, 8 Apr 1998, Bert Tijhuis wrote:
> When inserting after the line
>
> use CGI; # the line
> use integer;
>
> some strange things happens to my CGI script.
Well, some strange things are supposed to happen. :-) But if you think
you've found a bug, boil it down to a short test case and post it here.
Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 8 Apr 1998 18:37:29 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: Read file and interpolate contents as string?
Message-Id: <6ggtf6$6ut@fridge.shore.net>
Bill_York wrote in message <6ggpsv$i00$1@turing.mathworks.com>...
>Is it possible to pass a string to the interpolator?
Use the eval function
Or better yet, try one of the plethora of template modules. I use
Text::Template
-grinch
--
"Of course coffee doesn't make the world go around. It
just makes it go faster." - me
Sherm Pendley
grinch@whoville.com
http://www.whoville.com
------------------------------
Date: 8 Apr 1998 23:03:20 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: Read file and interpolate contents as string?
Message-Id: <slrn6io0i8.48k.maurice@localhost.localdomain>
On 8 Apr 1998 21:23:43 GMT, Bill_York <Bill_York@MathWorks.com> wrote:
>Is it possible to pass a string to the interpolator?
>
>Here's and example (sudo code):
>
>Foo contains this:
>
>Hello world. It is now $time o'clock.
>
>Perl file contains this:
>
>open (F, "foo") or die();
>$/ = undef;
>$foo = <F>;
>close(F);
>
>$time = convertTimeToWallClock(time); # assume this works
>
>print($foo); # returns foo as it appears on disk
>$bar = INTERPOLATE($foo);
>print($bar); # returns foo with the current time replaced for $time.
Using your 'foo' file, you can do this:
#!/usr/bin/perl
use YAWP;
$time = scalar localtime;
$yawp = new YAWP( package => 'main' );
$yawp->suppress_header(1);
$yawp->write('foo', \$bar)
or die $yawp->errmsg;
print $bar;
Which displays:
Hello world. It is now Wed Apr 8 15:59:13 1998 o'clock.
YAWP can be found at:
http://olympia2.adhost.com/~maurice/
--
Maurice Aubrey <maurice@hevanet.com>
------------------------------
Date: Wed, 08 Apr 1998 16:45:27 -0600
From: atai@ece.ucsd.edu
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <6ggr5o$33e$1@nnrp1.dejanews.com>
In article <6ggin4$oud$1@mathserv.mps.ohio-state.edu>,
ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
>
> [A complimentary Cc of this posting was sent to Joe Buck
> <jbuck@synopsys.com>],
> > You clearly don't get it. The notion of having a free software summit
> > and not inviting RMS is nonsense. Hence the previous poster's comment
> > that O'Reilly might be confused as to what free software means.
>
> You clearly never had any relation to GPLed software.
You don't know who Joe Buck is. He is an active contributor to gcc.
> GPL is as far
> from "free" as you can get - preserving an impression of being free.
>
Just opinion without supporting argument.
>
> Ilya
----
Free software: the software by the people, of the people and for the people,
worldwide. Develop! Share! Enhance! And enjoy!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 8 Apr 1998 22:59:55 GMT
From: Michael Stutz <stutz@dsl.org>
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <6ggvhb$9eb$2@tracy.nacs.net>
In gnu.misc.discuss Andy Tai <atai@zizkov.ucsd.edu> wrote:
> Mr. Tim O'Reilly said that RMS was not invited. I consider this is
> unfair to GNU.
Did he say this publicly or otherwise?
And did he give a reason?
--
Michael Stutz . http://dsl.org/m/ . copyright disclaimer etc
stutz@dsl.org : finger for pgp : http://dsl.org/copyleft/
------------------------------
Date: Wed, 8 Apr 1998 18:45:48 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: scanf substitute in perl
Message-Id: <6ggtup$7lm@fridge.shore.net>
Andrew M. Langmead wrote in message ...
>($string1, $string2, $num) = ( $line =~ /(\S+)\s+(\S+)\s+([-+]?\d+)/ );
>
>Is close, except that in scanf() if a line partially, but not
>completely matches the format string, the arguements that do match are
>stored. With regular expressions, it is all or nothing (unless you
>specify it as being optional with the "?" or "*" quantifiers.)
You could use three regex's to simulate scanf's behaviour, if it's
important:
($string1, $remainder1) = ( $line =~ /(\S+)\s+(.*)/ );
($string2, $remainder2) = ( $remainder1 =~ /(\S+)\s+(.*)/ );
$num = ( $remainder2 =~ /[-+]?\d+/ )
-grinch
--
"Of course coffee doesn't make the world go around. It
just makes it go faster." - me
Sherm Pendley
grinch@whoville.com
http://www.whoville.com
------------------------------
Date: Wed, 08 Apr 1998 17:07:29 -0500
From: Jeremy Hough <jeremyhough@hotmail.com>
Subject: search operator question
Message-Id: <352BF521.4EC69A7D@hotmail.com>
I've read the information in Perlop about the /egimosx options for the
search operator, however I do not understand them completely. Would
someone please refer me to a document which explains these?
Jeremy
------------------------------
Date: 08 Apr 1998 19:04:29 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: search operator question
Message-Id: <pvireu7m.fsf@mailhost.panix.com>
Jeremy Hough <jeremyhough@hotmail.com> writes:
> I've read the information in Perlop about the /egimosx options for the
> search operator, however I do not understand them completely. Would
> someone please refer me to a document which explains these?
Do you know about the perldoc called simply "perl"? It's an index to
the entire documentation set.
You should try "perlre" and "perlfaq6." An often-recommended book is
_Mastering Regular Expressions_, which goes into *great* detail about
Perl's flavor of regexes.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Wed, 08 Apr 1998 22:13:38 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: serpinski gasket almost-1-liner needs polishing
Message-Id: <352df5a9.33124510@10.0.2.33>
On Wed, 08 Apr 1998 21:39:38 GMT, ron@farmworks.com (Ronald L. Parker)
wrote:
>On 8 Apr 1998 14:29:43 GMT, root@compstat.wharton.upenn.edu (Jack
>Siler) wrote:
>
>>Inspired by J. Reed's article in TPJ on L-Systems I used substitution
>>to produce a Serpinski gasket fractal. I was unhappy about putting the
>>substitutions inside functions but since substitutions return
>>number-of-subs instead of the string I couldn't figure out how to put
>>the subs in the print line (like I did for the appending) nor how to
>>make the functions less clunky. Comments appreciated.
>
>How's this? (split onto multiple lines for the sake of your
>newsreader) Note the "improvements" to your sub C, and the
>elimination of the evil $&.
This one's even better, because there are no spaces and it prints the
missing dot at the top. Not broken up for your newsreader, because it
would ruin the aesthetics.
$s=$x='*';$~="\40";$r=32;print$~x$r.$s.$/;while(--$r){print$~x$r,(join$~,split//,$s=&{sub{$_[0]=~s/((.)\2)|../$1?$~:$x/ge,$_[0]}}($~.&{sub{$_[0]=~s/(.)/$1x2/ge,$_[0]}}($s).$~)),$/}
------------------------------
Date: 8 Apr 1998 17:11:54 -0500
From: Tushar Samant <scribble@pobox.com>
Subject: Re: serpinski gasket almost-1-liner needs polishing
Message-Id: <6ggsna$6rv@tekka.wwa.com>
Here's another approach, with substitutions only. You could of
course make a subroutine out of them:
$x = "*"; $y = " "; $reps = 16;
$_ = $x; $p = " " x $reps;
while (chop $p) {
s/(.) /$1$1/g; s/^|$/$y/g; s/(.)(.)/$1 eq $2?"$y ":"$x "/eg;
print "$p$_\n";
}
------------------------------
Date: 8 Apr 1998 23:13:33 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Simple Unix Question, ( Simple for you maybe )
Message-Id: <6gh0at$di0$3@comdyn.comdyn.com.au>
In article <rtanner-0804980819030001@wildflower.linfield.edu>,
rtanner@linfield.edu (Rob Tanner) writes:
> `ls -l` is back-ticked. That means perl should execute the command "ls
> -l", the output of which is multiple lines and so is a list.
Read the following (again, hopefully):
# perldoc perlop
[SNIP]
qx/STRING/
`STRING`
A string which is interpolated and then executed as
a system command. The collected standard output of
the command is returned. In scalar context, it
comes back as a single (potentially multi-line)
string. In list context, returns a list of lines
(however you've defined lines with $/ or
$INPUT_RECORD_SEPARATOR).
So ONLY in a list context, is the output returned as a list. In scalar
context, the output comes back as a scalar.
> The sequence $my_variable = `ls -l` will yield the count of returned lines
> in the variable $my_variable.
It is not that bad that you misinterpret part of the documentation
(where you presumed that multiple lines were always returned as a
list), but making up stuff like this is really bad. If you don't know,
please look it up in the documentation. Try to avoid making things up.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd. | excuse - Lazarus Long
NSW, Australia |
------------------------------
Date: Wed, 8 Apr 1998 21:36:27 GMT
From: James A Squire 312 M 193884 <james.a.squire@boeing.com>
Subject: Re: Strange "Modification of a read-only value attempted" error
Message-Id: <352BEDDB.791A@boeing.com>
Christian Wetzel wrote:
>
> James A Squire 312 M 193884 wrote:
> >
> > I'm using Perl 5.003 and have the following code snippet:
> > [code example]
> > When I run this using:
> >
> > myscript.pl -name ALICE BESS |& tee -a output.log (using tcsh)
> > I get the error message in the subject header, referencing the
> > line with the arrow above (the arrow's not part of the script,
> > of course).
> >
> > Where am I trying to modify a read-only value???
>
> If I remove the abbrev() and arglist (changing $arg to $argx)
> and run the script with
>
> myscript.pl -name ALICE BESS |& tee -a output.log
>
> it works fine under perl 5.004_04 and ksh (also without the tee
> part) and @names contains ALICE and BESS, as intended.
As a matter of fact, even without removing the abbrev() and arglist, my
reduced script works.
Rats... Sorry about that. I'll try again, and this time I'll make sure
to test my code snippet before I post it.
In the meantime, what kinds of obscure things could cause a value to be
considered by Perl to be read-only?
--
James Squire Send my Spam to mailto:webmaster@cyberpromo.com
MDA^H^H^HBoeing St. Louis http://www.boeing.com
------------------------------------------------------------------------
Hey Novell, is it too much to ask that when I log out of NetWare, it
should ACTUALLY record that I've logged out, so that it doesn't have to
scramble around the house laboriously when I try to log back in, forcing
me to ring the door bell 20 times??????
Opinions expressed here are my own and NOT my company's
------------------------------------------------------------------------
"We were talking the other day about how nobody's seen a Vorlon before
and he said that according to legend, one human did see a Vorlon...he
turned to stone."
-- Laurel Takeshima, "The Gathering"
------------------------------
Date: 8 Apr 1998 22:53:35 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Trouble running html2ps perl script on NT4.0
Message-Id: <6ggv5f$di0$1@comdyn.comdyn.com.au>
In article <35200B06.2715AA81@innosoft.de>,
Georg Lenz <lenz@innosoft.de> writes:
> Hei everybody out there,
>
> I want to run a perl script to convert html to ps.(From Jan Kdrrman)
> I installed perl (5.004_04) on NT4.0. The sample for the script is not
> running and stops with the message can't find "POSIX.pm".
> It seems so that this is not standard extension to perl.
It is a standard extension to perl, in the sense that it comes with
the standard distribution.
> So, how do I create that extension?????
POSIX.pm is a perl wrapper around the standard POSIX 1003.1
identifiers. Not all operating systems are posix compliant, so it will
not be available on all platforms.
NT is not POSIX compliant, so it is very likely that that module is
not available for NT. Having said that: There was something on this
newsgroup a little while ago about someone having ported some of the
POSIX stuff for NT. A dejanews search should help you out there.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd. | inexactitude.
NSW, Australia |
------------------------------
Date: 8 Apr 1998 21:16:00 GMT
From: "Lee Falkenhagen" <falkenl@hotmail.com>
Subject: Re: Trying to Match two lists
Message-Id: <01bd6333$abffec80$915c5093@lfalkenhagen.dhs.state.tx.us>
Thanks...that worked great. I was able to take my list A that I read from
a file and match it to my directory listing.
It really helps to have people out there that are willing to help others...
Tad McClellan <tadmc@flash.net> wrote in article
<8vaeg6.5u7.ln@localhost>...
> Lee Falkenhagen (falkenl@hotmail.com) wrote:
....
------------------------------
Date: Wed, 08 Apr 1998 15:47:41 -0700
From: Nathaniel Meyers <Nathaniel.Meyers@ucop.edu>
Subject: UNIX, system(), and text that isn't output.
Message-Id: <352BFE8D.2FF545A@ucop.edu>
This is a stupid UNIX question and I'm angry at myself for not knowing
the answer but sheesh...
Sometimes UNIX commands write to the screen and this is not regular
output (usually error or status messages). For instance 'ls gooby' will
result in 'gooby: No such file or directory'. This isn't "output" and
so far as I know it can not be captured or forced off. So what is this
sort of text refered as and how do you force it to not occur?
This doesn't just occur when there is an error. Using PGP to encrypt a
file ('pgpe -r meyers@wahoo.sjsu.edu file1 -o file.pgp') writes a
"Creating ouput file" line to the screen.
Here's my problem. I want to write a cgi script that in its execution
does a system command but the system command (the pgp example) writes
the @#&% "Creating output file" line which causes the web server out and
give a server error message every single time.
Is there anyway to tell perl (or UNIX) to ignore these comments?
Nathaniel Meyers
Nathaniel.Meyers@ucop.edu
------------------------------
Date: 8 Apr 1998 23:06:36 GMT
From: zisk@well.com (Brian Zisk)
Subject: Why can't I WRITE/CREATE files from perl5 CGI script
Message-Id: <zisk-0804981622020001@ws10.transaction.net>
Keywords: FILE CGI CREATE WRITE PERMISSION
I am trying to create a file (open a file to write to) from within my CGI
script, but all I get is a 'permission denied' error (in $!). I can append
to a file that already exists, but I cannot create one.
I've tried various levels of file creation: new FileHandle, open, sysopen
- all with no success.
I've tried altering the RWX privlidges on parent directories with
entertaining results, but none that allow me to create a file.
I'm researching the problem and so far have found no solutions... Perhaps
(and this is a shot in the dark) it has something to do with 'setuid' or
'wrapsuid'???
My guess - it's something really basic -
Thanx-
cicatrix@hotmail.com
------------------------------
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 2278
**************************************