[11443] in Perl-Users-Digest
Perl-Users Digest, Issue: 5043 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 3 09:07:22 1999
Date: Wed, 3 Mar 99 06:00:18 -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 Wed, 3 Mar 1999 Volume: 8 Number: 5043
Today's topics:
Re: *** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Pos <andrewf@beausys.demon.co.uk>
Re: *** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Pos (Jonathan Stowe)
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Re: CGI.pm dave@mag-sol.com
fork() for Win32 <jasongadde@home.com>
Re: fork() for Win32 (Bart Lateur)
Re: Help choose a book! dave@mag-sol.com
Re: help on APPLET Class (Jonathan Stowe)
help!, Hash or sparse arrays? <"paskd;jf"@hasdf.com>
Re: How do I get Perl Modules to run in my webspace? <graham@dragroup.com>
Re: HTML to MSWORD, PDF, POSTSCRIPT <Philip.Newton@datenrevision.de>
Inserting a 'newline' in arrays? <horizon@internetexpress.com.au>
Re: module for 'get' command? (Bart Lateur)
Re: Need Help with Regular expressions (Steve Grantz)
Problem with readdir and sub directories pault2000@my-dejanews.com
Re: Re[2]: does perl discourage obfuscated code? (was R <bill@fccj.org>
Re: Regular Expressions <mario.schomburg@iname.com>
Re: The millennium cometh -- eventually <bill@fccj.org>
Re: The millennium cometh -- eventually <bill@fccj.org>
Re: This Hostname/IP Convert script is not working (Michel Dalle)
Re: Tied hashes and locking <cederstrom@removethis.kolumbus.fi>
Re: Why isn't this a race condition ? <cederstrom@removethis.kolumbus.fi>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 3 Mar 1999 12:39:01 +0000
From: Andrew Fry <andrewf@beausys.demon.co.uk>
Subject: Re: *** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Posted Twice Weekly ***
Message-Id: <YkB58AAl1S32EwZu@beausys.demon.co.uk>
In article <7bhei2$rgt$1@client2.news.psi.net>, Abigail
<abigail@fnx.com> writes
>Andrew Fry (andrewf@beausys.demon.co.uk) wrote on MMIX September MCMXCIII
>in <URL:news:g75mKCA88822EwWw@beausys.demon.co.uk>:
>^^
>^^ I am quite calm, thanks, and have not made any stupid remarks. My point
>^^ is simply that I find it irritating and patronizing to be constatntly
>^^ told what I should be reading. I know what I should be reading, I know
>^^ how much time I have to read, and Ill get around to it at my own pace.
>
>
>Your time is more important than other people time?
In view of the constant misinterpretations of what I said (or did not
say) - some of which (like this one, and Uri's) are quite absurd -
and the complete over-reaction (some of which borders on hysteria),
let's just get a number of things straight...
1. I did not say, or imply, that my time is more important than
other people's time (...generally speaking).
(However, personally speaking ... and the same holds true for
each and every one of us ... I am primarly concerned with how
I spend/use my time, and less so with how others use theirs.
...and before someone misinterprets that statement, I am not
saying that this gives me a right to waste other people's time).
2. I did not say, or imply, that this newsgroup exists solely for the
purpose of you Perl experts to answer the questions that us newbies
post.
3. I did not say, or imply, that newbies shouldnt make an effort to
find out what documentation exists, read the FAQs, man pages, etc
(...when they have time). Nor did I say or imply that using
documentation is not important.
4. I did not say, or imply, that Usenet groups are, or should be
treated as, a real-time medium for obtaining quick answers to
questions, or used as the one and only means of obtaining answers.
5. I did not say, or imply, that I do not appreciate the efforts
of those who do respond to questions (...other than to say
only RTFM).
All I said was that I find it irritating and patronizing to be
constantly told what I should be reading. I dont tell you how
to spend your time, so dont tell me how to spend mine.
Facts:
1. I have never come across another newsgroup where the RTFM
remark is used so frequently.
2. I have seen remarks in responses to suggest that this newsgroup
is primarily for the experts to discuss "interesting" issues,
and that newbies really shouldnt waste the time and attention
of the experts by posting trivial questions that are answered
in the documentation. A couple of e-mails sent to me personally
have stated this view explicitly.
3. I have had e-mails from other newbies who have been "put off"
using the newsgroup because of this elitist view and remarks
made to them.
Well, thats my view, and I have a right to express it.
---
Andrew Fry
"Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).
------------------------------
Date: Wed, 03 Mar 1999 12:10:10 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: *** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Posted Twice Weekly ***
Message-Id: <36dd264d.12416424@news.dircon.co.uk>
On Wed, 03 Mar 1999 11:33:47 +0100, Philip Newton
<Philip.Newton@datenrevision.de> wrote:
>Abigail wrote:
>>
>> Ronald J Kimball (rjk@linguist.dartmouth.edu) wrote on MMX September
>> MCMXCIII in <URL:news:1do2799.dvk4pb1as2dmmN@bay1-134.quincy.ziplink.net>:
>[...]
>
>Abigail, where are you getting those dates from? MMX September MCMCXIII,
>indeed!
>
Is anyone working on an Abigail FAQ ?
/J\
------------------------------
Date: Wed, 03 Mar 1999 11:25:07 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage920460241.27541@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 10 Sep 1998
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://cpan.perl.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://cpan.perl.org/
http://www.perl.com/CPAN/
http://cpan.perl.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:
setdir usenet-by-group/news.announce.newusers
send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 03 Mar 1999 10:54:23 GMT
From: dave@mag-sol.com
Subject: Re: CGI.pm
Message-Id: <7bj4ct$om0$1@nnrp1.dejanews.com>
In article <7bhgce$a8h$1@bolka.matav.net>,
"Dixie Flatline" <izsof@lisa.njszki.hu> wrote:
> Hi!
>
> From where can I obtain the CGI.pm modole for PERL 5.004?
CGI.pm is included as part of Perl 5.004, just putting 'use CGI;' at the top
of your program should be enough.
If you need a later version, try CPAN <http://www.perl.com/CPAN/>.
hth,
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 03 Mar 1999 13:16:34 GMT
From: Jason Gadde <jasongadde@home.com>
Subject: fork() for Win32
Message-Id: <36DD3701.C8609A3B@home.com>
Does anyone have any ideas on how I can get around using fork( ) in my
script that runs a on Win32 platform? I know fork() (and others) are
not supported. But I need to use a Win32 platform and have interprocess
communication. Thanks!
Jason.
------------------------------
Date: Wed, 03 Mar 1999 13:48:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: fork() for Win32
Message-Id: <36de3d90.466478@news.skynet.be>
Jason Gadde wrote:
>Does anyone have any ideas on how I can get around using fork( ) in my
>script that runs a on Win32 platform? I know fork() (and others) are
>not supported. But I need to use a Win32 platform and have interprocess
>communication. Thanks!
Maybe launch a second copy of the script (with command line arguments)?
Bart.
------------------------------
Date: Wed, 03 Mar 1999 10:46:48 GMT
From: dave@mag-sol.com
Subject: Re: Help choose a book!
Message-Id: <7bj3un$oat$1@nnrp1.dejanews.com>
In article <7bh1f8$uvn$1@nnrp1.dejanews.com>,
dhosek@webley.com wrote:
> In article <7bgp75$69gc$1@newssvr03-int.news.prodigy.com>,
> "Harris Mahedavi" <mahedavi@prodigy.net> wrote:
> > Can some one suggest a good Perl5 book for web development book. And what
> > does one think of Perl5 complete.(McGraw Hill)
>
> Get the O'Reilly books. You'll want the llama book, the camel book and the CGI
> book & you'll be in great shape. Read the llama book first, dip into the camel
> book as necessary. The CGI book I don't have, but have heard good things
> about... many find that they can get by with the on-line documentation for CGI
> stuff (there's some basic info in the llama book to get you started).
IMO the CGI book (CGI Programming on the World Wide Web) is looking a little
dated now. A second edition (renamed CGI Programming with Perl) is scheduled
for release later this year, so I'd wait for that if you can.
In the meantime, look at Lincoln Stein's book The Official Guide to
Programming with CGI.pm, as that will tell you all you need to know.
hth,
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 03 Mar 1999 12:08:02 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: help on APPLET Class
Message-Id: <36dd0b4d.5503008@news.dircon.co.uk>
<followups set>
On Wed, 03 Mar 1999 18:16:25 +1100, in comp.lang.perl.misc lql
<liu@bommerang.aero.rmit.edu.au> wrote:
>Hi, My friends,
> I am a now stuying the Javascript. But I just don't understand what
>does the ***.class mean, and how it could be produced. If someone could
>be
>of any help, Please send me some information about it or tell me where
>could I find some good tutorials about it.
Its not even if 'perl.misc' has the same number of characters as
'javascript' is it, none of the corresponding letters are adjacent on
the keyboard, they dont sound the same, they dont smell the same, they
dont taste the same. I dont think they even hang out together very
often.
/J\
------------------------------
Date: Wed, 03 Mar 1999 06:04:32 -0700
From: "Paul M. Neth" <"paskd;jf"@hasdf.com>
Subject: help!, Hash or sparse arrays?
Message-Id: <36DD335F.EAC723B1@hasdf.com>
I am working on the following perl script.
******************** START mergerh.pl
: # use perl
# mergerh.pl perl program to read RAWS file (rochelle.raws), extract
data year desired,
# sort and then fill blanks with CIRA data file (badl_t.all)
# export date and rh to external file
# make it handle leap year also
use strict
# define year to extract
$yr = 96;
@daysinmonth = (31,28,31,30,31,30,31,31,30,31,30,31);
# compute leap yr flag also, with easy computation
if ((1996 % 4) == 0) {
$lyf = 1;
} else {
$lyf = 0;
}
# specify the output seperators
$, = ' '; # set output field separator
$\ = "\n"; # set output record separator
# open the CIRA visibility transmissiometer file
open(CIRA,'badl_t.all') || die 'Cannot open file "badl_t.all".';
# open the RAWS data file also
open(RAWS,'rochelle.raws') || die 'Cannot open file "rochelle.raws".';
print "reading RAWS data";
while (<RAWS>) { # read data file (RAWS) listed on the cmd line
if (!/^:/) { # if a colon does NOT start a line then do this
($Date,$prec,$wsmph,$wd,$tempf,$fuelf,$rh,$bp,$wsgust,$mxgust) =
split(' ', $_, 9999);
# extract yr,mm,day,hr from long date string
$yymmddhh = substr($Date,0,8);
# extract 2 digit year from long date format
$datyear = substr($Date,0,2);
if ($datyear == $yr) { # if data year is == to year specified then
# assign key/val into hash
%raws=($yymmddhh,$rh);
print "1996 is OK and date = $yymmddhh and rh = $raws{$yymmddhh}";
$olddate = $yymmddhh;
} # end if datyear is right
} # end regex filter
} # while reading all lines
# READING APPEARS TO WORK
# output available data, hash might be missing some data
print "writing raws data";
for ($mm=1;$mm<=12;$mm++) { # loop over months
$maxdays = $daysinmonth[$mm-1]; # get maxdays
# check for leap yr and increment max days if needed
if (($mm==2) && ($lyf == 1)) {
$maxdays++
}
for ($d=1;$d<=$maxdays;$d++) { # loop over days
for ($h=0;$h<=23;$h++) { # loop over hrs
# pad month with 0 if needed
$padmm = sprintf( "%02d", $mm );
# pad day with 0 if needed
$paddd = sprintf( "%02d", $d );
# pad hr with 0 if needed
$padhh = sprintf( "%02d", $h );
# recreate the hash date using for loop variables
$newdate = $yr.$padmm.$paddd.$padhh;
print "new date = $newdate and new hash data = $raws{$newdate}"; #
PROBLEM?
print "old date = $olddate and old data = $raws{$olddate}"; #
PROBLEM?
print "$newdate and $raws{$newdate}\n";
}
}
}
******************** END mergerh.pl
As far as I can the reading ( e.g. 1996 is OK and date = 96012613 and rh
= 82.0)
seems to be working into the hash. The printing is giving errors. Or am
I referencing the
hash wrong?
******** start output
Use of uninitialized value at mergerh.pl line 71, <RAWS> chunk 50386.
new date = 96010620 and new hash data =
old date = 96010116 and old data = 64.0
Use of uninitialized value at mergerh.pl line 74, <RAWS> chunk 50386.
96010620 and
********* end output
I have also checked for spaces on the end of my concatenated date.
I am used to writing awk scripts with arrays. I tried putting the data
into arrays but it started swapping. I then discovered that perl doesnt
allow sparse arrays? In awk I can allocate $data[$yymmddhh] (e.g.
$data[96020212] without swapping?).
A hash is the best solution for sparse or duplicate data right?
The print statement after reading that line appears to work. How come I
cant reference the hash with?
$adate = 96020110;
print "testdate = $adate rh = $raws{$adate}";
I still keep getting a blank for $raws hash output. What am I doing
wrong?
Thanks in advance
Paul
------------------------------
Date: Wed, 3 Mar 1999 11:23:38 +0000
From: Graham Stow <graham@dragroup.com>
Subject: Re: How do I get Perl Modules to run in my webspace?
Message-Id: <8riSBDA6uR32EwMI@dragroup.com>
>Whyt is your ISP telling to install modules that are part of the standard
>perl library? This makes me think that your ISP is using an old version of
>Perl. When you do perl -v what do you find out?
You're absolutely correct David. I was given duff gen! The problem
*seems* to have been that my scripts were not referenced to Perl5
(#!/bin/perl5) and the standard Perl5 modules being called were
therefore not being found.
However, although my script is now running on my ISP's server, it is not
producing the correct output and I obviously have a bug somewhere.
Problem is I can't debug it locally 'cause when I do I get the error
message..'Can't locate DB_File.pm in @INC at script.pl line 204. BEGIN
failed - compilation aborted at script.pl line 204'.
This isn't happening with the other Perl modules I am calling
(Getopt::Long and English), yet all three are on my system, although in
different directories.
So how do I get DB_File.pm into the @INC array on my system. I am
running Perl v5.003_07 and Windows95. Any ideas anyone?
--
Graham Stow
------------------------------
Date: Wed, 03 Mar 1999 12:23:04 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: HTML to MSWORD, PDF, POSTSCRIPT
Message-Id: <36DD1B98.C8A73728@datenrevision.de>
Rollo Chan Ka Chun wrote:
>
> Is there any method or module which can convert a HTML file to MSWORD or
> PDF or POSTSCRTIPT file???...thanks for your attention and help.
AFAIK MS Word (at least Word 97) can read HTML directly; no need to
"export" the HTML to anything else. This has nothing to do with Perl,
though.
------------------------------
Date: Wed, 03 Mar 1999 23:11:56 +1100
From: Mick <horizon@internetexpress.com.au>
Subject: Inserting a 'newline' in arrays?
Message-Id: <36DD270C.4EECE63A@internetexpress.com.au>
Hi....I've got this segment of code -
push @{ $hash{$user_name} }, join(",",$date,$elapsed_time);
@outlines = ();
@vals = @{ $hash{$user_name} };
print "********** VALS ARE @vals \n";
foreach(@vals) {
push @outlines, @{ $hash{$user_name}}; #Is this
right?
}
open(OUTFILE, ">$user_name") or die "Couldn't open file
$user_name\n";
print OUTFILE @outlines;
So I'm creating a file called $user_name, and in that file is $date and
$elapsed_time, this is fine, but, I have the values seperated by commas
on one continual line!
How do I force a \n after the $elapsed time but without placing a ','
after the $elapsed_time?
SO -
02-03-99,4321
03-03-99,2334
etc
Would be the output I require in the users file.
not
02-03-99,4321,
03-03-99,2334, etc
or
02-03-99,4321,03-03-99,2334, etc
Any help is greatly appreciated!
Thanks,
Mick
--
HORIZON
Software
Solutions
Developers /
Consultants
-= Integrated Systems / Internet / Unix /
Windows / Linux =-
------------------------------
Date: Wed, 03 Mar 1999 12:54:27 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: module for 'get' command?
Message-Id: <36de3061.18700534@news.skynet.be>
Jeremy Hill wrote:
>Hi, I remember having a module that gave me a 'get'
>command, so I could say something like:
>
>use ICantRemember;
>@HtmlFile = get("http://wherever.com/index.html");
^^^
$
>or something similar. I've been searching around, and
>have found many similar things, but none this simple.
LWP::Simple, part of libwww.
Bart.
------------------------------
Date: Wed, 03 Mar 1999 13:21:41 GMT
From: sgrantz@visi.com (Steve Grantz)
Subject: Re: Need Help with Regular expressions
Message-Id: <FHaD2.522$66.25661@ptah.visi.com>
Nima Mortazavi (nima.m@lyckseleNOSPAM.net) wrote:
: I have a text file with following row :
: =========
: Hi $name How are you
: My name is $info{'name'}
: This file is /etc/$fil.txt
: I am working on Usa/$city/street
: =======
:
: Now , In my perl program, I want read the text file and replace the
: variables in text file
: with the existing value of variable , I use the following code in my
: program.
[code snipped except for regex]
: $Harray[$Hm] =~ s/\$(\w+)/${$1}/g; # My Regular expressions
:
: My Regular expressions works with variable $name ,$fil and $city , but not
: with variable $info{'name'} .
: How Should I write my Regular expressions to works with all the 4 variables
: ?
You actually have two issues to address.
The first is that the pattern match does not fully grab info{'name'},
it grabs info.
That can be fixed by changing the pattern match from
/\$(\w+)/ to /\$([\w\{\}']+)/
That is to say, create a character class that includes curly braces and
single quotes as well as \w characters. To anticipate even more
possibilities, you may wish to add \[\] and " to the chaarcter class.
You may also wish to add $ and other special characters. You may even
want to allow for all non-whitespace characters.
For your example, though, that regex works.
The second issue is that the variable ${$1} in the substitution is
meaningless for $1 == info{'name'}.
Instead, you need to have something like the following:
if ($Harray[$Hm] =~ /\$([\w\{\}'"]+)/) {
$var_name=$1;
if ($var_name =~ /([^\{]+)\{'?([^']+)'?\}/) {
$Harray[$Hm] = $` . ${$1}{$2} . $';
} else {
$Harray[$Hm] = $` . ${$var_name} . $';
}
}
in place of your substitution.
I tested that code segment and it works. Note, howevr, that it only
works of the first incident on each line, unlike the s///g syntax
you originally had. This can probably be fixed with a loop or
a recursive function. Have fun.
Also note that the variable name match strips out the single quotes from
the hash index. This was necessary: for some reason if the quotes are
still there, the result of ${$1}{$2} is not the same.
This is probably not the most elegant solution, but it works in the
case of your example.
-Steve
--
More of Steve Grantz's Blather at 2 * McQ != McQ
http://www.visi.com/~sgrantz 0.5 * McQ == McQ
------------------------------
Date: Wed, 03 Mar 1999 12:59:59 GMT
From: pault2000@my-dejanews.com
Subject: Problem with readdir and sub directories
Message-Id: <7bjbob$u8j$1@nnrp1.dejanews.com>
Hello Everyone!
I am writing a script (well, trying) that will put all of the files in a
folder into an array and then do some regular expression stuff,etc.. I have
sussed out the expressions (it was nearlt the death of me) but I am stuck
trying to get the file names from the sub directories. The script below is an
example of where I have been with this. It gladly prints the sub directory
names but I need some pointers on taking it one step further so that I can
get into all the following folders.
Any help at all will be greatly appreciated and I am sure will be rewarded in
the next life!
#!/usr/local/bin/perl -w
#
require "cgi-lib2.pl";
print "Content-type: text/html\n\n";
#open and read directory
opendir (DIR, "/export/thelawyer/webpages/conferences2/") or die "cannot open
directory $!";
#chuck filenames into filenames array
@filenames = readdir (DIR);
closedir (DIR);
#change directory so that the skip old files can work
chdir ("/export/thelawyer/webpages/conferences2/") or die "cannot chdir $!";
foreach $file (@filenames){
next if -M $file > 1; # skip files modified before today
next if ($file =~ /^\.\.?$/); # Skip . and ..
next if ($file =~ /bak?$/); # Skip bak
print "$file\n";
};
print "finished";
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 02 Mar 1999 22:52:28 -0500
From: "Bill Jones" <bill@fccj.org>
Subject: Re: Re[2]: does perl discourage obfuscated code? (was Re: Perl evangelism)
Message-Id: <36dcb150.0@usenet.fccj.cc.fl.us>
>> Are you automatically associating "compact" and "symbols" with
>> "unreadable"? Maybe you need a new definition. :) If you knew only
>> Hawaiian, and then had to learn English, you'd probably scream at
>> having to learn *26* letters now. I think you'll need a more
>> agreeable definition of "obfuscated" before we can argue this further.
>>
>> My definition of "obfuscated" is "code that even when someone *knows*
>> the language appears to do one thing and actually does another".
>>
>> But in summary, let us please stop passing around the myth that Perl
>> *is* write-only code, or *encourages* write-only code. I've found
>> neither of those to be true in my commercial experience, and you are
>> merely damaging the Perl community by passing along such lies. In
>> most of the code I've been asked to maintain from others (even
>> beginners), the question was never "what are they doing here" but "why
>> are they doing this", which would have been true no matter what the
>> language.
I personally have always felt that
Perl was a lot like C - only better :]
-Sneex- :]
//______________________________
// Jacksonville Perl Mongers
// http://jacksonville.pm.org
// jax@jacksonville.pm.org
'Be not the first by whom the new are tried,
nor yet the last to lay the old aside...'
------------------------------
Date: Wed, 03 Mar 1999 12:13:18 +0100
From: Mario Schomburg <mario.schomburg@iname.com>
Subject: Re: Regular Expressions
Message-Id: <36DD194E.C98B033B@iname.com>
Tony Curtis wrote:
>
> Re: Regular Expressions, Mario
> <mario.schomburg@iname.com> said:
> Mario> Hi, does anyone know a possibility to
> Mario> generate a regular expression for a couple of
> Mario> strings? I would like to provide these
> Mario> strings to a function which will return a
> Mario> regular expression matching all these
> Mario> strings.
>
> sub matchall { '.*'; }
;-) I knew about this ...
> Your question is rather vague, could you be a bit
> more explicit about what you want? Is it a minimal
> regexp to match the set of strings?
The regexp should be a bit more complicated than (.*).
The function should analyze the strings and build a regexp
that characterizes these strings. It should at least recognize
identical beginnings and endings (the strings I think of will have
identical beginnings in most cases). This would be rather easy,
but the function is welcome to do more about the regexp (for example,
finding identical parts in the middle ...)
Before starting to think about it, I wanted to check if someone
else has already implemented it :-)
The generated regexp does not need to be the best regexp for the
strings (is it possible to find it in a program?), but should (as I
said above) be far more complicated than (.*).
Mario Schomburg
------------------------------
Date: Tue, 02 Mar 1999 22:26:52 -0500
From: "Bill Jones" <bill@fccj.org>
Subject: Re: The millennium cometh -- eventually
Message-Id: <36dcab4f.0@usenet.fccj.cc.fl.us>
In article <MPG.11460e2ca59d16769896c6@nntp.hpl.hp.com>, lr@hpl.hp.com
(Larry Rosler) wrote:
> And I think this thread has run out of Perl content!
>
> --
> Larry Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
Hmmm...
print ((localtime)[5] + 1900);
There, perl is now back in
it's relevant place.
HTH,
-Sneex- :]
//______________________________
// Jacksonville Perl Mongers
// http://jacksonville.pm.org
// jax@jacksonville.pm.org
------------------------------
Date: Tue, 02 Mar 1999 22:37:54 -0500
From: "Bill Jones" <bill@fccj.org>
Subject: Re: The millennium cometh -- eventually
Message-Id: <36dcade6.0@usenet.fccj.cc.fl.us>
In article <7bhv9k$q1f$1@nnrp1.dejanews.com>, charlottekane@hotmail.com
wrote:
> In article <19990302.105510.8E6.rnr.w164w@locutus.ofB.ORG>,
> Russell Schulz <Russell_Schulz@locutus.ofB.ORG> wrote:
>
>> have you _ever_ seen anyone think 2000 is part of the 1900s?
>> --
>> Russell_Schulz@locutus.ofB.ORG Shad 86c
>>
>
> Thank God!
>
> I thought I was alone in trying to get through to people that 2000-2999 = 1000
> years = a millennium.
>
> I can't believe the emotional resistance such a simple concept runs up
> against.
>
> Keep fighting the good fight!
>
> Charlotte Kane
Guess what? The Millennium starts in 2001 and ends in 3000 :]
Besides, why does this matter at all? And what, specifically
does this have to do with Perl ?
print ((localtime)[5] + 1900);
# prints the current year, correctly, I might add.
# now then, what seems to be the problem?
Now, can we please stop fighting... To paraphrase -
"I can't believe something so simple is so hard to understand..."
Thx!
-Sneex- :]
________________________________________________________________________
Bill Jones | FCCJ Webmaster | http://www.fccj.org/cgi/mail?webmaster
FCCJ | 501 W State St | Jacksonville, FL 32202 | 1 (904) 632-3089
------------------------------
Date: Wed, 03 Mar 1999 15:34:40 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: This Hostname/IP Convert script is not working
Message-Id: <7bjd58$omu$1@news.mch.sbs.de>
In article <01be634f$e556f4c0$3eb5edcc@ed>, "EvaDooRs" <EvaDooRs@netzero.net> wrote:
>
>
>Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote in article
><slrn7dhcmf.rbh.sholden@pgrad.cs.usyd.edu.au>...
>>
>> A solution would be to read the error message that perl gives and
>> rectify it. A simple press of the ~ key should fix it assuming you
>> are using vi, if not use whatever key your editor uses.
>
>The error messages are Use of unitialized value at hostent.pm line 41 and
>also unititialized value at host.pl on line 10 I rechecked over my spelling
>and I can't figure out which values The text editor I'm using is Edit.com
>as in dos and perl in dos...so i hope thats enough info for you.
>
Hey, that sounds familiar. Which version of Perl did you install on your
DOS-box ? I had a similar problem with the ActiveState Perl distribution
of a year or two ago. The problem is probably not in YOUR script, but in the
modules used by Socket and/or Net. In particular, in module hostent.pm at
line 41 :-)
You'll find that file somewhere under your \Perl directory...
Solutions :
1) hack the hostent.pm module (if you know something about that)
or :
2) find a more recent distribution of Perl at CPAN.
I used solution 1 for a while, and then switched to solution 2...
Michel.
------------------------------
Date: Tue, 2 Mar 1999 20:06:36 +0200
From: "Juho Cederstrvm" <cederstrom@removethis.kolumbus.fi>
Subject: Re: Tied hashes and locking
Message-Id: <7bjccu$8t2$2@news.kolumbus.fi>
>If you have the cash, you might seriously consider buying the Ram
>book, _Perl Cookbook_, published by O'Reilly. Section 14.5 is
Yeah. I've read a lot about it, and considered about buying it. Maybe I
can find a bookstore from this country, which sells it... There are 0.00
bookstores in Savonlinna (a city where I live) which sell PCookbook. :-(
>that all of the code from the book is available here:
> ftp://ftp.oreilly.com/published/oreilly/perl/cookbook/
Well, lets check that out first.
>In general, you must devise your own locking scheme using an extra
>lockfile.
But didn't lockfiles cause race conditions ? Or should I use a rule like
"The one who gets lock to a lockfile, can use the hash too" or what ?
Is it hard to access SQL databases in Perl ?
--
# this is a perl script which will display my email address
$_="acbecddeerfsgthriojmkaltmknoolpuqmrbsutsudvowtxfyi";
s/(.)(.)/$2/eg;s/at/@/;s/dot/./;print $_;
------------------------------
Date: Tue, 2 Mar 1999 19:50:42 +0200
From: "Juho Cederstrvm" <cederstrom@removethis.kolumbus.fi>
Subject: Re: Why isn't this a race condition ?
Message-Id: <7bjcct$8t2$1@news.kolumbus.fi>
>"I don't get locking" here does not mean "I cannot lock files / I can't
>get locking to work" but rather "I don't [fully] understand locking".
Really ? That explains a lot... Thanks for informing me too !
>Maybe you didn't get what Jonathan Feinberg said :).
Yes, I did receive his message... :)
--
# this is a perl script which will display my email address
$_="acbecddeerfsgthriojmkaltmknoolpuqmrbsutsudvowtxfyi";
s/(.)(.)/$2/eg;s/at/@/;s/dot/./;print $_;
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5043
**************************************