[10006] in Perl-Users-Digest
Perl-Users Digest, Issue: 3599 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 31 18:06:22 1998
Date: Mon, 31 Aug 98 15:00:20 -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 Mon, 31 Aug 1998 Volume: 8 Number: 3599
Today's topics:
Re: Better Regular Expressions (was: Re: Imagine... a n (Ilya Zakharevich)
Copy Problems??? kena4078@my-dejanews.com
Re: Copy Problems??? <nguyend7@msu.edu>
Re: DeCrypt ? (Jonathan Stowe)
Re: DESTROY problems <ets@egnetz.uebemc.siemens.de>
Re: even or odd (John Stanley)
Re: GD.pm (Jonathan Stowe)
Re: Hats off to Tom Phoenix (Jonathan Stowe)
Re: How can I run cgi in NT? <pankaj.telang@infores.com>
Re: how does one delete a file with Perl? <lame.adress@munger.com>
Re: Imagine... a non-greedy world! (Gregory Snow)
Re: Imagine... a non-greedy world! <ajohnson@gpu.srv.ualberta.ca>
Re: Imagine... a non-greedy world! <upsetter@ziplink.net>
Re: Imagine... a non-greedy world! <upsetter@ziplink.net>
Re: Perl compiler (Albert W. Dorrington)
Re: Perl Cookbook, does anyone have it? (Patrick Timmins)
Re: PERL is horrible <lame.adress@munger.com>
perl program for inews (Will Morse)
ReadParse/newline character ?? <benwallach@loop.com>
Re: SSI problem (Jonathan Stowe)
Re: unlinking file if <= 1 hour <nguyend7@msu.edu>
Re: unlinking file if <= 1 hour <evhendrs@micron.net>
Re: unlinking file if <= 1 hour (Larry Rosler)
Re: Using password with sybperl (Jonathan Stowe)
wondering when people post here? (Greg Bacon)
Re: Y2K Date Support (Patrick Timmins)
Re: Yet another RegX Question. (Jonathan Stowe)
Re: Yet another RegX Question. (Larry Rosler)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 31 Aug 1998 19:26:00 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Better Regular Expressions (was: Re: Imagine... a non-greedy world!)
Message-Id: <6setc8$q40$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Uri Guttman
<uri@sysarch.com>],
who wrote in article <x7hfyt2lug.fsf@sysarch.com>:
> real after numerous requests. his last aste of space said that html
> parsing should be built in to RE!! he obviously doesn't understand the
> problem with parsing recursive structures with a non-procedural language
> like RE.
Hmm, probably neither do I. Perl's RE can parse recursive structures,
and, starting from 10 days ago, the syntax is not that bad.
> he juat wants what he wants without concern for how it gets done.
Yep, this is exactly what I want.
Ilya
------------------------------
Date: Mon, 31 Aug 1998 18:42:25 GMT
From: kena4078@my-dejanews.com
Subject: Copy Problems???
Message-Id: <6seqqg$vc6$1@nnrp1.dejanews.com>
I'm having a problem copying any file size greater than 1mb from one directory
to another. Is there a limit on the file size that can be copied from one
directory to another?
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 31 Aug 1998 19:27:33 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: Copy Problems???
Message-Id: <6setf5$r52$1@msunews.cl.msu.edu>
kena4078@my-dejanews.com wrote:
: I'm having a problem copying any file size greater than 1mb from one
: directory to another. Is there a limit on the file size that can be
: copied from one directory to another?
Do you actually want some help, or are you just looking to get flamed?
What function or module are you using? What OS? What port (if
applicable)?
-dan
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: Mon, 31 Aug 1998 20:29:49 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: DeCrypt ?
Message-Id: <35eaf2bd.91716401@news.btinternet.com>
On Sun, 30 Aug 1998 10:29:16 -0500, Yoke Lee wrote :
>Hi folks,
>
>Is there a way to decrypt a password? The perl docs did not mention
>anything about decryption, just encryption (using the crypt function).
>
>Many thanks for a quick response.
>
>
No you cannot decrypt but you can crypt an entered password and check
whether it is correct.
>Regards,
>yoke
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Mon, 31 Aug 1998 20:31:09 +0200
From: "Hr. Jochen Stenzel" <ets@egnetz.uebemc.siemens.de>
Subject: Re: DESTROY problems
Message-Id: <35EAEBED.E3A49C4A@egnetz.uebemc.siemens.de>
Hello,
> I think that what you're seeing is that, after exit is called, the special
> $? variable has the exit code. Your routine may modify this code if it
> chooses. If you don't wish to modify it by accident, you may wish to use
> local(). Hope this helps!
Yes, it did. Indeed, the DESTROY() method which is executed after exit()
calls Cwd::cwd() which sets $?. Using local($?) in DESTROY() solved the
problem. Thanks a lot!
By the way, I never knew that exit() sets $?. I found no hint in "Programming
Perl" neither in the overview of special variables nor in the description of
exit() nor in the notes about DESTROY(). Where else should I have made the
search?
Jochen
------------------------------
Date: 31 Aug 1998 20:32:13 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: even or odd
Message-Id: <6sf18d$22$1@news.NERO.NET>
In article <6seo42$r42$1@nnrp1.dejanews.com>, <birgitt@my-dejanews.com> wrote:
>In article <6sbo6n$be$1@news.smart.net>,
> hymie@lactose.smart.net (hymie!) wrote:
>> Every (integer) is an even multiple of 1, because 1 divides evenly into
>> them all with no remainder.
Whoops. Definition shift leads to incorrect result.
>> 9 is an even multiple of 3, because 3 divides into it evenly.
9 is an odd multiple of 3. It may be an "exact" multiple of 3, but in
this context something either is a multiple of something else or it is
not. Talking about "exact" is silly. That's what happens when you talk
integers.
>> On the other hand, 6.25 is a multiple of 2,
But 6.25 is not an integer, and thus cannot be even or odd.
>A non native English speaker would get confused here. I thought an even
>number is a number you can divide by 2 without a having a remainder.
It is.
>In your two examples, you use the word even with a different meaning. In
Yep, and that leads to confusion and mistakes.
>other languages you would have two different words for what you are
>describing.
So does english.
------------------------------
Date: Mon, 31 Aug 1998 20:29:51 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: GD.pm
Message-Id: <35eaf58c.92435754@news.btinternet.com>
On Mon, 31 Aug 1998 16:02:44 GMT, Elaine -HappyFunBall- Ashton wrote :
>> >Ok, I am not that good at perl, or probly unix, but her is my problem,
>> >I downloaded gd.pm, seams to be a bunch of files, I cant compile them,
>> >is there a realy simple way for me just to download a file, and stick
>> >it in the same dir as my cgi's and be able to make an image counter?
>> >
>>
>> Does "I cant compile them" mean you don't know how to compile them (in
>> which case you should read the sensibly named file README) or that you
>> dont have a compiler on your system (which is a crime that your vendor
>> ought to be shot for) or that your compiler doesnt work properly (in
>> which case you or your SysAdmin should be shot).
>>
>hey, no shooting of sysadmins here...just because it doesn't work
>'properly'
>doesn't mean that its broken. compilers are probably the one thing that
>always work on a system. users are so silly. :)
>
>from the readme.
>
> 3. To compile GD.pm on a system that supports dynamic linking:
>
> a. cd GD-1.18
> b. perl Makefile.PL
> c. make
> d. make install
>
> This will create GD.pm and copy it and its dynamically loadable
>module
> GD.so into the Perl library tree. You'll need root privileges
>to do
> the install step.
>
>do perl -v to make sure you have perl 5.003 or better.
>
>installs like buttah for me.
>
>e.
zactly But you gotta have a compiler. dont ya.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Mon, 31 Aug 1998 20:29:47 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Hats off to Tom Phoenix
Message-Id: <35eaf132.91321655@news.btinternet.com>
On Mon, 31 Aug 1998 22:27:41 +0900, Norman UNsoliciteds wrote :
>
>
>> On Mon, 31 Aug 1998 04:15:51 +0900, Norman UNsoliciteds wrote :
>> >It's possible, I have seen Abbigail's flamings interpreted as helpful yet
>> >dispassionate advice ;)
>
>(Jonathan Stowe) wrote:
>+> Oh but it is - perhaps a little concise for some tastes, given, but
>+> nonetheless "helpful yet dispassionate advice".
>But maybe the dispassionateness is a form of misanthropy: have you thought
>of that? ;^)
>
And what is wrong with misanthropy ?
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Mon, 31 Aug 1998 16:10:56 -0700
From: Pankaj Telang <pankaj.telang@infores.com>
Subject: Re: How can I run cgi in NT?
Message-Id: <35EB2D80.BCA0C71D@infores.com>
Its very simple to execute perl scripts on NT server.
If you are running IIS 4.0 you can go in the IIS administrator (Microsoft
management console) and the right click on the webserver, go to:
properties -- home directory -- configuration -- app mappings
Set the following parameters:
===============================================
extension executable path exclusions
.pl d:\perl\bin\perl.exe %s %s
===============================================
Hektor Konomi wrote:
> Hi everybody,
>
> Anybody knows how can cgi scripts written in perl be run in a NT 4
> Server running IIS? I mean, should I add anything to the scripts, like
> it's done in UNIX, or any special software is needed? Thanks in advance
> for your help.
> Best
> regards,
>
> Hektor Konomi.
------------------------------
Date: Mon, 31 Aug 1998 15:05:58 -0500
From: Grant Griffin <lame.adress@munger.com>
Subject: Re: how does one delete a file with Perl?
Message-Id: <35EB0226.E8E5BC6A@munger.com>
Jonathan A. Laub wrote:
> is there a "delete" file command in Perl?
Use the "unlink" function, or use your operating system command via the
"system" function.
=g2
------------------------------
Date: 31 Aug 1998 20:47:18 GMT
From: snow@biostat.washington.edu (Gregory Snow)
Subject: Re: Imagine... a non-greedy world!
Message-Id: <6sf24m$14dq$1@nntp6.u.washington.edu>
In article <sh9ds6.b7v.ln@metronet.com>,
Tad McClellan <tadmc@metronet.com> wrote:
>Mee (mee@mine.com) wrote:
>
>
>: There is absolutely nothing in any theory that
>: sez that regex must be greedy, or that one
>: character (eg: ^) must mean different things in
>: different contexts, or ... I could go on forever.
>
>
>If operators are restricted to a single character regardless
>of context, then we are not allowed to have very many contexts
>(given that ASCII is all we have)...
Well we could combine Perl with APL, no wait, those weird charecters
still have different meanings when used as unitary or binary
operators. I guess were stuck with how perl does things (which is
good, I've forgotten most of my APL).
>
>
>--
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
------------------------------
Date: Mon, 31 Aug 1998 16:01:49 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <35EB0F3D.6B9A4721@gpu.srv.ualberta.ca>
Mee wrote:
>
> Michael,
>
> Your explanation would make sense if '*?' was
> considered as one quantifier by Perl, but they
> sure look like two to me.
>
> Perl seems to agree by merrily accepting '*'
> alone as a quantifier.
hmmm, and I suppose you have problems with
42 being one number ... sure looks like two
numbers to me.
Perl seems to agree by merrily accepting 4 alone
as a number.
'*' is one quantifier (happens to be one character)
'?' is one quantifier (happens to be one character)
'*?' is one quantifier (happens to be two characters)
does that help your understanding at all?
regards
andrew
------------------------------
Date: Mon, 31 Aug 1998 21:19:58 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <2sEG1.139$kv1.2127836@news.shore.net>
Mee <mee@mine.com> wrote:
: So far so good:
: Everyone has noted a typo in the contrived example
: but noone has understood the question.
And the multiple followups that described how to make regexes non-greedy
misunderstood the question how exactly??
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Mon, 31 Aug 1998 21:27:39 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <fzEG1.141$kv1.2127836@news.shore.net>
Mee <mee@mine.com> wrote:
: Are you trying to tell us with this evasive maneuver
: that you have nothing better to say?
I was just about to ask you the same question!
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: 31 Aug 1998 15:10:41 -0500
From: awdorrin@mail.delcoelect.com (Albert W. Dorrington)
Subject: Re: Perl compiler
Message-Id: <6sf001$gk1@ws051eng.ictest.delcoelect.com>
In article <fl_aggie-2708981804460001@aggie.coaps.fsu.edu>, fl_aggie@thepentagon.com (I R A Aggie) writes:
:> In article <6s47h6$4s4@ws051eng.ictest.delcoelect.com>,
:> awdorrin@mail.delcoelect.com (Albert W. Dorrington) wrote:
:>
:> + Oh give me a break! There are many valid reasons for wanting
:> + to keep source code hidden from users.
:> +
:> + Most of the reasons I can think of off the top of my head
:> + deal with security issues or support.
:>
:> Ah, security by obscurity.
:>
Yes, it could be thought of that way, so care to
explain why that is a bad thing? Or ar you just trying to
stir things up?
- Al
--
Al Dorrington
FIRMS & Web Admin, Oracle DBA Phone: 765-451-9655
IC-DELCO CIM, Delphi Delco Electronics Systems Fax: 765-451-8230
------------------------------
Date: Mon, 31 Aug 1998 19:27:38 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Perl Cookbook, does anyone have it?
Message-Id: <6setfa$366$1@nnrp1.dejanews.com>
In article <6sc884$me9@gpc.gpc.peachnet.edu>,
mdennist@dekalb.dc.peachnet.edu (Michael L Denniston,CD108C SCIE,299-4097,3)
[snip]
>
> I ordered a copy from Amazon last week; they are knocking a few bucks off
> the $39.95 [US] price. As of that point, it was back ordered, but there
> must be lots of interest; it was #256 on their best seller list.
[snip]
I ordered mine from Amazon last Friday (8/28/98), it shipped Saturday,
I should be getting it today or tomorrow. I'm *very* happy about this.
Sometime early last week, it was in the double-digits on the best
seller list (50-something or 60-something, if I recall). It's selling
like hot-potatoes, or sliced bread, or whatever that thing is that sells
really well.
Patrick Timmins
U. Nebraska Medical Center
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 31 Aug 1998 15:02:54 -0500
From: Grant Griffin <lame.adress@munger.com>
To: Jules <julius@clara.net>
Subject: Re: PERL is horrible
Message-Id: <35EB016E.467E8993@munger.com>
Jules wrote:
> Dear all, I'm a newbie in perl and I find it absolutely terrifying. I know C++ and Java, but never
> done any scripting language (well, err, unix shell scripts don't count right?) and perl doesn't give
> me a good impression as one......
>
> I'm struggling to understand Larry Wall and the lot, on the camel book Programming Perl published by
> O'Reilly. Is there any other "dummy" or "die unless $jules =~ s/java_mind/perl_mind/g" book on Perl
> which is good? I think I will need that. =(
Jules,
Don't get confused on the source of the horribility. I strongly recommend you start with "Learning
Perl" rather than "Programming Perl". (I had made exactly the same mistake as you.) There probably are
other good tutorial books out there as well.
However, you haven't wasted your money: you probably eventually would have had to buy "Programming Perl"
anyway (if you stick with Perl). Despite its inviting title, that book is more of a reference manual
than a true tutorial: it is quite comprehensive, and much of it is written as though the reader already
understands the material it presents (perhaps not intentionally). If you continue to use Perl, you will
need "Programming Perl" which is the Perl reference manual, in book form.
In particular, stay away from the "Programming Perl" chapter on "Regular Expressions". Rather than a
tutorial, it is written like a sofware design document. The subject of RE's is probably the most
foreign single thing to many C++ and Java programmers. On the net, I found a good tutorial on the
difficult subject of RE's, which explained them far better than "Programming Perl" (sorry, but I forget
the URL: anybody know?); it was a "teaser" chapter from what looked to be a very good book, and it was
written in a very clear, step-by-step way. Look hard elsewhere for material on RE's, then maybe come
back to "Programming Perl" as a reference after you already understand them.
As an editorial: some of the famous Perl "geniuses" are so "brilliant" that they seem unable to come
down to the level of a newbie in order that they might communicate effectively with him. However, that
is not the newbie's fault -- despite what these "geniuses" will shortly tell you. But likewise, program
bugs aren't the user's fault -- despite what the "genius" who wrote the program may tell you. Genius
Heal Thyself.
yours in bits,
=g2
"Genius Heal Thyself" -- Grant Griffin, posting on comp.lang.perl.misc
------------------------------
Date: Mon, 31 Aug 1998 21:08:41 GMT
From: wtm001@anadarko.com (Will Morse)
Subject: perl program for inews
Message-Id: <EyKo2H.EME@anadarko.com>
Hi,
Due to our often buggy news connection, I am thinking
of making some changes. I got trn to use instead of
rtin, but for some reason it doesn't have an inews
program (called via Pnews). Well, I looked at some
inews programs, but it seems to me that since we have
an inews program running on a server and all I want
is the client sides (the server is a SCO box and the
clients are Solaris and IRIX) that maybe I could write
something in perl.
So I know a few things,
>From what I can see, I need to connect with a socket
to nntp (119) to my news server, which is a system
in my Company but owned and operated by a different
department and (probably) pretty much out of my
ability to change.
I can do that (write a perl socket program) thanks
to having written an lpr transfer program (BTW, I
have sent thank you's to most people who sent advice,
but anyone I missed, thanks).
I am going to have to check some headers, although
trn seems to supply a lot of that anyway.
I found rfc 977, which cover Network News Transfer
Protocol, but I am a little unsure if I need that
between my clients and server, or if that is just
between my server and the wild and wide.
I also have rfc 850, which cover standard for
Interchange of Usenet Messages, Same questions as
for rfc 977.
Anyway, If anyone has done this sort of thing
and/or has any suggestions or advice, I would
appreciate it.
Will
--
Will Morse | This is a statement of opinion
| even if stated as a fact.
Gravity |
Not just a good idea | Copyright 1998, Will Morse
It's the law | Okay to quote/archive on internet.
| Newsmedia quoting requires permission.
------------------------------
Date: Mon, 31 Aug 1998 10:46:53 -0700
From: Ben Wallach <benwallach@loop.com>
Subject: ReadParse/newline character ??
Message-Id: <35EAE18D.26D1FC53@loop.com>
I am reading in a string (key/value pair) from a web page into my perl
script. I need to print this string to a file. The string has a newline
character in it ("\n") that needs to be reflected when it is printed to
the file.
PROBLEM: The newline character is being interpreted literally.
EXAMPLE: "This is my\ntest string"
After ReadParse reads string and string is printed to file:
This is my\ntest string
WHAT I WANT :
This is my
test string
Somehow I need the readParse function to understand that "\n" means
newline and not '\' and then 'n' ????
Thanks in advance for any assistance you can provide
Ben Wallach
benwallach@loop.com
------------------------------
Date: Mon, 31 Aug 1998 20:29:57 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: SSI problem
Message-Id: <35eb05b4.96571771@news.btinternet.com>
On Mon, 31 Aug 1998 11:40:57 -0400, DesQuite wrote :
>I insert this code into my test.shtml file
><!--#exec cgi="/cgi-bin/filename.cgi"-->
>
>and then receive this error when I open the file in my browser
>HTTP/1.1 200 OK Date: Mon, 31 Aug 1998 15:25:13 GMT Server:
>Microsoft-IIS/4.0 Content-type: text/html 'D:\***\***\***\test.shtml script
>produced no output
>
>Yes, it's a stupid NT sever, but I don't have any control over that. Am I
>just making a stupid mistake or is there something I can try to run this
>script? The script will run fine when it's run by itself in the browser.
>Thanks.
>
>
<paste from earlier response>
When something works fine from the command line but fails to do so in
some other environment (such as CGI,cron etc etc) that is a sure sign
that this is not a Perl problem but is entirely due to the differences
in the runtime environment which would effect a program written in any
language. The question would be most appropriately asked in a
newsgroup related to the environment to which you have submitted your
program.
Things to look out for however might include: the rights of the user
that runs the program to any resources the program might require;
Environmental information that is not available in the environment
that the program is run in; the method of output used by the program.
</paste>
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 31 Aug 1998 19:30:05 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: unlinking file if <= 1 hour
Message-Id: <6setjt$r52$2@msunews.cl.msu.edu>
dow.jones@home.se wrote:
Thank you so much for posting this twice.
: How do I unlink all files that is more than 1 hour old (creation or updated
: does not matter) from a directory?
So how. Simple. Figure out the time. Add an hour to that then go
through all the files in the directory and get the date and unlink the
ones you don't want.
-dan
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: Mon, 31 Aug 1998 13:42:25 -0600
From: Ed Henderson <evhendrs@micron.net>
Subject: Re: unlinking file if <= 1 hour
Message-Id: <35EAFCA0.908B1513@micron.net>
dow.jones@home.se wrote:
> Hi,
>
> How do I unlink all files that is more than 1 hour old (creation or updated
> does not matter) from a directory?
>
> // Daniel
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
If all the files are in a single directory, this will work:
my $expiration_time = 1 # Time in hours;
# $path set to path where target file(s) exist.
unlink grep { (time - (stat )[9]) > 60*60*$expiration_time } <$path/*>;
------------------------------
Date: Mon, 31 Aug 1998 13:23:43 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: unlinking file if <= 1 hour
Message-Id: <MPG.1054a62539832fc998977e@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <6setjt$r52$2@msunews.cl.msu.edu> on 31 Aug 1998 19:30:05 GMT,
Dan Nguyen <nguyend7@msu.edu> says...
> dow.jones@home.se wrote:
> : How do I unlink all files that is more than 1 hour old (creation or updated
> : does not matter) from a directory?
>
> So how. Simple. Figure out the time. Add an hour to that then go
> through all the files in the directory and get the date and unlink the
> ones you don't want.
It is simpler than that, because the -A -C -M operators give you the time
(in days) elapsed since the file was accessed, created-or-inode-changed,
or modified.
opendir DIR, $dir or die "Couldn't open $dir. $!\n";
unlink grep -f "$dir/$_" && -M _ > 1/24 => readdir DIR
or die "Couldn't unlink files. $!\n";
closedir DIR;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 31 Aug 1998 20:29:53 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Using password with sybperl
Message-Id: <35eaf7ba.92994286@news.btinternet.com>
On 31 Aug 1998 16:27:32 GMT, Abigail wrote :
>Jonathan Stowe (Gellyfish@btinternet.com) wrote on MDCCCXXVI September
>MCMXCIII in <URL: news:35ea8248.63000457@news.btinternet.com>:
>++ On Mon, 31 Aug 1998 10:44:28 +0200, Geert Roovers wrote :
>++
>++ <snip>
>++ >
>++ >i take it that I have to put my userId and password in the script. Is
>++ >this a safe thing to do? I'd think of it as a security risk (anybody
>++ >with access to the script's source code will know my password), but
>++ >wouldn't know how to avoid this. Any suggestions?
>++ >
>++
>++ This kind of thing has been done to death in recent weeks I'm afraid -
>++ quick search of this group for "password" in DejaNews will throw up
>++ more discussion than you will care to read. However a couple of
>++ suggestions:
>++
>++ A) Put the login information in a file that is only readable by you
>++ (or whoever will run the script) and possibly refuse to run the
>++ program if the permissions are otherwise.
>
>That doesn't add anything over storing the passwords in the source
>of the program - you can as easily make the script only readable
>by whoever runs the script.
>
>In fact, this is exactly why there are file permissions on Unix.
>
Precisely, I can create a file with 0600 permissions which no-one
except myself or root can read then that is sorted - is'nt it ?
I have been using NCPFS on linux for a while now and that uses such a
scheme. ncpmount will refuse to run if .nwclient is readable by the
world.
It doesnt matter if the person who runs the script can see their own
password - it does matter if someone else can see the password though.
You know as well as I do that the Unix permissions are possibly
subject to compromise - but hey then the system just aint as secure as
we'd like it to be.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 31 Aug 1998 19:40:18 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: wondering when people post here?
Message-Id: <6seu72$60v$2@info.uah.edu>
Check out <URL:http://www.cs.uah.edu/~gbacon/clpmisc/>.
Greg
--
Arrogance is bliss.
-- Elizabeth L. Kaminsky
------------------------------
Date: Mon, 31 Aug 1998 20:18:56 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Y2K Date Support
Message-Id: <6sf0ff$72q$1@nnrp1.dejanews.com>
In article <6seh8m$d6k$1@client3.news.psi.net>,
abigail@fnx.com wrote:
[snip]
> It isn't.
In the words of Judy Tenuta, the Earth Mother Love Goddess of comedy:
"You cannot possess me! No! No! No!"
I have The Perl Cookbook to do that!
and also from the Love Goddess (quoting Glinda, the good witch from Oz):
"You have no power here! Be gone!"
Patrick Timmins
U. Nebraska Medical Center
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 31 Aug 1998 20:29:56 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Yet another RegX Question.
Message-Id: <35eb00a1.95272575@news.btinternet.com>
On Mon, 31 Aug 1998 07:42:52 -0700, Larry Rosler wrote :
[Posted and mailed but further explication mailed]
>[Posted to comp.lang.perl.misc and copy mailed.]
>
>In article <6se99l$8ea$1@nnrp1.dejanews.com> on Mon, 31 Aug 1998 13:43:17
>GMT, chad@gurucom.net <chad@gurucom.net> says...
>...
>> (@cats) = $content =~ /<li><a href="^(http|news)(.*?)"><b>/ig;
>
> (@cats) = $content =~ /<li><a href="(?:http|news)(.*?)"><b>/ig;
>
>The '?:' asks that the contents of the binding parentheses *not* be saved
>in the result from executing the regex. I took out the '^' because I
>doubt that you really want to match a literal '^' at that point.
Larry,Larry what have you done ? cant you see that this muvva is a
spam-meister: after you lose http: and news: you are basically left
with mailto: and what does that say to us ? they aint interested
about telnet: or gopher: stuff.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Mon, 31 Aug 1998 13:48:17 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Yet another RegX Question.
Message-Id: <MPG.1054abe9abd088bd98977f@nntp.hpl.hp.com>
In article <35eb00a1.95272575@news.btinternet.com> on Mon, 31 Aug 1998
20:29:56 GMT, Jonathan Stowe <Gellyfish@btinternet.com> says...
> On Mon, 31 Aug 1998 07:42:52 -0700, Larry Rosler wrote :
> >In article <6se99l$8ea$1@nnrp1.dejanews.com> on Mon, 31 Aug 1998 13:43:17
> >GMT, chad@gurucom.net <chad@gurucom.net> says...
> >...
> >> (@cats) = $content =~ /<li><a href="^(http|news)(.*?)"><b>/ig;
> >
> > (@cats) = $content =~ /<li><a href="(?:http|news)(.*?)"><b>/ig;
> >
> >The '?:' asks that the contents of the binding parentheses *not* be saved
> >in the result from executing the regex. I took out the '^' because I
> >doubt that you really want to match a literal '^' at that point.
>
> Larry,Larry what have you done ? cant you see that this muvva is a
> spam-meister: after you lose http: and news: you are basically left
> with mailto: and what does that say to us ? they aint interested
> about telnet: or gopher: stuff.
a. I misread his intent. Notice that I took out the '^' that he
intended to mean 'not'. In private correspondence, I actually gave him
the proper negative look-ahead assertion that he needed to filter these
protocols away.
b. Even if I had, I tend not to try to divine the ulterior motives
behind these questions. Just naive, I guess.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3599
**************************************