[9266] in Perl-Users-Digest
Perl-Users Digest, Issue: 2861 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 12 20:07:47 1998
Date: Fri, 12 Jun 98 17:00:23 -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 Fri, 12 Jun 1998 Volume: 8 Number: 2861
Today's topics:
Re: A Simple Question! (Jonathan Stowe)
Re: A Simple Question! (Matt Knecht)
Re: Certified Perl Programmers <choleman@simpact.com>
Re: Certified Perl Programmers (Bbirthisel)
Re: Certified Perl Programmers <choleman@simpact.com>
Re: Child processes with Perl (Neil Briscoe)
Re: Date fomatting. (-)
Re: diff-like utility in Perl? <ljz@asfast.com>
Re: diff-like utility in Perl? <tchrist@mox.perl.com>
Re: diff-like utility in Perl? <ljz@asfast.com>
Re: Have we got a good free Perl manual? <mmp@graphics.stanford.edu>
Re: Have we got a good free Perl manual? (Todd Lehman)
Re: Have we got a good free Perl manual? (Paul David Fardy)
Re: Have we got a good free Perl manual? (Todd Lehman)
Re: I want threads, threads and more threads! <reljr@reljr5.ts.sigg.com>
Re: Module Net::SMTP (Neil Briscoe)
new to this - simple if statement question <kerrie@home.com>
novice problem? <nwyman@mda.ca>
Re: offline mode? (-)
Re: Puzzle challenge (Jonathan Stowe)
Re: SOME ASSISTANCE IN TESTING A SCRIPT (Jonathan Stowe)
Re: Urgent ! Where to find perl5.004 for HP-UX <gregory.t.white@lmco.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 12 Jun 1998 23:53:11 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: A Simple Question!
Message-Id: <3581b7f1.18640830@news.btinternet.com>
On Fri, 12 Jun 1998 14:02:03 -0500, Meena Chockalingam wrote :
>Is there a way I can check if a directory is empty before trying to list
>it? See the following code...
>
>IfErrorDir = "/home/CRC";
>open(IN, "$IfErrorDir") || die "could not open $IfErrorDir\n";
>while (<IN>) {
> chop;
> $theFile = $_;
> open(LS, "ls $IfErrorDir/$theFile/*.ifErrors|") || die "could not
>list the $IfErrorDir/$theFile\n";
> while (<LS>) {
> ..............
> }
> close(LS);
>}
>close(IN);
>
>With this method, when one of the directory is empty, trying to do ls
>produces an error saying
>"/home/CRC/*.ifErrors: No such file or directory".
>I tried different file test operations like -z, -d, -e etc... nothing
>worked.
>
There is no real need to spawn the external command "ls" to get a
directory listing in Perl. For one thing it is not portable to
non-Unixish systems and that makes people here feel kind of exclusive
and horrible and they go away and get all guilty and install pre-beta
versions of windows 98 in order to appease their liberal tendencies
;-}.
Your best bet is to check out Perl's built-in facilities :
opendir
readdir
closedir
<and maybe a bit of telldir on the side (to paraphrase Frank Zappa*)>
As documented in the perlfunc manpage.
There have been quite a lot of posts on this stuff recently which you
could probably find on DejaNews.
However if you really *must* use an external command then it is easy
to redirect your standard error in your open and then check the value
of $? after the close of your LS filehandle.
/J\
* "Dumb all over" from "You are what you is"
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Fri, 12 Jun 1998 23:55:30 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: A Simple Question!
Message-Id: <Sdjg1.1$nw.81063@news2.voicenet.com>
Meena Chockalingam <cmeena@hotmail.com> wrote:
>Is there a way I can check if a directory is empty before trying to list
>it? See the following code...
There is always a way to do anything! :)
> open(LS, "ls $IfErrorDir/$theFile/*.ifErrors|") || die "could not
This probably isn't what you want to do. Using find2perl, and tweaking
the output, I built this quick little script (perldoc File::Find).
require "find.pl";
$IfErrorDir = '/home/CRC';
open(IN, $IfErrorDir) || die("Can't open $IfErrorDir: $!\n");
while (<IN>) {
chomp;
$theFile = $_;
find($IfErrorDir . '/' . $theFile);
}
for $file (keys %files) {
.........
}
sub wanted {
/^.*\.ifErrors$/ && $files{$name} = 0;
}
File::Find is your friend! Use it!
--
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"
------------------------------
Date: Fri, 12 Jun 1998 15:53:36 -0700
From: "C.W.Holeman II" <choleman@simpact.com>
Subject: Re: Certified Perl Programmers
Message-Id: <6lsbs3$dmv@newshub.atmnet.net>
Mark-Jason Dominus wrote in message <6ls21v$c1u$1@monet.op.net>...
>...
>Otherwise you might as well make them available over the web and let
>people print their own.
But then one would have to demonstrate the skill set needed to use
the web AND a printer so not everyone could be certified.
--
C.W.Holeman II (619)503-1101
Configuration Management Specialist
Simpact Associates Inc.
choleman@simpact.com
------------------------------
Date: 12 Jun 1998 23:23:03 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: Certified Perl Programmers
Message-Id: <1998061223230300.TAA21653@ladder01.news.aol.com>
Hi ALL:
>>Otherwise you might as well make them available over the web and let
>>people print their own.
>But then one would have to demonstrate the skill set needed to use
>the web AND a printer so not everyone could be certified.
You should make it downloadable from CPAN and indicate where to find
it in the FAQ. That would establish a suitable skill set - since anyone who
couldn't do that probably shouldn't have one.
-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: Fri, 12 Jun 1998 15:53:36 -0700
From: "C.W.Holeman II" <choleman@simpact.com>
Subject: Re: Certified Perl Programmers
Message-Id: <6lscg0$e2t@newshub.atmnet.net>
Mark-Jason Dominus wrote in message <6ls21v$c1u$1@monet.op.net>...
>...
>Otherwise you might as well make them available over the web and let
>people print their own.
But then one would have to demonstrate the skill set needed to use
the web AND a printer so not everyone could be certified.
--
C.W.Holeman II (619)503-1101
Configuration Management Specialist
Simpact Associates Inc.
choleman@simpact.com
------------------------------
Date: 12 Jun 1998 23:11:43 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: Child processes with Perl
Message-Id: <memo.19980613001141.58423A@skep.compulink.co.uk.cix.co.uk>
In article <3576698b.1718163@news.btinternet.com>,
Gellyfish@btinternet.com (Jonathan Stowe) wrote:
> It would probably be easier to fork, exec, wait explicitly .
Indeed, or even waitpid().
Whatever, you need to store the process numbers you obtain as
you fork() the 19 children, and make sure you've reaped them
all before you terminate yourself.
Regards
Neil
------------------------------
Date: Fri, 12 Jun 1998 22:14:06 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Date fomatting.
Message-Id: <3581a69b.16861879@news2.cais.com>
Nick Nottleman <Nick1pub@worldnet.att.net> Said this:
>John Stanley wrote:
>>
>> In article <6ld345$k67@bgtnsc03.worldnet.att.net>,
>> Nick Nottleman <Nick1pub@worldnet.att.net> wrote:
>> >I am creating a script that polls to see if a file exists and then
>> >e-mails it if it does exist. I have been able to make everything work
>> >except that the files that I need to search for are created with the
>> >current date in this format:
>> >yymmdd
>> >So I need to be able to make perl look for the file.
>>
>> Well, you might try the -e file test, or you might try opening the file
>> for read access. If the latter fails, you won't know if the file exists,
>> but if you can't open it for read it doesn't really matter if it exists,
>> you probably can't mail it to anyone anyway..
>I guess I should have phrased the question better, I can tell if the
>file exists if I hard code it, but I need to assign some sort of
>variable to look for these files every day. i.e
>$filname = yymmdd
I'm not sure if I get what you're trying to do or not... but wouldn't
grep'ing the entire directory into an array, then looping through the
array looking for a match to a regexp do the trick? I mean, if you
know the file looks something like this:
filename.980612.dat
then you could compare the filenames like this:
opendir (DIR, "/home/username/datfiles/");
@dated_files = grep (!/^\.\.?$/, readdir(DIR));
closedir (DIR);
foreach $file (@date_files)
{
next unless ($file =~ /\d\d\d\d\d\d\.dat/);
&do_something($file);
}
or, if you want only to pick out a specific date, then what you need
to do is set up a variable with that date formatting, ie
sub get_date {
($sec, $min, $hour, $mday, $mon, $yr, $wday, $yday, $isdst) =
localtime(time);
if ($mday <= 9)
{
$mday = '0' . $mday;
}
if ($mon <= 9)
{
$mon = '0' . $mon;
}
$now_date = "$yr$mon$mday";
return $now_date);
}
Now, $now_date looks like this "980612" on June 12th, 1998. so you
can compare the filenames to this string:
$file =~ /$now_date/;
------------------------------
Date: 12 Jun 1998 19:01:48 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: diff-like utility in Perl?
Message-Id: <ltd8ceb4wz.fsf@asfast.com>
Tom Christiansen <tchrist@mox.perl.com> writes:
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> "Joe Foose" <foosejm@bp.com> writes:
> :Does anybody know if there is a Perl function which compares two files or
> :strings and returns output similar to Unix's diff command?
>
> $delta= `diff f1 f2`;
>
> Or are we supposed to reinvent this wheel, too?
You say "supposed to" as if you believe that the original poster was
somehow demanding that someone invent something. I don't see that
anywhere in the original question.
Given that no generalized `diff' module exists in CPAN, and that a
grep of `diff' among the Perl man pages mentions nothing of this sort,
either, I think that the original question is perfectly reasonable.
I know of no such Perl-based `diff', but perhaps someone out there has
invented such a thing without having posted it to CPAN. If so,
perhaps the original poster's question will cause this potential gem
to be revealed.
--
Lloyd Zusman ljz@asfast.com
perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
$t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
$x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'
------------------------------
Date: 12 Jun 1998 23:16:44 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: diff-like utility in Perl?
Message-Id: <6lscss$3ph$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Lloyd Zusman <ljz@asfast.com> writes:
:I know of no such Perl-based `diff', but perhaps someone out there has
:invented such a thing without having posted it to CPAN.
Is there a Perl-based netstat? Or ps? Or vi?
Sigh.
--tom
--
"Any computer scientist who praises orthogonality should be sentenced to
use an Etch-a-Sketch."
--Larry Wall
------------------------------
Date: 12 Jun 1998 19:25:19 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: diff-like utility in Perl?
Message-Id: <ltaf7ib3ts.fsf@asfast.com>
Gellyfish@btinternet.com (Jonathan Stowe) writes:
> On 12 Jun 1998 12:33:08 GMT, Joe Foose wrote :
>
> >Does anybody know if there is a Perl function which compares two files or
> >strings and returns output similar to Unix's diff command?
> >
>
> Why when we all have diff
Why `File::Find' when we all have `find'?
Why `File::Copy' when we all have `cp' and `mv'?
... etc. ...
I'm not suggesting that someone go out and invent `File::Diff' or
`String::Diff' or whatever it might be called. Rather, I'm contending
that it's quite reasonable that someone might be interested in
investigating the possible existence of such a module given that
`File::Find', `File::Copy', and a number of other Perl-based
enhancements/replacements for traditional Unix functions have already
been created.
The `diff' program itself is not trivial to write, since the
algorithms it uses can be tricky. Therefore, writing a Perl
implementation of this would be very instructive and interesting for
anyone willing to undertake that task. I might even do it myself if I
manage to find a sufficient amount of spare time before the millenium
ends ... <not holding breath>
> [ ... ]
--
Lloyd Zusman ljz@asfast.com
perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
$t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
$x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'
------------------------------
Date: 12 Jun 1998 15:56:27 -0700
From: Matt Pharr <mmp@graphics.stanford.edu>
Subject: Re: Have we got a good free Perl manual?
Message-Id: <kh0n2bii604.fsf@lux.Stanford.EDU>
lehman@visi.com (Todd Lehman) writes:
>
> > For RMS, it's clearly a moral issue. He considers himself a vanguard of
> > the free software movement, and insists on using free software as much as
> > feasible. When he needs software for a task and can't find a free version,
> > he writes it himself or encourages others to do so.
>
> I admire that. What I don't admire is pissing on ORA and on Perl book
> authors because they don't share 100% of his vision.
I should know better than to get involved in this, but where _exactly_ did
RMS 'piss on other people'? He makes the point that it would be nice to
have a free (in terms of freedom, see
<URL:http://www.gnu.org/philosophy/free-sw.html> before that little
argument happens again) manual for perl. That's it. Agree or disagree
yourself, whatever, but others aren't being criticized for their choice of
license for their manuals.
-matt
--
Matt Pharr mmp@graphics.stanford.edu
<URL:http://graphics.stanford.edu/~mmp>
------------------------------
Date: Fri, 12 Jun 1998 23:02:07 GMT
From: lehman@visi.com (Todd Lehman)
Subject: Re: Have we got a good free Perl manual?
Message-Id: <Prig1.1045$bj2.4802456@ptah.visi.com>
David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de> writes:
> > > This is nonsense. It is a loss to the community period. If they were
> > > under some cosmic obligation, the community would not encounter any
> > > loss because it could sue them for providing the stuff. As they are
> > > not under an obligation, it is a loss to the community for good.
> >
> > Aren't you confusing loss with non-gain? Was the documentation sold
> > to O'Reilly once freely available? If so, then you could consider it a
> > loss. If not, then to call it a loss is to presume that it would have
> > and should have been contributed to the community all along, and that is
> > up to the authors and -no one- else.
>
> No, that it *could* have been contributed to the community. Once you
> have signed over your marketing rights exclusively to some publisher,
> this option is gone.
Yes, David, of course it *could* have been contributed. How is that
relevant? It wasn't contributed, and it didn't have to be. Whether it
*could* have been is completely irrelevant.
You are still confusing loss with non-gain. More specifically, you are
confusing actual loss with loss of potential gain.
It was not a loss for the community. However, may be true that it was
not a gain.
--Todd
------------------------------
Date: 12 Jun 1998 22:29:27 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Re: Have we got a good free Perl manual?
Message-Id: <6lsa47$clt$1@coranto.ucs.mun.ca>
Stephane Boucher <sbo@nortel.ca_NO_SPAM> writes:
>From the GNU web page:
>------------------------------------------------------------
>Documentation
>We very urgently need documentation for some parts of the system that
>already exist.
> A C reference manual. (RMS made a try at one, which you could
> start with).
> A manual for Ghostscript.
> A manual for TCSH.
> A good free manual for Perl. (There are proprietary books, but
> these are no good, because they are being withheld from our
> community by their owners.)
> A manual for PIC (the graphics formatting language).
> A book on how GCC works and why various machine descriptions
> are written as they are.
> A manual for programming X-window applications.
> Manuals for various X window managers.
> Reference cards for those manuals that don't have them: C
> Compiler, Make, Texinfo, Termcap, and maybe the C Library.
> Many utilities need documentation, including grep and others.
Odd... Why don't they need "a good free manual for TeX"?
Paul Fardy
--
Paul David Fardy | pdf@morgan.ucs.mun.ca
Computing and Communications | pdf@InfoNET.st-johns.nf.ca
Memorial University of Newfoundland |
St. John's, NF A1C 5S7 |
------------------------------
Date: Fri, 12 Jun 1998 23:13:53 GMT
From: lehman@visi.com (Todd Lehman)
Subject: Re: Have we got a good free Perl manual?
Message-Id: <RCig1.1047$bj2.4809338@ptah.visi.com>
Matt Pharr <mmp@graphics.stanford.edu> writes:
> lehman@visi.com (Todd Lehman) writes:
> > I admire that. What I don't admire is pissing on ORA and on Perl book
> > authors because they don't share 100% of his vision.
>
> I should know better than to get involved in this, but where _exactly_ did
> RMS 'piss on other people'?
'Pissing on' was a poor word choice. He didn't. What he was doing was
looking down on ORA and the Perl book authors as if they did something
wrong by not contributing the documentation freely and as if there is
anyone alive who has been hurt by that.
> He makes the point that it would be nice to
> have a free (in terms of freedom, see
> <URL:http://www.gnu.org/philosophy/free-sw.html> before that little
> argument happens again) manual for perl. That's it. Agree or disagree
> yourself, whatever, but others aren't being criticized for their choice of
> license for their manuals.
I may be guilty of reading between the lines too much in RMS's post (which
started this thread). But even after 5 readings, I still sensed snide and
arrogant undertones. Are you sure that no one was being criticized?
--Todd
------------------------------
Date: Fri, 12 Jun 1998 23:37:12 GMT
From: Robert Lee <reljr@reljr5.ts.sigg.com>
Subject: Re: I want threads, threads and more threads!
Message-Id: <3581BBA7.B7D279AA@reljr5.ts.sigg.com>
? the platypus {aka David Formosa} wrote:
> In <Pine.LNX.3.96.980611164809.1456E-100000@kollwitz.doit.wisc.edu> "Gabriele R. Fariello" <gabriele@kollwitz.doit.wisc.edu> writes:
>
> >On Thu, 11 Jun 1998, John Porter wrote:
>
> [...]
>
> >> Umm, have you considered the SysV IPC routines? msg*, shm*, sem* ???
>
> >Heh, sorry not a SysV OS. It's on RedHat 5.0 Linux.
>
> IIRC Linux dose implement the SysV IPC routines. So you are able to get
> shared memory and selphors.
>
Unfortunately the threading version of perl is not yet ready
for prime time, but I do believe that betas are available on the
net. I think threads are a much better way of doing things than
using IPC shared memory, etc. having used IPC for many years.
--
Robert Lee
"And yes, IPC is just plain Yucky!"
------------------------------
Date: 12 Jun 1998 23:11:46 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: Module Net::SMTP
Message-Id: <memo.19980613001144.58423B@skep.compulink.co.uk.cix.co.uk>
In article <is90nduyku.fsf@godzilla.kiere.ericsson.se>,
qdtcall@esb.ericsson.se (Calle Dybedahl) wrote:
> Justin Archie <thealienz@thealienz.com> writes:
>
> > Could someone explain how to use the module known as Net::SMTP?
>
> What's wrong with the examples in the documentation?
Nothing whatever.
Despite the fact that the documentation also advises you read RFC822 (or
is it RFC821, I can never remember) I have read neither - and I am still a
very happy user of the above module.
Regards
Neil
------------------------------
Date: Fri, 12 Jun 1998 23:50:12 GMT
From: Kerrie Etter <kerrie@home.com>
Subject: new to this - simple if statement question
Message-Id: <3581E8F0.C0D2DA2C@home.com>
sorry this is probably a horribly simple question but.....
(drop down to choose a state....)
the following script sends me to California (or whoever I have listed
first) no matter which state I select....anyone? (again, sorry I'm
really, really new to this, thanks...k)
if ($state == California) {
print "Location:/newpublic/investors/ca.html\n\n";
}
if ($state == Arizona) {
print "Location:/newpublic/investors/az.html\n\n";
}
(HTML):
<FORM ACTION="/cgi-bin-sh/statefinder.pl" METHOD="POST">
<P><SELECT NAME="Select a State" SIZE="1">
<OPTION VALUE="">Select a State</OPTION>
<OPTION VALUE="">Alabama</OPTION>
<OPTION VALUE="">Alaska</OPTION>
<OPTION VALUE="">Arizona</OPTION>
<OPTION VALUE="">Arkansas</OPTION>
etc......
------------------------------
Date: Fri, 12 Jun 1998 16:26:20 -0700
From: Computing Services <nwyman@mda.ca>
Subject: novice problem?
Message-Id: <3581B91C.9D223265@mda.ca>
I'm trying to read in the contents of a directory then change the file
names based on what the user inputs (see code below). I put the old and
new file names into "file_names.txt". This *did* work until I tried to
have the user input the directory with this code:
print "Enter the directory where the files are located: ";
chop($directory = <STDIN>);
chdir($directory) || die "ERROR: cannot change to $directory";
and now everytime I run it, I keep getting the error "No such file or
directory". I removed the code and I still get this problem, even when
I'm running the script from the same directory where I'm trying to
change the files. I also tried rebuilding the script from scratch, which
worked until I tried the directory input.
Why would this make such a difference? Can anyone point out what I'm
doing wrong? I've run out of ideas.
Thanks,
Naomi
----------------------------------
$fnames_file = "file_names.txt";
&get_fnames;
&rename_fnames;
sub get_fnames {
local($file, @file_list);
#open the directory to read
opendir(DIR,'.') || die "ERROR: cannot open $directory";
@file_list = readdir(DIR);
closedir(DIR);
#set up file to copy file names into, will not overwrite if the file
exists
if (-e $fnames_file) { #remove file if it already exists
unlink($fnames_file);
}
open(OUT,">>$fnames_file") || die "ERROR: cannot open $fnames_file\n";
foreach $file (@file_list) {
if ($file =~ /.c\b/i) { #match .c at the end of the word and ignore
case
$extension = ".c";
}
elsif ($file =~ /.h\b/i) { #match .h at the end of the word and ignore
case
$extension = ".h";
}
elsif ($file =~ /.o\b/i) { #match .o at the end of the word and ignore
case
$extension = ".o";
}
elsif ($file =~ /.sh\b/i) { #match .sh at the end of the word and
ignore case
$extension = ".sh";
}
elsif ($file =~ /.a\b/i) { #match .a at the end of the word and ignore
case
$extension = ".a";
}
elsif ($file =~ /.awk\b/i) { #match .awk at the end of the word and
ignore case
$extension = ".awk";
}
else {
print "no substitution rule for $file\n";
next;
}
print ("Enter the new file name for $file: ");
chop ($new_filename = <STDIN>);
if ($new_filename eq "") { #if no file name was given, just write the
old name
$file = $file.":"."\n";
}
else { #if a new file name was give write to file
$file = $file.":".$new_filename.$extension."\n";
}
$file =~ tr/a-z/A-Z/; #translate all lower case to upper
print OUT $file;
}
close(OUT);
}
sub rename_fnames {
local(%list);
#name and open the file where the old and new file names are kept
open(FNAMES,$fnames_file) || die "ERROR: cannot open $fnames_file for
reading";
#input the old and new file names into an associative array
while (<FNAMES>) {
if (/^\#/) {
next; #ignore comments
}
elsif (/^\s/) {
next; #ignore blank lines
}
else {
($old_name,$new_name) = split(/:/, $_); #read the info in
chop($new_name); #remove the end of line
$list{$old_name} = $new_name; #load the info into the
associative array
}
#print "Old: $old_name, New: $new_name\n";
}
close(FNAMES);
foreach $key (keys %list) {
print "Old: $key, New: $list{$key}\n";
rename($key, $key{$list}) || print "$!";
}
}
------------------------------
Date: Fri, 12 Jun 1998 23:05:02 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: offline mode?
Message-Id: <3581b052.19316602@news2.cais.com>
angst <angst@scrye.com> Said this:
>Tom Christiansen <tchrist@mox.perl.com> wrote:
>
>: I wonder why no one ever posts "I'm just learning C and tcp."
>
>Because this isn't a c or tcp group.
>Seriously though, it has to do with the general lack of people that really
>care to take the time to learn how things work, which i find particularly
>appalling in the case of sysadmins. People learn tools to get a job
>done, without ever really wanting to know _how_ that particular solution
>actually works. So, they learn things the excruciatingly painful way, instead
>of learning underlying concepts (such as tcp) which would help them immensely
>in learning other things later on (like cgi).
>
>Now, compared to perl, C is a very painful language. But, if learning
>C can't teach you how to program in general, then nothing can. Learning
>C forces you to learn a lot about programming practice, and learning to write
>good C teaches you a lot about how computers in general work, particularly
>things like memory management. But then, a huge percentage of the people
>out there, even so-called sysadmins, only want to put up nifty web
>pages with cool forms, so why would they care how the thing actually works,
>so long as there are people around to spoon-feed them perl. I've
>seen plenty of people who have written CGI scripts without any real idea
>of why the things work like they do, so they end up asking the same questions
>over and over again every time the write a new script. It's really
>kind of sickening. In my mind, you have no right to call yourself
>a sysadmin or (god forbid) a computer programmer if you have no clue
>how the thing really works, and particularly if you don't make any
>effort to learn anything beyond how to change around other people's work
>to do exactly what you want. Plenty of people get some script off
>someone else, and just keep changing it for each new project, without
>even knowing what the original script really does or how it does it.
>
>It's this general attitude of taking a computer, or the web, as a "black
>box" without every caring how the thing actually works that has made
>companies like Microsoft so successful. it wouldn't be quite so bad,
>except people that call themselves computer professionals and get paid
>to manage and sometimes develop computers and software often don't
>have the first idea of how the thing works, so they end up writing
>bad and often inadvertently dangerous code and getting paid for it.
>
>Sorry about that...you inadvertently hit on one of my pet peeves.
>
If you get annoyed by this too, then you should check out
http://www.ragingbull.com - talk about a site designed by wannabes.
I have been struggling with a user who has had trouble setting up an
account at this site, and from everything I can observe, the problem
lies in the site's programming, yet their webmaster's response is "It
must be a problem with cookies" - even though the problem area has
nothing to do with cookies. It's a form based login, they email you a
code and you are supposed to enter your email address and the code in
this form. Yet when you do it the next page says "unable to find
<email address>" then there's a link that says "Manually configure
your account" and it's a mailto: link like this:
<a href="mailto:blah@ragingbull.com?subject=New Account Request">
What you have here is a person who's only awareness of "the internet"
comes from his use of internet explorer 3.0 or 4.0.... if you try to
use such a link in Netscape, with Eudora set via mapi to intercept
mailto links, then the results of clicking on such a link is:
To: blah@raginbull.com?subject=New Account Request
From: user
Subject:
I'm sure the response from the webmaster would be "there must be
something wrong with your software becuase it works on our computers."
And the worst part of all is that even if their moronic programmers
can't figure out how to set up a form based solution using CGI, they
could at least provide some instructions as to what the email should
actually contain... it just says "request your user name and password"
- but it doesn't say if it's looking for a name and password seperated
by a space or tab on one line, or a name on one line followed by a
password on a seperate line, or if they want something like "I am
requesting a username and password, sirs, and I would like joeuser and
password" or what.
Anyway, the point being, this type of idiocy is exactly what you are
talking about.... people who have no right being "systems developers"
or "programmers" or "system administrators" or "webmasters" are
bullshitting people into hiring them to do just that. It's almost
fraud in my opinion.
I've been trying to tell people there is a difference between a user
and a techinically literate person. Just because a GUI enables just
about any drooling fool to USE a computer doesn't make them any easier
to program, administer, or understand. Unfortunately, with NT, we're
seeing a lot more of these users attempting to be administrators and
network engineers and programmers. It's a shame because these people
are truly inept and lack any real understanding.
I call them "Point and click commandos" - which sums up anyone who's
entire history of computing revolves around the advent of the GUI on
intel platforms.
------------------------------
Date: Fri, 12 Jun 1998 23:53:10 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Puzzle challenge
Message-Id: <3581b66e.18254268@news.btinternet.com>
On 12 Jun 1998 16:55:00 -0600, Nathan Torkington wrote :
>Tim.Bunce@ig.co.uk (Tim Bunce) (Tim Bunce) writes:
>> The problem is to find the full list of names and the original order.
>
>You INSTALL a FULL SET OF TOOLS, like THE LORD GOD ALMIGHTY intended.
>REPENT, ye PRISONER of BILL! The DAY of JUDGEMENT is AT PERL! Your
>MESSENGERS are obviously just POOR substitutes for RELIABLE PIPE
>COMMUNICATION which you'd have if you had a REAL OPERATING SYSTEM
>and not a SCURRILOUS PIECE OF TOOL-CHALLENGED COPROPHILIA!
>
For myself I wouldnt go as far as that but some red hot pokers to
impress upon the messengers the need to create a reliable transport
mechanism and possibly some paper and pencils to support the
implementation of such might help.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Fri, 12 Jun 1998 23:53:17 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: SOME ASSISTANCE IN TESTING A SCRIPT
Message-Id: <3581bdc8.19981879@news.btinternet.com>
On Sat, 13 Jun 1998 05:49:08 +1000, Stephan Carydakis wrote :
>oops....Please replace "meat" with "meet" in my previous post...
No I quite liked that - a sort of new verb. And hey I'm Vegetarian.
But Paraguay v Bulgaria just done my head in.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 12 Jun 1998 23:39:39 GMT
From: "Gregory T. White" <gregory.t.white@lmco.com>
Subject: Re: Urgent ! Where to find perl5.004 for HP-UX
Message-Id: <01bd965a$ec1ba660$0e3ac581@SVLEP0708855.lmms.lmco.com>
You might try this URL
ftp://rtfm.mit.edu/pub/usenet-by-hierarchy/comp/lang/perl/modules/comp.lang.
perl.modules_The_Perl_5_Module_List_%28Reusable_Software%29
Gregory White
gregory.t.white@lmco.com
Yingxiang Wu <yiwu2@vt.edu> wrote in article <3581B17D.41C6@vt.edu>...
> It's urgent!
>
> I want to upgrade the perl in a HP_UX workstation. Is some where I can
> find the newest version of perl.
>
> Thank you for your help.
>
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2861
**************************************