[10136] in Perl-Users-Digest
Perl-Users Digest, Issue: 3729 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 16 15:07:56 1998
Date: Wed, 16 Sep 98 12:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 16 Sep 1998 Volume: 8 Number: 3729
Today's topics:
Re: A Better PERL for Mac? (John Moreno)
Re: assigning file contents to a string <JKRY3025@comenius.ms.mff.cuni.cz>
Re: Can I foreach multiple arrays? <ckuskie@cadence.com>
Re: Diff between two text files <upsetter@ziplink.net>
Re: Diff between two text files (Mark-Jason Dominus)
Re: How can I execute an external program from Perl wit (Jacqui Caren) (Jacqui Caren)
Re: how safe is xor encryption ? (Abigail)
Re: how safe is xor encryption ? (Mark-Jason Dominus)
Re: how safe is xor encryption ? (Mark-Jason Dominus)
Re: how safe is xor encryption ? <eashton@bbnplanet.com>
Re: how safe is xor encryption ? (Mark-Jason Dominus)
Re: Interogating a script for its methods (Kevin Reid)
Re: Is there any FAQ? (Doran L. Barton)
Re: MD5 or SHA as Perl functions? (Mike Elness)
Re: Open directory in perl (Doran L. Barton)
Perl and Unidata or ODBC (Andy Squires)
Re: Printing large numbers with commas (Jacqui Caren) (Jacqui Caren)
Probability modules for Perl? <dgordon@micron.com>
Re: Problems with File::Path <JKRY3025@comenius.ms.mff.cuni.cz>
Recursing through a directory and adding it to an array (Matt Goddard)
Re: Recursing through a directory and adding it to an a <zenin@bawdycaste.org>
Re: Saving an Array or Hash into a $Session Variable in (Kevin Reid)
Re: Who posts original posts on CLPM? <adams4@worldnet.att.net>
Y2K date in Perl <mspring@nortel.com>
Re: Y2K date in Perl <jeffp@crusoe.net>
Re: Y2K date in Perl <che@debian.org>
Re: Y2K date in Perl (Michael J Gebis)
Re: Y2K date in Perl (Mark-Jason Dominus)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 16 Sep 1998 14:51:26 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: A Better PERL for Mac?
Message-Id: <1dfg9xk.1vrfdqy1dfawnwN@roxboro0-020.dyn.interpath.net>
brian d foy <comdog@computerdog.com> wrote:
> dejah@DejahsPrivateIce.com posted:
>
> >I am currently using MacPERL for my interpreter... is there another one
> >out there for the Macintosh? Maybe a better one? One that might actually
> >*find* the stray ( or { instead of just telling me that i have 1 more
> >OPEN than LEAVE and 66 more saves than restores? oh ak! at this point,
> >i'd even pay money for it.
>
> the program
>
> #/usr/bin/perl
>
> {
>
> print 'just another new york perl hacker';
>
> __END__
>
> gives me the output
>
> # Missing right bracket, at end of line
> File '<AppleEvent>'; Line 5
> # syntax error, at EOF
> File '<AppleEvent>'; Line 5
> # Execution of <AppleEvent> aborted due to compilation errors.
Hmn... Doing that get's ME:
# Missing right bracket, at end of line
File 'Untitled'; Line 7
# syntax error, at EOF
File 'Untitled'; Line 7
# Execution of Untitled aborted due to compilation errors.
What version are you using?
> once you get use to the Mac port, everything should be okay. there are a
> lot of tools for working with MacPerl with editors such as BBEdit and
> Alpha which would make your life a bit easier as well.
Absolutely - BBEdit does just fine for tracking down the unalanced ( or
{.
--
John Moreno
------------------------------
Date: Wed, 16 Sep 1998 20:15:31 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: assigning file contents to a string
Message-Id: <36007ED3.65B0@comenius.ms.mff.cuni.cz>
avern@hotmail.com wrote:
>
> I know this is a very newbie-ish question, but I've already checked the FAQ.
> Does any know a very concise way (say, 1 line) to assign the contents of a
> file to a string variable? I've seen instructions on processing a file
> line-by-line or paragraph-by-paragraph, but I don't want to manipulate the
> file contents in any way. I just want to store the entire file in a
> variable, so that I can later refer to the variable in a print statement.
> Can this be done without creating a sub-procedure?
>
> Thanks in advance,
> Avern
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
Strange that nobody sugested this:
open IN, "<$file" and read IN, $string, -s $file;
or maybe
open IN, "<$file" and read IN, $string, -s $file or $string = "";
If you want to make sure the variable is defined to suppress warnings.
;-)
Jenda
------------------------------
Date: Wed, 16 Sep 1998 09:58:36 -0700
From: Colin Kuskie <ckuskie@cadence.com>
Subject: Re: Can I foreach multiple arrays?
Message-Id: <Pine.GSO.3.96.980916095515.20066A-100000@pdxue150.cadence.com>
On 15 Sep 1998, Abigail wrote:
> Tom Christiansen (tchrist@mox.perl.com) wrote on MDCCCXLI September
> MCMXCIII in <URL: news:6tmlgd$hbp$2@csnews.cs.colorado.edu>:
> ++
> ++ Destructively:
> ++
> ++ while (($foo, $bar) = (shift @foos, shift @bars)) { }
>
> That will never terminate. (undef, undef) is *TRUE*.
How about:
while ($foo = shift @foos and $bar = shift @bars) { }
Colin
------------------------------
Date: Wed, 16 Sep 1998 17:05:41 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Diff between two text files
Message-Id: <FdSL1.18$_c5.188882@news.shore.net>
Srikanth Natarajan <nkanth@cnd.hp.com> wrote:
: Hi
: Is there a way to compare two text files for differences in
: Perl
: I need to write code which works on both NT and UNIX
I believe there was a thread recently about writing a perl-based diff.
Check www.dejanews.com.
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: 16 Sep 1998 14:26:25 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Diff between two text files
Message-Id: <6tovsh$5rk$1@monet.op.net>
In article <35FFE5DA.17E29064@cnd.hp.com>,
Srikanth Natarajan <nkanth@cnd.hp.com> wrote:
>Is there a way to compare two text files for differences in Perl
http://www.plover.com/~mjd/perl/diff/
------------------------------
Date: Wed, 16 Sep 1998 17:17:49 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui Caren) (Jacqui Caren)
Subject: Re: How can I execute an external program from Perl with parameters?
Message-Id: <EzE01q.JIp@ig.co.uk>
In article <MPG.103e76c11675a38989699@news.scescape.net>,
Matthew Bafford <dragons@scescape.net> wrote:
>In article <35D497C7.1F5F93A2@nextel.no> on Fri, 14 Aug 1998
>22:02:15 +0200, Xyvind Bangsund (a) felt the following
>information to be of use:
>> Like:
>>
>> $output = `externalprogram.exe parameters`;
>> print $output;
>>
>> ???
>
>What's wrong with the example you gave?
There is the issue of error handling...
>Works fine on both Win32 & Linux over here...
What happens when the program is not on the PATH
or fails to execute, or returns an error instead
of output?
For "Another Way To Do It"(tm) try something along the
lines of
my $cmd = 'externalprogram.exe parameters'
open(F,"$cmd|") || die "open $cmd $!";
my $result = join '', <F>;
close F || die "close $cmd $!";
Jacqui
--
Email: Jacqui.Caren@ig.co.uk http://www.ig.co.uk/
Fax : +44 1483 419 419 http://www.perlclinic.com/
Phone: +44 1483 424 424 http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom
------------------------------
Date: 16 Sep 1998 17:43:08 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: how safe is xor encryption ?
Message-Id: <6totbc$fb7$1@client3.news.psi.net>
Mark-Jason Dominus (mjd@op.net) wrote on MDCCCXLII September MCMXCIII in
<URL: news:6tom8m$4fp$1@monet.op.net>:
++ In article <35FFB32E.6F33@gecm.com>, Jim Michael <jim.michael@gecm.com> wrote:
++
++ >However, CC#s have a common beginning number sequence which
++ >identifies the CC type (MC, Visa, etc.), do they not?
++
++ Yes, but I think it's only one digit long. Perhaps someone can confirm?
It wouldn't matter as it won't gain any additional information.
++ In any event, stronger encryption is probably more useful here.
Xorring with a key as long as the message is the strongest encryption
possible. Without the key, it's unbreakable; after all, for any given
encrypted CC#, there is a key that maps it to whatever CC# you want.
In fact, I can give you a random line of characters of appropriate
length, and only later worry what the key is. After all, the following
relations hold:
# $cc: Credit card number
# $enc: Encrypted credit card number
# $key: Key.
$enc = $cc ^ $key;
$cc = $enc ^ $key;
$key = $cc ^ $enc;
++ >> 2. A cracker who has gotten into the database has probably also gotten
++ >> into your source code.
++ >
++ >Or your keys.
++
++ Yes, a malevolent person on your machine probably has several paths
++ of access to the information.
++
++ Encrypting the numbers in the database, and transmitting only the
++ decryption key, rather than the actual number, seems prudent to me.
++ Is there some problem I'm overlooking?
If your database is potentially insecure, how secure are your transmission
lines? And since storing the encrypted CC# gives no benefit to the person
storing the CC#, wouldn't it be better not to store the CC# at all,
and use something like RSA to transmit the CC# when ever it's needed?
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
------------------------------
Date: 16 Sep 1998 14:07:20 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: how safe is xor encryption ?
Message-Id: <6touoo$5j0$1@monet.op.net>
In article <6tonjc$bcg$1@client3.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
>However, what do you gain by encrypting each CC# with a different key?
>Instead of stealing the CC#, all they have to do is steal the CC#, key
>combo. A task which isn't significantly harder than just stealing the
>CC#. Unless you somehow have a way to store keys in a more secure way
>than CC#.
You store the encrypted CC#s on the disk. The customer knows the key.
When they want to authorize a purchase, they transmit you the key.
If the key is intercepted, it is not very useful to the snooper. They
can use it to authorize purchases from you, but not from anyone else.
If the entire database is stolen, it is not useful to the thief
without a database of decryption keys, and no such database exists.
You need both items, the encrypted CC# and the key, to get a real CC#.
Each item is useless by itself, and the two items are not stored in
the same place, so the arrangement is more secure than just storing
the unencrypted numebrs on the disk.
Someone might conceivably steal the entire database of encrypted
numbers, and then spend time snooping the keys from the network, but
that is still a better outcome than if they stole an entire database
of unencrypted numbers.
I still think `xor' is probably a poor choice.
------------------------------
Date: 16 Sep 1998 14:23:55 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: how safe is xor encryption ?
Message-Id: <6tovnr$5pb$1@monet.op.net>
In article <6toodk$lnb@mozo.cc.purdue.edu>,
Michael J Gebis <gebis@fee.ecn.purdue.edu> wrote:
>It appears to me that your method is vulnerable (at least) to a
>dictionary attack.
I don't think it is. Let's make it easy on you: I give you a list of
25,000 words, and I guarantee that one of these words is the key
phrase.
If you were trying to decrypt a message, you would try every word in
the list, and get 24,999 gibberish messages and one message that was
obviously correct. But you are not trying to decrypt a messaage; you
are trying to decrypt a 53-bit number. So the result of your brute
force search is a list of 25,000 random-looking numbers. Even if you
can throw away 97% of them because they have the wrong form for credit
card numbers (Wrong check digit, fail to begin with 3, 4, 5, or 6,
etc.) you still have 750 random numbers, only one of which is
actually a valid credit card number.
What are you going to do now? Call up the Eddie Bauer order line to
make a few fraudulent purchases, and read them numbers from your list
of 750 until you hit the one that works? The Eddie Bauer folks will
get tired of that pretty qucikly, and so will you. There are easier
ways to make a living.
If the customer-selected key phrases have at least 53 bits of entropy,
then a brute force search will fail utterly. A CC# is about 53 bits
long, so with a 53-bit key phrase you are doing one-time pad, and the
result of your brute-force search is nothing more than a list of every
possible credit card number.
------------------------------
Date: Wed, 16 Sep 1998 18:27:40 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: how safe is xor encryption ?
Message-Id: <360000B8.259600FD@bbnplanet.com>
Mark-Jason Dominus wrote:
> If the key is intercepted, it is not very useful to the snooper. They
> can use it to authorize purchases from you, but not from anyone else.
How so? If I can get the key, I can get the CC# and then I can make
purchases anywhere I want.
> If the entire database is stolen, it is not useful to the thief
> without a database of decryption keys, and no such database exists.
You presume that the key length is sufficient to render the decryption
impractical or impossible. Also, too, that the customer has chosen a
totally random key which, in my experience at least, is all too rare an
occurance.
> You need both items, the encrypted CC# and the key, to get a real CC#.
> Each item is useless by itself, and the two items are not stored in
> the same place, so the arrangement is more secure than just storing
> the unencrypted numebrs on the disk.
If I could get one, I'm sure I could get the other. It's not rocket
science.
> Someone might conceivably steal the entire database of encrypted
> numbers, and then spend time snooping the keys from the network, but
> that is still a better outcome than if they stole an entire database
> of unencrypted numbers.
True, though I have seen it done before. Encryption is not an answer to
security though it is a good step.
> I still think `xor' is probably a poor choice.
It is better than nothing, however, it is not a complete solution to the
problem. If e-commerce is to survive and thrive people must have
confidence that their cards are protected. I shop a lot on-line and have
had the one card I use for such purposes replaced 2 or 3 times due to
the number being stolen.
e.
"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon." R. Carver
------------------------------
Date: 16 Sep 1998 14:42:32 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: how safe is xor encryption ?
Message-Id: <6tp0qo$61r$1@monet.op.net>
In article <6totbc$fb7$1@client3.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
>Xorring with a key as long as the message is the strongest encryption
>possible.
Yes, but it's not clear that you can trust the user to select a 53-bit key.
In the absence of such a guarantee, there might be attacks other than
simple brute force that would be moer successful against xor than
against some other method.
>++ Encrypting the numbers in the database, and transmitting only the
>++ decryption key, rather than the actual number, seems prudent to me.
>++ Is there some problem I'm overlooking?
>
>
>If your database is potentially insecure, how secure are your transmission
>lines?
Comparing the relative security of two unrelated entities is silly.
The database might be compromised. The transmission lines might be
compromised. Just because one is compromised does not mean you have
to give up on the other one. It would be like saying `If your front
door lock is insecure, how secure is your burglar alarm?'
It is prudent to try to plan on redundancy in your security
mechanisms, so that if one or ther other is compromised, the damages
are as small as possible. That is why bank safe deposit boxes have
two locks.
>And since storing the encrypted CC# gives no benefit to the person
>storing the CC#,
Sure it does. Customers are sending them decryption keys, which they
can use to decrypt the real numbers. When the transaction is over,
decrypted numbers and keys are both discarded.
------------------------------
Date: Wed, 16 Sep 1998 13:14:04 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Interogating a script for its methods
Message-Id: <1dfg2jc.uqsxhj12pdsjkN@slip166-72-108-234.ny.us.ibm.net>
Aravind Subramanian <aravind@genome.wi.mit.edu> wrote:
> In some_module_method I can figure out the name of the calling *script*
> and the name of the calling *method* within it by checking caller().
> My question is: Is there a way (without parsing) to get a list of the
> names of ALL methods in the calling script?
#!perl -w
package A;
sub A {
warn "A::A called";
}
sub B {
B::A();
}
$C = 1;
$C++;
package B;
sub A {
$callpack = caller;
# Simply check the existence of a subroutine:
if (defined *{$callpack . '::A'}{CODE}) {
print "${callpack}::A exists.\n";
&{$callpack . '::A'};
}
# Print subroutine list:
while (($key, $value) = each %{$callpack . '::'}) {
if (defined *$value{CODE}) {
print "Subroutine: ${callpack}::$key\n";
}
}
}
sub B {
# do something
}
package main;
A::B();
__END__
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: 16 Sep 1998 11:02:32 -0600
From: fozz@xmission.xmission.com (Doran L. Barton)
Subject: Re: Is there any FAQ?
Message-Id: <6toqv8$qc1$1@xmission.xmission.com>
"Hansi Hinterseer" <elchmann@hotmail.com> writes:
>Hi!
>I wondered if there is a FAQ about Perl or the NGs. Is there? Or any
>recommended tutorials?
It's tempting not to even respond to this because it seems obvious you
haven't looked very hard.
If you have perl installed on a system, you should be able to type
'perldoc perlfaq' and get everything you need. Otherwise, go to the Perl
homepage (www.perl.com) and find the documentation there.
-=Fozz
--
Doran L. Barton = fozz@xmission.com && http://www.xmission.com/~fozz/;
"Where do you want Microsoft to go today?" --Ron Barry <ronb@cc.usu.edu>
"This may seem a bit weird, but that's okay, because it is weird."
-- Larry Wall <lwall@sems.com> in the Perl v5 man page
------------------------------
Date: Wed, 16 Sep 1998 10:40:45 -0700
From: mike.elness@lmco.com (Mike Elness)
Subject: Re: MD5 or SHA as Perl functions?
Message-Id: <mike.elness-1609981040450001@stealthmac.lmms.lmco.com>
In article <comdog-ya02408000R1609981239400001@news.panix.com>,
comdog@computerdog.com (brian d foy) wrote:
>
> what's wrong with just using the modules? if you don't like the
> interface provided by the module, write a subroutine to act as
> a wrapper.
Brian,
The reason I can't use the modules is that I can't build them. I want to
use a message digest function to protect cookies from end-user alteration
in a web-based application. The web-based app is comprised of Perl CGI
scripts, but it is deployed on the web server of an ISP who does not even
allow a shell login, much less access to developer tools for building
stuff.
That's why I'm asking if anyone's gone through the pain of coding either
MD5 or SHA in straight Perl code.
Thanks,
Mike Elness
Lockheed Martin Enterprise Information Systems
Sunnyvale, CA
mike.elness@lmco.com
------------------------------
Date: 16 Sep 1998 10:58:45 -0600
From: fozz@xmission.xmission.com (Doran L. Barton)
Subject: Re: Open directory in perl
Message-Id: <6toqo5$p9d$1@xmission.xmission.com>
cedilnik andrej <andy@here.ml.org> writes:
>Hi!
>I have directory full of .dat files. Now I would like to open each file
>and check first line to see if it match and what it is.
>How do I open directory?
opendir DH, "/dir/to/open" or die "Could not open directory";
@dirents = readdir DH;
closedir DH;
Now @dirents is a list of all the files in the directory. To process each:
foreach $file (@dirents) {
open FILE, "</dir/to/open/$file" or die "Could not open $file";
$first_line = <FILE>;
if($first_line eq "what we want") {
do_something();
}
close FILE;
}
Enjoy yourself.
-=Fozz
--
Doran L. Barton = fozz@xmission.com && http://www.xmission.com/~fozz/;
"Where do you want Microsoft to go today?" --Ron Barry <ronb@cc.usu.edu>
"This may seem a bit weird, but that's okay, because it is weird."
-- Larry Wall <lwall@sems.com> in the Perl v5 man page
------------------------------
Date: Wed, 16 Sep 1998 18:07:17 GMT
From: asquires@netcom.com (Andy Squires)
Subject: Perl and Unidata or ODBC
Message-Id: <asquiresEzE2C5.Jow@netcom.com>
We have a Unidata database running on AIX and we want to be able to access
the data for use on the Web. We used to do this with Sybase and Sybperl,
but Sybase is no longer an option. Has anyone ever used Perl to access
Unidata? Is there a way of using Perl with ODBC on AIX to get to the data?
Any ideas?
Thanks, Andy
--
| Andy Squires "The trouble with life is
| asquires@netcom.com there's no background music."
| Web Page is at http://www.announce.com/~asquires/andy.html
------------------------------
Date: Wed, 16 Sep 1998 17:08:35 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui Caren) (Jacqui Caren)
Subject: Re: Printing large numbers with commas
Message-Id: <EzDzMC.JEM@ig.co.uk>
In article <35D4B10F.39D9@min.net>, John Porter <jdporter@min.net> wrote:
>Tom Phoenix wrote:
>> On Fri, 14 Aug 1998 heinrich7486@my-dejanews.com wrote:
>> > Subject: Printing large numbers with commas
>> FAQ.
>I sense the robot's patience is finally beginning
>to wear thin...
I see this as the difference between abusive and terse
responses.
To call someone a robot is (possibly) abusive. I know
I would not appreciate being refered to in this manner.
OTOH, 'FAQ' can only be described as terse :-)
IMHO a URL to the relevant FAQ entry (without
even mentioning that it is an FAQ) may have been
better - as newbies seem to hate FAQs in the same
manner that cats hate hosepipes [1].
Jacqui Caren
[1] The local cats tease[2] our dogs until I let the
dogs out or "get them" with the hosepipe.
[2] They sit right outside the gate and try and
outstare two 7/8 stone [3] german shepherds.
[3] No they are not overweight!
--
Email: Jacqui.Caren@ig.co.uk http://www.ig.co.uk/
Fax : +44 1483 419 419 http://www.perlclinic.com/
Phone: +44 1483 424 424 http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom
------------------------------
Date: Wed, 16 Sep 1998 11:00:30 -0600
From: Dave Gordon <dgordon@micron.com>
Subject: Probability modules for Perl?
Message-Id: <35FFEEAE.CB4@micron.com>
I'm developing a Perl script to run correlations between data groups,
and I'm looking for a way to calculate P-values for various parameters
from the control vs. experimental data. P-values should essentially
indicate the significance of the differences between two data groups, or
the level of confidence in the correlation of the data. Does anyone
know of any Perl modules that can help with this sort of thing? I
looked all over CPAN for probability modules, but can't find anything.
The statistical modules there don't calculate P-values. Where else
might I be able to look for something along these lines?
Thanks,
Dave
------------------------------
Date: Wed, 16 Sep 1998 20:06:36 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: Problems with File::Path
Message-Id: <36007CBC.7A99@comenius.ms.mff.cuni.cz>
Alvin Pollock wrote:
>
> I'm on Windows 95 and I'm having trouble creating directories using
> File::Path.
> The problem is not with File::Path specificallay but apparently with my test
> to
> check whether or not the directory exists. If the directory does not exist,
> the program
> works fine, but if it does exist I get an error (of course) from mkpath
> which
> tries to create it. I don't want to call mkpath if the directory exists but
> my -e test
> doesn't seem to work. Help! Can anybody see what I'm doing wrong? Here's the
> code:
>
> sub MakePath {
> print STDERR "$OUTPUTDIR\n"; # This is just so we know what we're
> looking for.
> &mkpath ($OUTPUTDIR) unless -e $OUTPUTDIR;
> }
>
> And here is the error message:
>
> c:\zip\files\warwick\039pt\
> mkdir c:\zip\files\warwick\039pt\: File exists at
> c:\sgml\ead2html\eadinit.pl line 271
>
> Thanks for any helpful eyes that might figure this out.
>
> Alvin Pollock
> apollock11@hotmail.com
1. Try it without the trailing backslash.
2. I have heard about problems with -e on directories
on Win95, the people claimed that you should try
-e $directory.'\nul'
HTH, Jenda
------------------------------
Date: Wed, 16 Sep 1998 17:24:15 GMT
From: mgoddard@REMOVETHISrosetta.org (Matt Goddard)
Subject: Recursing through a directory and adding it to an array on NT
Message-Id: <35fff3c3.160095254@thor>
I'm looking for information on how to loop through a directory
recursively, adding each and every directory string to @somearray. I'm
fairly new to perl, but I have looked everywhere for a sample of this
to no avail. Any help you could lend would be greatly appreciated.
The purpose of my script is to loop through a given directory and each
of its subdirs to locate a specific file type and generate an admin
type report.
Thanks
-Matt
mgoddard@rosetta.org
------------------------------
Date: 16 Sep 1998 18:13:30 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Recursing through a directory and adding it to an array on NT
Message-Id: <905969233.159808@thrush.omix.com>
[posted & mailed]
[posted & mailed]
Matt Goddard <mgoddard@rosetta.org> wrote:
: I'm looking for information on how to loop through a directory
: recursively, adding each and every directory string to @somearray. I'm
: fairly new to perl, but I have looked everywhere for a sample of this
: to no avail. Any help you could lend would be greatly appreciated.
: The purpose of my script is to loop through a given directory and each
: of its subdirs to locate a specific file type and generate an admin
: type report.
perldoc File::Find
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Wed, 16 Sep 1998 13:14:07 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Saving an Array or Hash into a $Session Variable in ASP?
Message-Id: <1dfbh30.1mexfv6wv7sj4N@slip166-72-108-234.ny.us.ibm.net>
Eric Pan <pan@sheet-music.com> wrote:
> I got the array reference to work but not for hashes. For example, I have
> two asp files
>
<snip>
>
> When I am at try.asp, I have the following:
>
> $VAR1 = [ { 'apple' => 'green', 'grape' => 'purple' }, $VAR1->[0] ];
> next
>
> When I click on next and go to try2.asp, I have the following:
>
> Session variable is
> $VAR1 = [ '-2147352572', '-2147352572' ];
>
> Do you know why? How do I pass an array of hash reference from one page to
> another?
This is most likely a problem with whatever is saving and restoring the
structure. You will probably have to store your data as a string.
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: 16 Sep 1998 18:09:13 GMT
From: "Paul J. Adams" <adams4@worldnet.att.net>
Subject: Re: Who posts original posts on CLPM?
Message-Id: <01bde19a$c1ca0f60$6aa54f0c@383144923worldnet>
Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote in article
<35FFE43B.745370C4@bbnplanet.com>...
> I could be flip here, but seriously....The 'scientific
> method' is a loosely held protocol accepted by
> those who methodically seek to answer questions
> as accurately and honestly as possible. My objection
> to this person was not the data, but that he started
> with an assumption of a 'truth' and then sought
> out to prove that with raw and misleading data.
> There is no demographic information, no correlation
> and no standard error in his presentation of the 'facts'.
> Hence, there was no method, much less scientific.
I'm not entirely sure of what you're objecting to. Let me try to simplify
the issue. For the moment, let's assume that we've determined that Windows
users are more likely to post root messages than *nix users. (Asher's
statistics indicate that when comparing Windows to *nix users, disregarding
other operating systems, 68% of the root messages come from Windows users,
and 32% come from *nix users).
You seem to want to "deconstruct" this statistic and undermine it's
validity. Okay, that's fine. Perhaps you believe that there may be
underlying factors which might account for this discrepancy. Here's the
one clear objection you have raised:
> I have been using Mozilla (gack) for the last few
> weeks due to my mungling xemacs which I havn't
> had time to un-mungle.
You should be able to see that this does not diminish the relevance of
Asher's statistic unless you've changed your posting behavior in the
process of changing software.
Again, lets keep it simple and consider only the Windows vs. *nix
discrepancy regardless of the news reader used on a particular platform.
If a significant number of users jump back and forth from one platform to
another, without significantly modifying their posting behavior, then this
will be a normalizing influence on the statistics. The more people switch
platforms, the more the users of the two platforms will come to resemble
one another. If the platform used by each poster was randomized every time
they posted, then the statistics would gravitate to a 50%/50% split of root
messages distributed by platform. Therefore, your objection seems to
indicate that Asher's statistic may be somewhat understated, rather than
overstated. In other words, the fact that he has "assumed out" the random
migration from one platform to another can not result in an inflated
discrepancy.
The only exception I can imagine would be if there was a sudden massive
migration of a particular "type" of poster from one platform to another.
Do you have any evidence that such a migration has taken place? If so, it
would be interesting to analyze the causes of such a migration. Such a
phenomenon would certainly suggest, if not prove, that the different
platforms attract different types of users.
The fact that despite random migration there remains a greater than 2 to 1
discrepancy in the root message posting behavior between Windows and *nix
users seems to indicate that this is a statistic worthy of attention. You
may object that the several hundred messages analyzed don't constitute a
large enough sample. If so, then you should feel free to present contrary
evidence or at least suggest what size sample ought to be used.
As for the other objections you've raised, such as:
> Bullshit.
and,
> You are totally making assumption here that bite
> my ass.
and,
> U B Smoking' crack boy.
Well, these objections don't seem to merit quite so deep an analysis, so
I'll simply let them stand for now.
------------------------------
Date: 16 Sep 1998 16:35:43 GMT
From: "Milan Spingl" <mspring@nortel.com>
Subject: Y2K date in Perl
Message-Id: <01bde191$14cf9d60$a86b412f@PBPDB857.ca.nortel.com>
Hi there.
What is the best way to get the system date? my $sdate=`date`; does not
always work and localtime(time) does not include century. Prefixing the
year with '19' is not an option as a Y2K comlpliancy is an issue. BTW, we
run Perl 5.002 on a HP-UX 9.05 on a HP9000/735 box.
Thanks...Milan
------------------------------
Date: Wed, 16 Sep 1998 13:29:49 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Y2K date in Perl
Message-Id: <Pine.GSO.3.96.980916132820.20579A-100000@crusoe.crusoe.net>
> What is the best way to get the system date? my $sdate=`date`; does not
> always work and localtime(time) does not include century. Prefixing the
> year with '19' is not an option as a Y2K comlpliancy is an issue. BTW, we
> run Perl 5.002 on a HP-UX 9.05 on a HP9000/735 box.
>From perldoc -f localtime:
Also, $year is the number of years since 1900, that is, $year is
123 in year 2023.
--
Jeff Pinyan (jeffp@crusoe.net)
www.crusoe.net/~jeffp
Crusoe Communications, Inc.
973-882-1022
www.crusoe.net
------------------------------
Date: 16 Sep 1998 10:29:01 -0700
From: Ben Gertzfield <che@debian.org>
Subject: Re: Y2K date in Perl
Message-Id: <yttyarkkluq.fsf@gilgamesh.cse.ucsc.edu>
>>>>> "Milan" == Milan Spingl <mspring@nortel.com> writes:
Milan> Hi there. What is the best way to get the system date? my
Milan> $sdate=`date`; does not always work and localtime(time)
Milan> does not include century. Prefixing the year with '19' is
Milan> not an option as a Y2K comlpliancy is an issue. BTW, we run
Milan> Perl 5.002 on a HP-UX 9.05 on a HP9000/735 box.
Mayhaps you should read the FAQ.
Try adding 1900 to the year returned from localtime.
--
Brought to you by the letters H and Y and the number 17.
"More testicles means more iron." -- Lunchlady Doris, The Simpsons
Debian GNU/Linux -- where do you want to go tomorrow? http://www.debian.org/
I'm on FurryMUCK as Che, and EFNet and YiffNet IRC as Che_Fox.
------------------------------
Date: 16 Sep 1998 17:23:45 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Y2K date in Perl
Message-Id: <6tos71$nd0@mozo.cc.purdue.edu>
"Milan Spingl" <mspring@nortel.com> writes:
}What is the best way to get the system date? my $sdate=`date`; does not
}always work and localtime(time) does not include century. Prefixing the
}year with '19' is not an option as a Y2K comlpliancy is an issue. BTW, we
}run Perl 5.002 on a HP-UX 9.05 on a HP9000/735 box.
Please read the man page for localtime before dismissing it. As it turns
out, you _can_ use localtime to get the information you need, and
there's even an example showing how.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: 16 Sep 1998 14:27:39 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Y2K date in Perl
Message-Id: <6tovur$5si$1@monet.op.net>
In article <01bde191$14cf9d60$a86b412f@PBPDB857.ca.nortel.com>,
Milan Spingl <mspring@nortel.com> wrote:
>localtime(time) does not include century.
Yes, it does. Please see the manual.
------------------------------
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 3729
**************************************