[8755] in Perl-Users-Digest
Perl-Users Digest, Issue: 2372 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 21 19:07:11 1998
Date: Tue, 21 Apr 98 16:00:26 -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 Tue, 21 Apr 1998 Volume: 8 Number: 2372
Today's topics:
CGI-Mail Problem (Gaby Rau)
Re: Deleting a Line of Text, but keeping the file tidy (Craig Berry)
Embeding a Perl "Parser" in Visual C++ app? <jbush@bigfoot.com>
Re: GCC and Solaris can't handle dynamic load ? (Greg Bacon)
Re: How to create a new file? <andrewf@cp.pathfinder.com>
Re: HTML Tables -> Preformatted Text ? <beske@worldnet.att.net>
Re: Image can view but cannot download? (Huu Da Tran)
makefiles sysdev@adpsystems.mb.ca
Re: Password changing under Solaris <sneaker@earthling.net>
Re: Password changing under Solaris <brianm@kodak.com>
Re: Pattern Matching on HighBit Characters <hsommer@micro.ti.com>
Perl 5, IIS, WinNT 4.0 <dimfil@spectranet.ca>
Re: Regexp question <rjk@coos.dartmouth.edu>
Re: regular expression question <kapur@cbl.ncsu.edu>
Re: regular expression question <kapur@cbl.ncsu.edu>
Re: spoiled noobie (Jason Gloudon)
Re: Sprite jesten@wdynamic.com
Re: subtitube variable into system command (Andrew M. Langmead)
Re: Symbolic ref and angle opeator <bmb@ginger.libs.uga.edu>
Re: Symbolic ref and angle opeator <hex@voicenet.com>
Re: Symbolic ref and angle opeator (Jason Gloudon)
Re: Time : Year2000 & 2038 code question <bmb@ginger.libs.uga.edu>
Re: Time : Year2000 & 2038 code question (John Moreno)
Re: wanted: small authenticating server for local news (Clayton O'Neill)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 21 Apr 1998 14:30:10 GMT
From: GRau@alcatel.de (Gaby Rau)
Subject: CGI-Mail Problem
Message-Id: <6hiahi$9s3$1@slsgcz.stgl.sel.alcatel.de>
Hi all,
I have a problem with sending an external Email from an Perl-CGI-Script.
I put a perl-Script in my cgi-bin-Directory (Server Apache 1.0.5),
which handles a HTML-Form an finally sends a message:
open ( MAIL , "| mail $adr");
print MAIL "$message";
close(MAIL);
The problem is $adr! If it is in the form localuser@localmachine, it works.
If I try to send it to any other Email adress (e.g. my own see below),
it does not! The mail is then sent to "root" (Postmaster) with an error
message like this
Connected to mailhost:
>>> MAIL From:<nobody@slszwg.stgl.sel.alcatel.de>
<<< 550 Unknown local user 'nobody'
554 GRau@alcatel.de... Remote protocol error
So I guess, I have to provide somehow my identity to the CGI-Script?
But how? Any idea?
BTM, the perl-Script works, if not invoked via CGI, but from command line ...
TIA,
Gaby
---
______________________________________________________________________
/\___/\
Gaby Rau | o o |
Alcatel SEL AG __\_^_/_ _________________
ZIT/A5 (__/ \__) / email: \
D-70430 Stuttgart _| . |_ ) GRau@alcatel.de (
phone: +49 711 821-45673 (__\___/__) \_________________/
http://aww.stgl.sel.alcatel.de/pub/it/general/zita5
______________________________________________________________________
------------------------------
Date: 21 Apr 1998 20:24:19 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Deleting a Line of Text, but keeping the file tidy
Message-Id: <6hiv9j$2rt$2@marina.cinenet.net>
Chad Peterson (chad@umr.edu) wrote:
: Ok, suppose I have a data file with variable length lines such as
:
: -----
: Line One
: Line Two
: Line Three
: Line Four
: -----
:
: Now, I want to remove line #3 from this file. I'll use:
:
: $oldstring="Line Three";
: s/$oldstring//;
:
: And this theorertically leaves:
: -----
: Line One
: Line Two
:
: Line Four
: -----
Presuming that you're wrapping this in an iteration through the lines of
the file, and outputing each line after the above substitution, yes.
: What if I don't want a blank line in there? I'm sure you guys know a simple
: way to do this, or I'm sure you'll very quickly point me in the correct
: direction.
Simplest way:
my $delstring = "Line Three";
while (<>) {
print unless /$delstring/;
}
Flashier way, not recommended for big files:
print grep !/$delstring/, <>;
HTH!
---------------------------------------------------------------------
| 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: Tue, 21 Apr 1998 09:44:20 -0500
From: "Alt.net" <jbush@bigfoot.com>
Subject: Embeding a Perl "Parser" in Visual C++ app?
Message-Id: <6hibc7$8dg$0@dosa.alt.net>
I have a Windows batch application that receives data in a variety of
formats. (Everything ranging from binary data to text, and from variable
length records to fixed length.) My application has a bunch of C++ parsers
(in different DLLs) that each know how to parse a particular format. These
parsers take the incoming data and format it into an internal "standard"
record format that can then be processed by the rest of the application.
Unfortunately these formats change frequently and I'm constantly adding and
modifying parsers. This involves a lot of code/compile/debug cycles,
tweaking a parser over and over until it's "just right".
Well, what I'm thinking about doing is letting Perl handle the parsing. Perl
is much better suited for this type of task and should really allow me to
develop the parsers much more quickly. It would make the application much
more stable and the C++ portion of the application would rarely ever need to
be changed.
I could easily have Perl just write the parsed data to a file and then read
that from my C++ app, but that would be too slow. What I'd like to do is to
have Perl pass each parsed record back to my C++ application in memory.
(Maybe the Perl parser could populate an array with all the parsed data
fields and somehow pass the array back to my application?)
Would this be difficult? And what's the best way to go about it? I know the
ActiveState version of Perl seems to be encapsulated almost entirely within
a single DLL. Can I link into it from my app and use it to execute Perl
scripts? Am I nuts for even trying this?
Any help would be greatly appreciated.
Thanks in advance.
John Bush
jbush@bigfoot.com
------------------------------
Date: 21 Apr 1998 14:38:28 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: GCC and Solaris can't handle dynamic load ?
Message-Id: <6hib14$qui$2@info.uah.edu>
In article <y6wwck6oe8.fsf@zeus.genie.uottawa.ca>,
Philippe Lavoie <lavoie@zeus.genie.uottawa.ca> writes:
: My system, SOlaris 2.5.1, gcc 2.7.2.3 on ultra 1.
Are you using GNU as and GNU ld? gas + gld + gcc + perl + Solaris is
a fatal combination. The INSTALL document that ships with the perl
distribution specifically addresses Solaris and dynamic loading.
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Tue, 21 Apr 1998 16:37:20 -0400
From: "Andrew F. Lee" <andrewf@cp.pathfinder.com>
Subject: Re: How to create a new file?
Message-Id: <Pine.GSO.3.95.980421163604.13834B-100000@cp.pathfinder.com>
On 20 Apr 1998, Matthew Bell wrote:
> open(NEWFILE,$NewFN) or die "\nUnable to create $NewFN -- $!\n";
> # I was expecting this would create a new file in the current directory,
Try open(NEWFILE,">$NewFN") or die ...
-------------------------------------------------------------
Andrew F. Lee | |
Software Engineer | parenttime.com |
email: andrewf@pathfinder.com | 1271 Avenue of the Americas |
Phone: (212) 522-2769 | New York, N.Y. 10020 |
-------------------------------------------------------------
When I say, "Ignore the man behind the curtain."
That is because there is no man behind the curtain.
------------------------------
Date: Tue, 21 Apr 1998 10:35:31 -0400
From: Bryan Beske <beske@worldnet.att.net>
Subject: Re: HTML Tables -> Preformatted Text ?
Message-Id: <6hiasr$sok@bgtnsc03.worldnet.att.net>
> Does anyone know of a script that will convert an HTML table to
> preformatted text? Essentially, I need a way to generate tables
> that will be viewed on mainframes.
Just a though...How about somthing like:
$content = `lynx http://...`; # Fetch the url using lynx
b^2
------------------------------
Date: Tue, 21 Apr 1998 20:37:05 GMT
From: tranhu@jsp.umontreal.ca (Huu Da Tran)
Subject: Re: Image can view but cannot download?
Message-Id: <slrn6jq0rb.1gd.tranhu@derby.jsp.umontreal.ca>
Un jour, Craig Berry (cberry@cinenet.net)
affirmait publiquement que:
| brian d foy (comdog@computerdog.com) wrote:
| : In article <353b89a0.1412664@news.hknet.com>, stevenchan69@hotmail.com (LM386) posted:
| : >Image can view but cannot download?
| : >how is the technique to make it possible?
| :
| : if you can see it you can download it. the LWP module makes this
| : an even easier thing to do.
|
| To put it even more strongly, if you can see it you have obviously
| *already* downloaded it! The image bits are there inside your machine,
| or you couldn't see them on your screen.
To put my version of the answer: Java applet.
- --
__________________________________________________________________________
TRAN, Huu Da Universiti de Montrial
tranhu@jsp.umontreal.ca http://www.jsp.umontreal.ca/~tranhu/
Version: PGPfreeware 5.0i for non-commercial use
Charset: noconv
iQEVAwUBNT0DZ68TFco5wIPxAQEW+Qf/Wy/Az+ICeiqxc8IweiE1+aRVn0ubZkdS
9ASvGeummCtNbaizI9+ogdh1glgZNUGDpPCn/MJwbQ/m3Bl59gtv3osg1Axq4pbX
qBwc9DU9IYe+ELKjkqvkiLkCo69zl4HxcfC/5onHAjshXU8zl3XLY4z3msLrjf8E
VWLW3eYmHQ+lP4v6ba6o3LG351NaKrUKUqxP8+4qbdrz5FGDHB0gE9V8V6zlSFOa
/Zhucj+XXQxRL65vMhUGsvsTDhajmPRcxMbdAG+1Hi8HOYC3CG7n2Wo5xpLpfMeZ
Bjr5LKE+hSNNwTSpcNQbixV80UvgTJlsgxXIDJv2ChHsKBqzbe7nfQ==
=HwG3
-----END PGP SIGNATURE-----
------------------------------
Date: Tue, 21 Apr 1998 09:48:00 -0600
From: sysdev@adpsystems.mb.ca
Subject: makefiles
Message-Id: <6hibj0$lku$1@nnrp1.dejanews.com>
Hi all,
I have browsed dejanews, and found that
all of these groups talk about makefiles somewhere,
so I hope that I'll find someone knowledgable.
We are using:
Server:
AIX Version 4
Oracle 7.2.3.0.0
pro-c 7.1.2.0.0
Client:
Windows for Workgroups 3.11
Debugger: Exceed by Hummingbird. Starts with X-start.
We program embedded SQL programs in C. We are having a lot
of problems with our makefiles .
We have either one or both of these symptoms.
1) the makefile cannot find the "include"d files
(using ", or <>, makes no difference.) unless we include
the whole path.
2) if we can get the program to compile, then the debugger
won't work.
How's that for frustrating?
Now, the specification is, that users must edit their test programs
in their own directory. When everything is working right (and only
then), everything is copied to the source code directory, and
recompiled there. We are not going to use version control until
after a program is completed and being tested on live data.
So, the questions are:
1)
Just like the DOS command PATH, how do we get the makefile/compiler
to look/search for "include"d files:
a) in the same directory that the source code is in
b) in a standard library
c) anywhere else that we want to specify
2)
Where can I find some really good documentation on Oracle's makefiles?
I must say, I've never seen compiling so complicated. In every
other language, it's just, compile.
Please respond by email to:
sysdev@adpsystems.mb.ca
Thanks in advance,
Rodger
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Tue, 21 Apr 1998 21:24:01 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: Password changing under Solaris
Message-Id: <353D0CD4.17621F23@earthling.net>
Brian Mathis wrote:
> Well, it's pretty simple actually. I am not using anything except
> Net::Telnet. When you telnet to a machine, it flattens out all the
> output, so it doesn't matter if passwd outputs on STDOUT or STDERR, so
> you can watch for any strings and not have to worry about that.
>
> Expect would have been easier, but I was writing it for an HP-UX system,
> and I'll be damned if I've ever gotten anything to compile on it. I
> needed a pure Perl solution to the problem. Also, telnetting solves all
> suid problems, because you actually log in to the machine as the user
> who's password you are changing.
>
> I don't think this is the best solution, but there apparently isn't a
> best solution to this problem.
>
> Brian Mathis
You have seen Lincoln Stein's 'sniffer' ? You are the only root/SysAdmin on your HP/UX
network? No chance of somone else installing a roge Linux system with full blown
TCPDUMP and hooking up to the network there and watching the 'sifted' packets? At FCCJ
our students try just about everything under the SUN in the name of 'learning' and I
don't have any problems with that; it may make them better SysAdmins in the future.
Gives them an idea of what can be done and how to protect against it.
:-)
But you are right, watching port 80 on a stream is really no different than watching
port 23.
Either way is a substantial risk, that is why passwd was designed to 'know' which tty it
is talking to. But where there is a Hacker Will - there is a Perl Way...
:-)
__________________________
Bill Jones...............|
Sneaker's Nest...........|
Chasecreek Systemhouse...|
------------------------------
Date: Tue, 21 Apr 1998 17:31:29 -0400
From: Brian Mathis <brianm@kodak.com>
Subject: Re: Password changing under Solaris
Message-Id: <353D1031.8E810ACF@kodak.com>
Bill 'Sneex' Jones wrote:
>
> You have seen Lincoln Stein's 'sniffer' ? You are the only root/SysAdmin on your HP/UX
> network? No chance of somone else installing a roge Linux system with full blown
> TCPDUMP and hooking up to the network there and watching the 'sifted' packets? At FCCJ
> our students try just about everything under the SUN in the name of 'learning' and I
> don't have any problems with that; it may make them better SysAdmins in the future.
> Gives them an idea of what can be done and how to protect against it.
[...]
> __________________________
> Bill Jones...............|
Come on, that's ridiculous.. if someone can sniff the network, they will
get a password no matter what, whether it's via the web, telnet session,
whatever. As long as it's over the network, it's vulnerable. Not to
mention, I am telnetting to localhost, so it doesn't actually go over
the network, it goes through loopback.
Brian
------------------------------
Date: Tue, 21 Apr 1998 15:40:25 -0500
From: Holly Sommer <hsommer@micro.ti.com>
Subject: Re: Pattern Matching on HighBit Characters
Message-Id: <353D0439.16CCD5D0@micro.ti.com>
Andre L. wrote:
: It's not the first time I see someone using terms like "junk",
: "funny characters" or "crazy characters" when referring to letters
: with diacritical marks.
:
: I know this place of surely full of educated Americans who don't
: consider the character sets from other cultures as full of "junk",
: so I will try not to get angry.
Well, in this case, the junk happened to be acute capital As. I
would have called it junk if it were a bunch of periods, and I wanted
to get to the non-period information in the text :)
In this case, it was not a reference to character sets from other
cultures - these were characters generated as output from a
search engine database, when we did an "export preferences" command,
and I wanted to put the results into a human-readable format. So...
don't be so sensitive :) Junk is junk, and letters from another
alphabet are letters from another alphabet :)
-Holly, will miss the es-zet, which is being phased out of written
german
------------------------------
Date: Tue, 21 Apr 1998 19:32:19 GMT
From: "DF" <dimfil@spectranet.ca>
Subject: Perl 5, IIS, WinNT 4.0
Message-Id: <7v6%.2959$m7.2300658@news21.bellglobal.com>
I wonder if somebody can give me a hand on this one.
We are running WEB server with Front Page. Perl 5 installed and running. The
problem comes when I try to pass variables from WEB page to Perl. It does
not take any parameters from WEB pages, all variables are blank. For
example, when sending a registration form through e-mail, Perl never sends
it because no variables are getting passed to Perl, it gives and error that
required fields must be filled, although they are filled.
I guess, this is quite stupid installation problem, but I cannot figure it
out.
Any help will be appreciated,
DF
------------------------------
Date: Tue, 21 Apr 1998 00:03:17 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Regexp question
Message-Id: <353C1A86.73CA0D5F@coos.dartmouth.edu>
Larry Rosler wrote:
>
> A.P. wrote in message <353B8BD5.E20015D3@apdo.com>...
> >
> >/(^|\s)(\S+)(\s+\2)+(\s|$)/
>
> As the book says, these subexpressions ensure that the stuff inbetween
> is contained within word boundaries. Later you will meet that idea
> expressed more straigntforwardly as \b.
As Ilya already pointed out, \b matches between \w and \W, not \s and \S.
Hence the use of (^|\s) and (\s|$) in the regex.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 21 Apr 1998 11:05:50 -0400
From: Nevin Kapur <kapur@cbl.ncsu.edu>
Subject: Re: regular expression question
Message-Id: <tylnszz035.fsf@cbl.ncsu.edu>
Nevin Kapur <kapur@cbl.ncsu.edu> writes:
> corrected me in a followup post. The greedy quantifier is necessary.
^^^^^^
Oops - that should be non-greedy. Sorry!
-Nevin
------------------------------
Date: 21 Apr 1998 10:58:11 -0400
From: Nevin Kapur <kapur@cbl.ncsu.edu>
Subject: Re: regular expression question
Message-Id: <tyogxvz0fw.fsf@cbl.ncsu.edu>
[posted and mailed]
doswald@xmission.com (David Oswald) writes:
> On 17 Apr 1998 06:07:49 GMT, cberry@cinenet.net (Craig Berry) wrote:
...
> >
> > $a =~ s/.*\.(\d+?)0*$/$1/;
>
> I posted that same regex solution a couple of days ago and someone
> wrote back to say that the non-greedy quantifier wasn't necessary.
> However, I've read it and re-read it, and agree with you that it is
> necessary. I can't imagine a situation where the above regex would
> work properly without non-greedy matching of \d+?
That someone was me. I made the error of not realizing that $a =
"1.01200" and $a = 1.01200 have different implications. The former is
a string and the latter is the same as $a = "1.012". Tom Phoenix
corrected me in a followup post. The greedy quantifier is necessary.
-Nevin
--
------------------------------
Date: Tue, 21 Apr 1998 04:01:41 GMT
From: jgloudon@hyssop.bbn.com.bbn.com (Jason Gloudon)
Subject: Re: spoiled noobie
Message-Id: <slrn6jo6h1.798.jgloudon@hyssop.bbn.com>
Sahagian <sahagian@ziplink.net> wrote:
>I grew up? with the trim() function which returns a string with the
>leading and the trailing space-chars removed.
Please look in the FAQ on www.perl.com for
How do I strip blank space from the beginning/end of a string?
or 'man perlfaq4'.
--
Jason Gloudon
------------------------------
Date: Tue, 21 Apr 1998 09:53:03 -0600
From: jesten@wdynamic.com
Subject: Re: Sprite
Message-Id: <6hibsf$lp7$1@nnrp1.dejanews.com>
In article <353C9281.28EA8434@express-news.net>,
Ron Woods <rwoods@express-news.net> wrote:
>
> Is there a NT version of Sprite? I've found the Sprite download files;
> but they create unix executables. How do I get the NT executables? Or do
> they exist?
>
The newer versions of WinZip handle the gzip archives and Sprite 3.2 works
like a champ on NT.. I can send you a regular zip if the gzipped archive
won't unpack for you.
Jim
Jim Esten, Lead Developer, WebDynamic
http://www.wdynamic.com
ICQ: 5943404
In the beginning was the word, and the word was ... adjust!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Tue, 21 Apr 1998 14:41:21 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: subtitube variable into system command
Message-Id: <Errq4x.GL1@world.std.com>
johnvun <johnvun@asiapac.net> writes:
>system ("perl -p -i -e "s/shop/shop$ptt/g;" mcc$ptt");
^ perl sees the opening quote, so it starts collecting all
the characters up to the closing quote.
^ perl sees the closing quote. So now it knows that
it has a complete term.
^ perl sees a substitution match, but has
not seen an operator to deal with the previous
term
To do what you are trying to do, say:
system ("perl -p -i -e \"s/shop/shop$ptt/g;\" mcc$ptt");
According to the perlop man page, inside a double quoted string, the
\" sequence inserts a literal quote.
On the other hand, you might be better off handling the files yourself
instead of starting a second perl interpreter.
--
Andrew Langmead
------------------------------
Date: Tue, 21 Apr 1998 10:37:32 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Symbolic ref and angle opeator
Message-Id: <Pine.A41.3.96.980421103442.70330E-100000@ginger.libs.uga.edu>
On Tue, 21 Apr 1998, Matt Knecht wrote:
> the hash of hashes. All fail in compile except this syntax. Here are
> some other things that fail:
>
> $line = <$files{file1}->{filehandle}>; #With or without quotes on barewords
^
|
Could it be barfing on this? (Closed angle bracket--I know that's not the
intention, but perl might not be able to tell that.)
Others may correct me. :-)
----------------
Brad Baxter, UGA
------------------------------
Date: Tue, 21 Apr 1998 20:33:51 GMT
From: Matt Knecht <hex@voicenet.com>
Subject: Re: Symbolic ref and angle opeator
Message-Id: <Po7%.546$Td1.4985921@news2.voicenet.com>
Thanks for all the excellent help everyone. Sorry about not finding the
proper docs before posting here.
But, in case somebody else tries to search Deja News like I did, and comes
up with nothing but this, I thought I'd post what is working for me now.
use IO::Handle;
open($fh, $fname) or die "fooey: $!\n";
$files{'file1'}->{'filehandle'} = *$fh;
$line = readline(${files{'file1'}->{'filehandle'}});
This works perfectly. I'm also extremely pleased that this doesn't seem
to break anything else like tell(), stat(), eof(), etc...
Again, thanks for the excellent help.
--
Matt Knecht <hex@voicenet.com> - The official Minister of Redundancy Minister
of the next millenium!
------------------------------
Date: Tue, 21 Apr 1998 15:10:07 GMT
From: jgloudon@hyssop.bbn.com.bbn.com (Jason Gloudon)
Subject: Re: Symbolic ref and angle opeator
Message-Id: <slrn6jpdm8.7np.jgloudon@hyssop.bbn.com>
Matt Knecht <hex@voicenet.com> wrote:
.
.
>$line = <$files{file1}->{filehandle}>; #With or without quotes on barewords
>
>produces:
>Can't use subscript on glob at /db/hex/bin/ftest line 13, near "'filehandle'}"
>syntax error at /db/hex/bin/ftest line 13, near ">;"
Anything more complicated than $varname in a < > gets interpreted as a glob:
If the string inside the angle brackets is a reference to
a scalar variable (e.g., <$foo>), then that variable
contains the name of the filehandle to input from, or a
reference to the same. For example:
$fh = \*STDIN;
$line = <$fh>;
If the string inside angle brackets is not a filehandle or
a scalar variable containing a filehandle name or
reference, then it is interpreted as a filename pattern to
be globbed, and either a list of filenames or the next
filename in the list is returned, depending on context.
You'll have to stick the file handles into simple scalars to do this.
--
Jason Gloudon
------------------------------
Date: Tue, 21 Apr 1998 10:31:55 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Time : Year2000 & 2038 code question
Message-Id: <Pine.A41.3.96.980421102928.70330D-100000@ginger.libs.uga.edu>
If I'm reading this right, the author knows that the year will not be less
than 70 until the year 2000, when the year will be '00'. Therefore, he is
adding 2000 instead of 1900.
On 21 Apr 1998, Tony Moran wrote:
> $year += ($year < 70) ? 2000 : 1900;
> I know the below is right,
> $four_digit_year = 1900 + $year;
> but why would the author of the first line of code
> want to add back 2000 on to the integer returned
> by localtime().
> What could cause that integer to possibly be lower
> than 70 in the first place ?
> Many thanks, Tony.
> --
----------------
Brad Baxter, UGA
------------------------------
Date: Tue, 21 Apr 1998 14:41:43 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: Time : Year2000 & 2038 code question
Message-Id: <1d7tzkz.171m2y71dk1s0xN@roxboro0-025.dyn.interpath.net>
Tony Moran <tmoran@iol.ie> wrote:
> Hi, in reviewing perl code for compliancy, I came across this in
> a function that calls localtime() and then does:
>
> $year += ($year < 70) ? 2000 : 1900;
>
> I know the below is right,
>
> $four_digit_year = 1900 + $year;
>
> but why would the author of the first line of code
> want to add back 2000 on to the integer returned
> by localtime().
>
> What could cause that integer to possibly be lower
> than 70 in the first place ?
>
> I think, that the code was originally written for the
> Wintel platform, if that might have some bearing..
>
> If you have any suggestions, I'd really appreciate it..
whoever was doing this was trying to be paranoid (always a good thing)
but didn't think things out. The logical thing to do with localtime is
to continue returning a year that is a offset of 1900, and to introduce
at a latter date a function that doesn't need the offset. He wasn't
trusting that the logical thing would get done, and so his program would
work for a while longer - unfortunately if the right this IS done, his
program will fail.
Paranoia is fine, but don't let it get in your way.
And possibly he wasn't paranoid enough - if the script could possibly be
ported to the mac, then it's possible to have a year less than 70 now
(of course that would mean that the clock was set wrong, but that isn't
so far fetched).
--
John Moreno
------------------------------
Date: 21 Apr 1998 15:02:23 GMT
From: usenet@oneill.net (Clayton O'Neill)
Subject: Re: wanted: small authenticating server for local news
Message-Id: <slrn6jpd5u.e03.usenet@hmmm.colo.erols.net>
On 21 Apr 1998 16:36:09 +1000, tom minchin <tom@black.interact.net.au> wrote:
|kira@dillinger.io.com (Jackie Hamilton) writes:
|>Are there any options for free or inexpensive NNTP servers other than
|>CNews and INN? I want to run a small, private news server, that will only
|>have local newsgroups, will not accept or send a news feed, and...
|>preferably, has some kind of authentication module. I don't expect to
|>find exactly what I want - something that will authenticate against a sql
|>db - so I'll probably have to hack it myself, but since I'm such a crummy
|>C programmer a separate module would be easiest... even flat-file
|>authentication would be a good start. Either that or a server that's
|>entirely written in Perl.
|
|Has anyone implanted PAM into INN? That could provide a lot of auth modules
|indirectly for Linux and Solaris 2.6 platforms (and anyone else who uses
|PAM).
|
|Also, panix have written an extension to INN which also seems to allow external
|authentication (Gizmo http://www.panix.com/gizmo/).
I looked at doing some NNTP auth w/PAM a short while ago, but as far as I
could tell there was no way to just pass passwords into it. It appeared to
want to do all the password prompting. That makes sense, since it supports
hardware tokens, OPIE, etc, but it makes it a pain for use w/NNTP.
--
If you think building geographically diverse news servers w/1tb spools and
engineering ways to load balance across them sounds like fun, mail me at
coneill@erols.com, we've got a job for you. :)
------------------------------
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 2372
**************************************