[7990] in Perl-Users-Digest
Perl-Users Digest, Issue: 1615 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 10 19:07:43 1998
Date: Sat, 10 Jan 98 16:00:23 -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 Sat, 10 Jan 1998 Volume: 8 Number: 1615
Today's topics:
52 character string to be broken...any suggestions? cj5xvv@hotmail.com
Re: 52 character string to be broken...any suggestions? <joegottman@nospam.worldnet.att.net>
A newbie's substitution question (Eric Albert)
Re: Avoiding regular expressions (was: Re: Newbie quest (John C. Randolph)
Clever way to trash a bunch of global variables? <dean@tbone.biol.sc.edu>
Re: dbmopen from two different linux distributions (J.H.M. Dassen)
Re: Easy way to turn on dynamic linking? <rootbeer@teleport.com>
File Listing <andrew.spiers@virgin.net>
help Exec format error (8) <trajen@worldnet.att.net>
Re: How can i create a file in perl? <toyland@sauerland.de>
How to modify master variables from a forked thread? (Ansel Sermersheim)
Re: LWP problem in a loop <Gilles.Maire@ungi.com>
Re: LWP problem in a loop <rootbeer@teleport.com>
Newbie Perl-Java problem... <amosrf@idt.net>
Re: Newbie question (John C. Randolph)
Perl Email Ques!! Thanks for Help! 8-) <mhanson@arrowweb.com>
Re: Perl Question <rootbeer@teleport.com>
perl: warning: Setting locale failed <kalisz@usa.net>
Q: Is "Camel Critiques" on the web still updated? (Joseph R. Justice)
Re: regex to escape {, } except in TeX commands (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Re: serious post about gmtime and year-1900 (was Re: Pe (John Moreno)
Re: serious post about gmtime and year-1900 <rootbeer@teleport.com>
SOLUTION: I/O redirection not working on Perl on Win32 <swarren@eclipse.net>
Re: sorting problem <rootbeer@teleport.com>
Taint, open, and a pipe... jhelt@preferred.com
Re: UNIX commands via FTP on a MACINTOSH -- HAY-ELP! (John Moreno)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 10 Jan 1998 11:56:00 -0800
From: cj5xvv@hotmail.com
Subject: 52 character string to be broken...any suggestions?
Message-Id: <34B7D250.7D0A1E6@hotmail.com>
Please reply directly to my hotmail address - cj5xvv@hotmail.com
This is not an internet question - and I am throwing it out to the
newsgroup as a last resort. I have a 52 character string which has to
be broken and sorted. It represents 52 weeks. Typically it looks like
this:
1000100010001000100010001000100010001000100010001000
You can probably guess that this is playing out of a system scheduling
weekly events.
I want to transfer this to :
1
0
0
0
1
0
0
etc...
In other word I use the newline as a text delimiter and run it back
(from a text file) into a database producing a 52 week year with 52
cells.
I have about 5000 strings to process so I am looking at ways of doing it
in various languages - but what little I learned (and can remember) of
perl, it seems to be the tool to use.
Any suggestions are gratefully received! Can you please answer to my
hotmail address - cj5xvv@hotmail.com
Thanks
Rob
------------------------------
Date: Sat, 10 Jan 1998 18:06:52 -0500
From: Joe Gottman <joegottman@nospam.worldnet.att.net>
Subject: Re: 52 character string to be broken...any suggestions?
Message-Id: <698v72$hb2@mtinsc05.worldnet.att.net>
cj5xvv@hotmail.com wrote:
>
> Please reply directly to my hotmail address - cj5xvv@hotmail.com
>
> This is not an internet question - and I am throwing it out to the
> newsgroup as a last resort. I have a 52 character string which has to
> be broken and sorted. It represents 52 weeks. Typically it looks like
> this:
> 1000100010001000100010001000100010001000100010001000
>
> You can probably guess that this is playing out of a system scheduling
> weekly events.
>
> I want to transfer this to :
>
> 1
> 0
> 0
> 0
> 1
> 0
> 0
> etc...
>
> In other word I use the newline as a text delimiter and run it back
> (from a text file) into a database producing a 52 week year with 52
> cells.
>
> I have about 5000 strings to process so I am looking at ways of doing it
> in various languages - but what little I learned (and can remember) of
> perl, it seems to be the tool to use.
>
> Any suggestions are gratefully received! Can you please answer to my
> hotmail address - cj5xvv@hotmail.com
Try $string = join "\n", (split //, $string);
The last character of your string won't have a newline after it. If you
need one, follow
the above by $string .= "\n";
--
Joe Gottman
joegottman@nospam.worldnet.att.net
[Remove nospam to reply]
------------------------------
Date: Sat, 10 Jan 1998 14:56:08 -0800
From: ejalbert@leland.stanford.edu (Eric Albert)
Subject: A newbie's substitution question
Message-Id: <ejalbert-1001981456080001@ejalbert.stanford.edu>
I'm new to both Perl and regular expressions (yeah, I know that's not a
great combination, but you've got to learn them sometime), and I've found
a way to do something rather inefficiently that I'd like to think can be
improved on:
I'm trying to convert text that either is surrounded by underscores (_) or
starts with two capital letters to bolded text in HTML. In other words,
TEXT would become <b>TEXT</b>, and _Text_ would become <b>Text</b>. Also,
if the text fits both qualifications, _TEXT_ would become <b>TEXT</b>.
I think that it works with the following two lines:
$count=($line=~s[_(.+?)_][<b>$1</b>]g);
$line=~s{([A-Z][A-Z]+?)}{<b>$1</b>}g if !$count;
I'd think that it could be done in one line, as the replacement expression
is the same for both matches. Thing is, if I write
$line=~s[([A-Z][A-Z]+?)|_(.+?)_][<b>$1</b>]g; then $1 only seems to match
whatever matches the first set of parens and therefore comes up blank in
the case of _Text_. Any ideas?
Thanks in advance,
Eric
------------------------------------------------
Eric Albert ejalbert@leland.stanford.edu
http://www-leland.stanford.edu/~ejalbert/
------------------------------
Date: 10 Jan 1998 20:49:25 GMT
From: jcr.remove@this.phrase.idiom.com (John C. Randolph)
Subject: Re: Avoiding regular expressions (was: Re: Newbie question)
Message-Id: <698msl$7eh$4@news.idiom.com>
In <1d26p7u.1ycbo7y1j67ibkN@roxboro-180.interpath.net> John Moreno wrote:
-> > Perl isn't the right language for everyone; maybe you should consider
-> > learning another language that better suits the way you think.
->
-> I wouldn't put it this way - instead I'd say that perl isn't the right
-> language for every task, would you want to write Illustrator in it?
No, there are definitely people who shouldn't be using Perl *or* Python, *or*
anything other than the first language they learned (Visual Basic: it causes
severe brain damage, just like all previous versions of Basic did.)
As for Illustrator: Perl is not the right language to write it in. It's
definitely a job for Postscript!
-jcr
--
John C. Randolph (408) 358-6732 NeXT mail preferred.
Chief Technology Officer, WARPnet Incorporated.
@"Hey, %s! You're a NAZI, and you can't spell!"
------------------------------
Date: 10 Jan 1998 17:18:06 -0500
From: Dean Pentcheff <dean@tbone.biol.sc.edu>
Subject: Clever way to trash a bunch of global variables?
Message-Id: <87en2gezxd.fsf@zoea.biol.sc.edu>
I'm looking for a quick'n'dirty solution to a small problem. I've got
a Perl program that runs fine as a CGI script (NO, this is NOT a CGI
problem, please read on...). I'd now like to run it under mod_perl
(which, if you aren't aware of it, compiles the program once using a
perl interpreter in the WWW server itself, then reinvokes the program
for each incoming request).
The program fails under mod_perl, since it has global variables
scattered about in it which implicitly depend on being reinitialized
for each run of the program. Sigh. In my defense, it's not my
script, but something I'm trying to port.
Of course, hunting down all the variables and encapsulating them
appropriately is The Right Thing to do, but I'd prefer to be lazy.
So... is there some sort of clever way I could trivially rewrite this
program to trash it's global variables each time it's run?
I've briefly explored putting the whole thing into a subroutine within
a package, thinking that if I did a $obj = packagename->new() on
each invocation of the program, the global variables (now within the
package namespace) would be refreshed each time. Of course, that
doesn't work - global variables within a package persist for the life
of the program.
Any better ideas? Thanks!
-Dean
--
N. Dean Pentcheff <help@biol.sc.edu>
Biological Sciences, Univ. of South Carolina, Columbia SC 29208 (803-777-3936)
------------------------------
Date: 10 Jan 1998 18:45:10 GMT
From: jdassen@wi.LeidenUniv.nl (J.H.M. Dassen)
Subject: Re: dbmopen from two different linux distributions
Message-Id: <698fjm$82m$1@noc.wi.leidenuniv.nl>
beryte@leb.net <beryte@leb.net> wrote:
>I was using dbmopen (perl) under RedHat 4.2. The extension of the files
>were *.db I then upgraded to RedHat 5.0 and now I cannot open and use
>my *.db files Perl creates instead two files with *.dir and *.pag
>extensions.
>
>I had to go back to RH 4.2 because of this.
>
>Do you know why is that? because of perl?
Not directly. The .db files are "db" files from GNU DBM; the ".dir" and
".pag" are "db" files from (BSD) libdb. As GNU DBM is no longer
maintained, GNU libc2 (libc6) (which RH 5 uses) incorporates BSD libdb.
>because of the filesystem and C libraries? Will I have to stay in RH
>4.2 or is there a solution?
I'm not up to date on this issue; it may be that instructing perl to
"Use GDBM_File" or somesuch is sufficient; it could also be that you
have to recompile perl.
HTH,
Ray
--
J.H.M. Dassen | RUMOUR Believe all you hear. Your world may
jdassen@wi.LeidenUniv.nl | not be a better one than the one the blocks
| live in but it'll be a sight more vivid.
| - The Hipcrime Vocab by Chad C. Mulligan
------------------------------
Date: Sat, 10 Jan 1998 15:20:57 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: HMahaffey <hmahaffey@aol.com>
Subject: Re: Easy way to turn on dynamic linking?
Message-Id: <Pine.GSO.3.96.980110151930.26607G-100000@user2.teleport.com>
On 9 Jan 1998, HMahaffey wrote:
> I downloaded/built/installed the Term::Readkey library, but when I use
> it, Perl complains that Perl wasn't built to handle dynamic loading (why
> isn't this the default?)
I believe it is the default, on systems which can do dynamic linking.
> Does anyone know of a document somewhere that describes this entire
> "Building and Configuring Perl" process?
It's called INSTALL, and you'll find it in the Perl kit.
http://www.perl.com/CPAN/src/latest.tar.gz
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 10 Jan 1998 22:35:40 +0000
From: Andrew Spiers <andrew.spiers@virgin.net>
Subject: File Listing
Message-Id: <34B7F7BB.14FA2F32@virgin.net>
This question may be PERL related ?!?
How is has this page http://www.perl.com/CPAN-local// been customized ?
Is is using PERL or is it done on the server ?
Many thanks,
Andrew Spiers
------------------------------
Date: Sat, 10 Jan 1998 16:43:14 -0500
From: "Trajen" <trajen@worldnet.att.net>
Subject: help Exec format error (8)
Message-Id: <698q6s$51i@bgtnsc01.worldnet.att.net>
I'm attempting to run a perl script but get this error:
CGIwrap Error: System Error: execv() failed
Error: Exec format error (8)
Any clues?
------------------------------
Date: 10 Jan 1998 12:07:41 +0100
From: Sebastian Kaps <toyland@sauerland.de>
Subject: Re: How can i create a file in perl?
Message-Id: <697kpt$1pi$1@toyland.sauerland.de>
In article <697ghg$5rt$1@news2.isdnet.net>
Anthony DIMINO wrote:
AD> I would want to write into files,but in perl you can't write into a not
AD> existing file?
???
"open(FILE, ">" . $filename)" creates a new file at least on my System
(Linux 2.0.33).
--
Ciao, Sebastian
* Email: toyland@sauerland.de
* HP: www.sauerland.de/~toyland/ PGP-Key available
------------------------------
Date: Sat, 10 Jan 1998 23:30:22 GMT
From: AGSerm@netwizards.net (Ansel Sermersheim)
Subject: How to modify master variables from a forked thread?
Message-Id: <34b80175.9039702@news.netwizards.net>
I'm having difficulty getting my first real perl project to work the
way I'd like it to. It's going to be a web-based interface to a perl
server running on a unix-domain socket. The client will connect to a
CGI shim between the web and the server.
The problem I'm having is this: Most of the time, the request will be
for a chunk of data built on the fly from two fairly static hashes.
However, occasionally a client will upload a piece of information that
needs to be integrated into the data. At this point, I'd like to have
the server block for a moment until it recalculates the data, and then
continue.
I've managed to get it to block properly using semaphores but I can't
get the forked server proccess to modify the master hashes. I found
this in 'Programmming Perl':
"When a thread shuts down, all its objects must be properly
destructed, and all its memory has to be reclaimed. This is essential
to support perl as an embedded or a multithreadable language".
How do I get around this? I've got blocking properly in place so
there's no data sharing problem. Do I have to use references? How
would I do that?
Thanks very much to any who can help,
-Ansel Sermersheim
------------------------------
Date: Sat, 10 Jan 1998 19:26:11 +0100
From: Gilles Maire <Gilles.Maire@ungi.com>
To: Honza Pazdziora <adelton@fi.muni.cz>
Subject: Re: LWP problem in a loop
Message-Id: <34B7BD43.422AD339@ungi.com>
Honza Pazdziora wrote:
>
> Gilles.Maire@ungi.com (Gilles Maire) writes:
>
> > Hello,
> >
> > I use LWP and lauch requests on 200 Web pages. After 10 requests
> > qorking fine I have the message : Can-t resolve address xxxx ...
> >
> > Any idea ?
>
> What can't you understand? You gave it bad URL, containing host that
> couldn't be resolved and that's what the LWP tells you. The problem is
> not with the script (or maybe is, some other strange things like
> programming without use strict :-(, the problem is with the data that
> contain wrong URL.
>
Sorry no !
After 10 resolutions and good thinks, I have a list of instantaneous
messages without any network access like this :
Recherche URL : http://territorial.afuu.fr
<HTML>
<HEAD><TITLE>An Error Occurred</TITLE></HEAD>
<BODY>
<H1>An Error Occurred</h1>
500 Can't resolv address for territorial.afuu.fr
</BODY>
</HTML>
Recherche URL : http://www.chez.com/fdebane
<HTML>
<HEAD><TITLE>An Error Occurred</TITLE></HEAD>
<BODY>
<H1>An Error Occurred</h1>
500 Can't resolv address for www.chez.com
</BODY>
</HTML>
Recherche URL : http://www.sasi.fr
<HTML>
<HEAD><TITLE>An Error Occurred</TITLE></HEAD>
<BODY>
<H1>An Error Occurred</h1>
500 Can't resolv address for www.sasi.fr
</BODY>
</HTML>
Recherche URL : http://www.chez.com/dschombert
<HTML>
<HEAD><TITLE>An Error Occurred</TITLE></HEAD>
<BODY>
<H1>An Error Occurred</h1>
500 Can't resolv address for www.chez.com
</BODY>
... strange like a pointer problem in LWP or a wrong thing in my
program.
------------------------------
Date: Sat, 10 Jan 1998 15:43:06 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Gilles Maire <Gilles.Maire@ungi.com>
Subject: Re: LWP problem in a loop
Message-Id: <Pine.GSO.3.96.980110154230.26607M-100000@user2.teleport.com>
On Sat, 10 Jan 1998, Gilles Maire wrote:
> open ( F1, "<sniffer.in" ) ;
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 10 Jan 1998 17:30:52 -0500
From: "zz" <amosrf@idt.net>
Subject: Newbie Perl-Java problem...
Message-Id: <69908u$e7q@nnrp1.farm.idt.net>
I'm trying to run a simple perl script to run a java program as follows:
#!/bin/sh
java testProgram
when I run it I get
can't find java in /usr/bin/../bin/green_threads/java
if I just type "java testProgram" at the command line it works fine. Is
there some way to have a perl script exactly emulate keyboard input?
------------------------------
Date: 10 Jan 1998 20:45:51 GMT
From: jcr.remove@this.phrase.idiom.com (John C. Randolph)
Subject: Re: Newbie question
Message-Id: <698mlv$7eh$3@news.idiom.com>
In <01bd15ef$35d720a0$13e288a8@PC83610221.kpt.emn.com> "Blaine Owens" wrote:
-> I have a perl script which reads a file and parses out particular fields
to
-> produce a report. One of the fields is like "(45.0%)" but I would like for
-> it to be just "45.0" in the report. What is the best way to strip the
-> leading "(" and the trailing "%)"? Thanks.
-> --
-> Blaine Owens
-> bowens@eastman.com
->
As usual, you got a bunch of replies telling you to do it with a regex.
This is a job for tr///!
Try:
$field "(45.0%)" ;
$field =~ tr/\(\)%//d;
print $field;
This call to tr deletes all instances of the "(", ")" and "%" characters.
You could also do it by something like:
tr/[0-9]\.//cd;
which will kill all the characters that aren't digits or periods.
tr/// should be quicker than a regex in this situation.
-jcr
--
John C. Randolph (408) 358-6732 NeXT mail preferred.
Chief Technology Officer, WARPnet Incorporated.
@"Hey, %s! You're a NAZI, and you can't spell!"
------------------------------
Date: Sat, 10 Jan 1998 16:12:51 -0800
From: Mike <mhanson@arrowweb.com>
Subject: Perl Email Ques!! Thanks for Help! 8-)
Message-Id: <34B80E83.B9F@arrowweb.com>
Is there a way to make a perl program that will allow you to setup email
accounts for the members of your site, but yet not have to setup
additional pop accounts? Like to make a program so users can get a free
email account, but without setting up pop accounts.
------------------------------
Date: Sat, 10 Jan 1998 15:22:55 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Mick Farmer <mick@picus.dcs.bbk.ac.uk>
Subject: Re: Perl Question
Message-Id: <Pine.GSO.3.96.980110152224.26607I-100000@user2.teleport.com>
On Fri, 9 Jan 1998, Mick Farmer wrote:
> How about something like this.
>
> while () { # loop forever
> sleep 60; # sleep for 1 minute
> next unless -r $file; # file not arrived
> ... # process file
> }
Note that you may start processing a file which is hasn't finished
arriving... :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 10 Jan 1998 19:57:50 +0100
From: Michael Kalisz <kalisz@usa.net>
Subject: perl: warning: Setting locale failed
Message-Id: <34B7C4AE.2C75277C@usa.net>
Hello
This must be one of those FAQ that I just don't seem to find an
answer to...
After upggrading perl to the newest version on my Linux(2.0.32 Redhat
4.2)
I allways get the following warning when running perl:
------------------------------------------------------
~>perl -v
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LC_CTYPE = "iso-8859-1",
LANG = "C"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
This is perl, version 5.004_04 built for i586-linux
-------------------------------------------------------
from "perldoc perllocale" I got the following information:
"By default, Perl ignores the current locale. The use
locale pragma tells Perl to use the current locale for
some operations."
Well it does not ignore my locale??? (I didn't even used the "use
locale"?)
Is it me doing something wrong or is it something that I've missed??
(unsetting the LC_CTYPE works as a temporary solution but then bash and
a few other
programs can't handle the swedish characters)
Any clues??
Thanks in advance
Michael
------------------------------
Date: 10 Jan 1998 13:59:25 -0500
From: jrj@access.this-is.a-false.address (Joseph R. Justice)
Subject: Q: Is "Camel Critiques" on the web still updated?
Message-Id: <698ged$f67@access2.digex.net>
[P, M to Tom Christiansen @ mox.perl.com. Feel free to post a
response; an e-mail CC is appreciated. -- J]
[Boilerplate warning: This post contains a deliberately corrupted
From: address, in an attempt to foil spammers. If you are trying to
send me e-mail, edit the address you are using for me before you send
it. My correct e-mail address has (at the end) "access.digex.net",
begins with "jrj", and has an at-sign in the middle. Thanks. -- J]
I was browsing comp.lang.perl.misc, and I noticed a message thread
titled something like "Camel Critiques: <book title>". What there was
of the thread made the book sound interesting, and piqued my interest
in revisiting the Perl book critiques by Tom Christiansen available on
the web. (URL is:< http://language.perl.com/critiques/index.html>).
However, when I looked at this page, and other pages (e.g. What's New)
on this site, it didn't look as if anything had been changed on them
for quite a while. Therefore, are these pages still being actively
maintained, but maybe it's been a while since anything's added and I
just am looking at them when the maintainer's been busy with other
stuff, or are they no longer being actively maintained and I should
look elsewhere for the newest and most current and interesting stuff?
Thanks for any info you can provide.
Joseph
--
Joseph R. Justice == jrj, at access.digex.net ==
an69616, at anon.penet.fi == anon-16439, at anon.twwells.com
(EFNet) IRC: jrj, jrjx, jrjxx http://www.access.digex.net/~jrj
I have a job! Now if I can keep it... Next up, the *Personal Ad*!
------------------------------
Date: Sat, 10 Jan 98 14:19:33 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: regex to escape {, } except in TeX commands
Message-Id: <34b7ca31$4$ofn$mr2ice@speaker>
In <34b5de19.20652623@news.tornado.be>, on 01/08/98 at 02:10 PM,
bart.mediamind@tornado.be (Bart Lateur) said:
+-----
| >> I need a regex to escape braces, {}, translating them to \{, \},
| >> except when they are part of a TeX command like \texttt{stuff}.
| >What can "stuff" be? I've never looked closely at TeX source ([nt]roff
| >suits me fine). If it can contain nested {} pairs, then you are out
| >of luck for now. (See the matching ( ) thread currently going on.)
| So he's out of luck. TeX source is indeed organised as nested blocks.
+--->8
Only if you insist on trying to do it in a single regexp. What's the matter
with looping?
--
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)
------------------------------
Date: Sat, 10 Jan 1998 15:33:06 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: serious post about gmtime and year-1900 (was Re: Perl not Y2K compliant)
Message-Id: <1d2n8o9.jsa2v9r3eh4bN@roxboro-171.interpath.net>
Russell Schulz <Russell_Schulz@locutus.ofB.ORG> wrote:
> phenix@interpath.com (John Moreno) writes:
>
> > Perl does the right thing (trust us),
>
> :-)
>
> > but what your local C library does is beyond anybody except the people
> > using it.
>
> such as the people using perl, if you compiled it locally.
Yes, they are the ones that know.
> which doesn't address the people who don't compile perl locally, and
> want to have emprical reassurance that it works as documented.
Ok, serious question. Do you know of any implementation of the current
version of Perl which doesn't do the right thing?
There's no more reason to expect this not to work than there is to
expect something like printf or chdir.
> > Putting code in the documentation to test your local runtime is beyond
> > the scope of the documentation.
>
> you're right. we should leave it as is, because it's obviously clear
> enough to the people who keep posting asking if it's going to work.
>
> sorry, the subject says `serious'. let me rephrase that:
>
> I think that any decision as bad as returning 98 for 1998 and 101 for
> 2001 should be documented, with examples past the border case, so the
> implementors know how to get it right, and users know what to expect.
It *IS* documented - this question (like a bunch of others) are asked by
people who don't bother to READ the documentation.
Straight from perlfunc for gmtim: "Also, $year is the number of years
since 1900, not simply the last two digits of the year."
> of course, the main goal of such documentation is to make the person
> deciding on such a bad representation to realize it should just be
> done less obscurely in the first place, but that opportunity for C
> (and thus Perl) was gone almost 20 years before Perl was born.
The thing is that it's not such a particularly bad representation - the
only disadvantage in using it is for people who don't read the
documentation. Well, that and the fact that it doesn't do very well for
times before 1900.
After reading the documentation, anybody who doesn't believe what it
plainly says can check it out very easily. But putting it in the
documentation implies a severe lack of faith in the people building it,
and if you're not going to believe that they are doing the right thing
here then why believe it for any function? Should there be test code
for every perl function to show that it does what the documentation says
it does? Doing this for the regex functions is going to be a bit, how
shall I put it, *difficult*.
--
John Moreno
------------------------------
Date: Sat, 10 Jan 1998 15:12:00 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: serious post about gmtime and year-1900
Message-Id: <Pine.GSO.3.96.980110150750.26607E-100000@user2.teleport.com>
On Fri, 9 Jan 1998, Russell Schulz wrote:
> Tom, you should find software that indicates when you have mailed
> a copy of a post,
I already do. There should be a 'Newsgroups:' header on this message, for
example. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 10 Jan 1998 16:21:25 -0500
From: "Stephen Warren" <swarren@eclipse.net>
Subject: SOLUTION: I/O redirection not working on Perl on Win32
Message-Id: <698pv4$o10$1@news.eclipse.net>
To review:
I was using the NT task scheduler to run a batch file, that then 'call'ed
another batch file, that then executed a Perl script. I wanted to capture
STDOUT and STDERR of the whole lot into a single file, but none of the
Perl output was getting logged.
I traced the problem to the way I was executing the Perl scripts. I'd
associated .pl scripts with perl.exe and added ";.pl" to my PATHEXT
environment variable so I could run scripts like "io.pl" rather than "perl
io.pl". However, when running scripts like this, I/O redirection doesn't
seem to work. Simply changing all those lines in the .bat files to "perl
io.pl" made it all work perfectly.
Actually, this problem isn't specific to running Perl from the NT task
scheduler, or it being called from a .bat file - I observer the exact same
behaviour when running Perl manually from a command-prompt.
Hope this helps everyone who had similar problems!
--
-----------------------------------------------------------------
Stephen Warren, Systems Engineer, Technology House Inc., New York
mailto:swarren@techhouse.com http://www.techhouse.com/
mailto:swarren@eclipse.net http://www.eclipse.net/~swarren/
MIME, S/MIME and HTML mail are acceptable
------------------------------
Date: Sat, 10 Jan 1998 15:17:14 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: TechMaster Pinyan <jefpin@bergen.org>
Subject: Re: sorting problem
Message-Id: <Pine.GSO.3.96.980110151649.26607F-100000@user2.teleport.com>
On Sat, 10 Jan 1998, TechMaster Pinyan wrote:
> sort (@menu);
That's a useless use of sort in a void context.
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 10 Jan 1998 13:51:27 -0600
From: jhelt@preferred.com
To: jhelt@preferred.com
Subject: Taint, open, and a pipe...
Message-Id: <884461727.1335951369@dejanews.com>
I am editing a perl script to meet my ISP's requirements of passing Taint
checks, use strict, and use diagnostics.
My script compiles correctly, but hangs at the following command ONLY WHEN
TAINT CHECKING IS ENABELED:
open(MAIL,"|$mailprog $mailto" || die "Can't open $mailprog\n";
It seems that taint checking is stripping out the pipe precedeing
$mailprog.
Any suggestions??
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Sat, 10 Jan 1998 15:33:14 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: UNIX commands via FTP on a MACINTOSH -- HAY-ELP!
Message-Id: <1d2na86.aokvs34p0ehwN@roxboro-171.interpath.net>
brian d foy <comdog@computerdog.com> wrote:
> mbudash@sonic.net (Michael Budash) posted:
>
> >10 points to brian for the closest answer. actually, the correct answer is
> >the "Set Permissions..." command
> >in the Remote menu.
-snip-
> but just as an aside, has anyone done anything with MacPerl and
> scripting AppleScriptable thingys?
I've done a bit - basically it's no different than writing and running
the applescript using the script editor. One thing that might not be
obvious is that you can return values from applescript calls.
$name = MacPerl::DoAppleScript qq{ return "Jack" };
The result will include the quotes so you'll have to strip them off, and
you need to keep separate commands on separate lines.
$number = MacPerl::DoAppleScript qq{ set c to 10 return c };
Doesn't work right and returns 0
$number = MacPerl::DoAppleScript qq{
set c to 10
return c };
Works right and returns 10
--
John Moreno
------------------------------
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 1615
**************************************