[10951] in Perl-Users-Digest
Perl-Users Digest, Issue: 4553 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 5 12:07:13 1999
Date: Tue, 5 Jan 99 09:01:38 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 5 Jan 1999 Volume: 8 Number: 4553
Today's topics:
Re: Perl 5 for NT: How to do an End Process on a deadlo <jwarner@tivoli.com>
PERL and permissions <alejandro.eluchans@umb.edu>
PERL Programmers Wanted webmail@imirage.com
Re: Problems with Win32::API <perin@panix7.panix.com>
Re: Retrospective on comp.lang.perl.moderated? (Bart Lateur)
Re: Retrospective on comp.lang.perl.moderated? (Mark-Jason Dominus)
Re: SDBM in ActivePerl for Win32 : each() lose key/valu <mymail@nospam.com>
Site Checkers??? <mtg82814@melsud.res.ray.com>
sort hash by values <yhu@mail.nih.gov>
Re: sort hash by values <staffan@ngb.se>
Split on whitespace sintax ? gattaz@hotmail.com
Re: Split on whitespace sintax ? <jwarner@tivoli.com>
Re: Split on whitespace sintax ? dave@mag-sol.com
Re: Unusual behavior of the int function. (Timothy P Delong)
Re: Unusual behavior of the int function. (Timothy P Delong)
Web server in perl (Andy Davidson)
Re: Web server in perl <ibelgaufts@gfc-net.de>
Re: Web server in perl (Clay Irving)
which database to take for perl + tk + win32? <ibelgaufts@gfc-net.de>
Re: why this doesn't work <Taco.Bell@rulez.the.net>
Re: why this doesn't work dave@mag-sol.com
Re: why this doesn't work <staffan@ngb.se>
Re: why this doesn't work (Clay Irving)
Re: Writing many files efficiently <ruben@llinderman.dental.nyu.edu>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 05 Jan 1999 08:30:43 -0600
From: John Warner <jwarner@tivoli.com>
Subject: Re: Perl 5 for NT: How to do an End Process on a deadlocked Perl process
Message-Id: <36922213.3CA61EA9@tivoli.com>
First, let me encourage you to move to IIS4. IIS3 is a cheesy imitation
of a web/ftp server. You will find IIS4 much easier to configure (look
Ma! no need for regedit!) and maintain.
Second, It sounds like your copy of Perl is misconfigured. Double check
to make sure you don't have more than one copy of Perl installed. If
you do, you will have to edit the registry to ensure that IIS is
pointing at the correct copy of Perl. This is actually rather tricky
with IIS3. Some of the older ActiveState builds of Perl had a bug in
perlis.dll that would cause IIS to burn up all the available CPU. I ran
into this one the hard way with 5.004 build 467 (469?).
Another configuration gotcha for your situation is allowing your users
to do any CGI that invokes perl.exe. The ActiveState installer should
associate .pl with perl.exe and .plx with perlis.dll. If your users put
out CGI with the extension of .pl, a separate copy of perl.exe will be
loaded. This is a problem if that CGI is invoked enough times within
the right time frame, you will find the server resources are used up
(and therefore bad servere performance, etc, etc).
Out of curiosity, what are the hardware specs for your NT server? If
you are going to be running a lot of CGI off this machine, you need to
have a fairly decent hardware (300MHz PII with 128Mb RAM or better).
Lastly, when you tried to stop these scripts from Task Manager, were you
logged in as an Administrator level account for the appropriate domain?
Were you tryinig to stop perl.exe or was the script itself showing in
TM?
John Warner
Caitlin wrote:
> I have a number of users that are playing with Perl on our
> NT IIS3 server. From time to time their script will go into
> an infinite loop or become deadlocked waiting on a flock.
> The CPU is pinned at 100% and I can't figure out kill these
> Perl scripts.
>
> If I try to use End Process from Task Manager I get an
> "Access is denied" error message. I'm logged in as the
> admin but I fear that since the parent of the Perl process
> is a system service (i.e. IIS) I'm out of luck. Is there any
> way to "kill" a Perl process without "killing" the author of
> the script?
> --
> Caitlin
------------------------------
Date: Tue, 05 Jan 1999 11:18:20 -0500
From: Alejandro Eluchans <alejandro.eluchans@umb.edu>
Subject: PERL and permissions
Message-Id: <36923A99.A01D38BC@umb.edu>
Does any body know how to change the permission of a PERL script from
nobody to a user with full privileges in a particular directory in order
to edit and create files using PERL without having to give full
permission to nobody.
------------------------------
Date: Tue, 05 Jan 1999 15:16:31 GMT
From: webmail@imirage.com
Subject: PERL Programmers Wanted
Message-Id: <36922c90.429623937@news.ptd.net>
Imirage is looking for experienced PERL programmers for freelance
work. Please send experience, rates and a description of your work
environment to webmail@imirage.com.
We seek talented, experienced
professionals who can make an immediate impact.
Thank you,
--
Imirage, Inc. -- http://www.imirage.com
------------------------------
Date: 05 Jan 1999 09:20:38 -0500
From: Lewis Perin <perin@panix7.panix.com>
Subject: Re: Problems with Win32::API
Message-Id: <pc7btkdajih.fsf@panix7.panix.com>
"J|rgen Ibelgaufts" <ibelgaufts@gfc-net.de> writes:
> Hi there,
>
> i am just trying some things with Win32::API to make the common windows dialogs
> available for perl. Some things work (for example the Beep function in the
> kernel32.dll which makes a sound with a given frequency and milliseconds.
>
> Now i try the GetOpenFileName function It seems easy to use because it has only
> one parameter, but this is a pointer that points to a rather complicated structure
> of 20 dwords, integers and other pointers. I get stuck.
>
> Does anyone have any experience with this kind of stuff? The Win32::API
> documentation ends long before this point
You should probably read the Camel book section on pack about five
times. Then you should probably work on interfacing Win32 API calls
with simpler interfaces and think hard about levels of indirection and
realize you may need to call pack more than once. Then you'll
probably be ready for a real monster call.
Cheers, Lew
------------------------------
Date: Tue, 05 Jan 1999 12:34:57 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <3698066e.3410567@news.skynet.be>
Ronald J Kimball wrote:
>> How does one register anyway?
>> I tried posting more than once to c.l.p.mod, but I never saw my
>> posting get through (nor have I received a rejection or any other
>> email).
>
>You should receive an automatic reply in response to the first post you
>make to comp.lang.perl.moderated, with instructions on how to register.
>If you don't receive this, I would suggest sending mail to
>mjd-clpm-admin@plover.com and asking for help.
It appears to me that if you don't reply to the very first automatioc
reply, you're simply ignored for any further posts.
And if finally you do reply to the autoreply, only the very first post
will be sent to the moderators. The rest is simply lost.
I happened to me.
Bart.
------------------------------
Date: 5 Jan 1999 11:52:53 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <76tg15$g35$1@monet.op.net>
In article <3698066e.3410567@news.skynet.be>,
Bart Lateur <bart.lateur@skynet.be> wrote:
>It appears to me that if you don't reply to the very first automatioc
>reply, you're simply ignored for any further posts.
That is not the case. You should receive a separate registration form
each and every time you post an article, until you register.
>And if finally you do reply to the autoreply, only the very first post
>will be sent to the moderators. The rest is simply lost.
Each article has its own registration form. When you return the
registration form that was send in reposnse to the article, the
article is passed on to the moderators. To get the other articles
released, you should return the other forms.
This is not the best way for it to work, of course. It would be
better if returning any one of the forms released all the articles.
But the situation has not come up very often, so fixing it is a
relatively low priority.
>I happened to me.
I don't think so, because I looked to see if there were any articles
from you that were still waiting for registration forms, and there
were none. Every one of the six articles we have ever received from
you has been sent to the moderators and either approved or rejected.
------------------------------
Date: Tue, 05 Jan 1999 08:29:57 -0500
From: JPAH-FLA <mymail@nospam.com>
Subject: Re: SDBM in ActivePerl for Win32 : each() lose key/value
Message-Id: <369213D5.4352ADEE@nospam.com>
Hello:
I had a similar case in W32 perl. I had a hash of a hash that was working
fine, but after I tied it using:
dbmopen %h, $DB, 0766 || die "cant open DBM: $!\n";
it consistently would loose the first key-value.. For example, if I defined:
$h{tom}{ctype} = "cat";
$h{tom}{colour} = "brown";
$h{tom}{build} = "fat";
$h{tom}{age} = "5";
$h{tom}{owner} = "sara";
when I iterate the $h{tom}{item} out, it consistenly looses the {ctype}. For
multiple hashes such as $h{bill} it looses that {ctype} as well, and so on.
My work-around was to use:
$h{tom}{dummy}="whocares";
$h{tom}{ctype} = "cat";
$h{tom}{colour} = "brown";
$h{tom}{build} = "fat";
$h{tom}{age} = "5";
$h{tom}{owner} = "sara";
and it worked fine, but this seems like an odd thing to have to do!
I regret if this post arrives in the group twice- I posted a question about it
before Christmas & it never seemed to appear in the newsgroup.
E
-----------------------------------------------------------------------------------------
Alain Coetmeur wrote:
> I'm using SDBM tied hashes in ActivePerl (508)
> I've discovered that SDBM does forget many keys
> with each()
>
> I've 32000 key value (less that 20 char for key and value )
> and only 12000 are enumerated by each
>
> for a given key $k0
> defined $rubrique{$k0}
> can be true
>
> yet
> while(($k,$r)=each(%rubrique))
> {
> }
> never find it !
>
> I tie my hashed so:
>
> use SDBM_File;
> tie(%rubrique, 'SDBM_File', "$basedir\\rubrique", O_RDWR|O_CREAT, 0640);
>
> I've read something about O_BINARY
>
> but
>
> use Fcntl;
> tie(%rubrique, 'SDBM_File', "$basedir\\rubrique", O_RDWR|O_CREAT|O_BINARY,
> 0640);
>
> does not work either.
>
> how to make SDBM work ?
> is ther another simple database that I can use
> for my programs that use tied hashes ?
------------------------------
Date: Tue, 05 Jan 1999 09:29:46 -0500
From: Mike Godfrey <mtg82814@melsud.res.ray.com>
Subject: Site Checkers???
Message-Id: <369221D9.3EB8630A@melsud.res.ray.com>
Does anyone know of any site checkers that work well with very large
sites that contain frames.
thanks,
Mike
------------------------------
Date: Tue, 05 Jan 1999 09:59:24 -0500
From: Ying Hu <yhu@mail.nih.gov>
Subject: sort hash by values
Message-Id: <369228CB.6791FE63@mail.nih.gov>
Hi:
I do not know why the following scritpe did not work. Help, please.
I want sort values (number) of hash.
Thanks,
Ying
while (($key, sort {$a<=>$b}$value) = each %my_hash){
&doing_something;
}
------------------------------
Date: Tue, 05 Jan 1999 17:17:05 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: sort hash by values
Message-Id: <36923B01.65A5175A@ngb.se>
> while (($key, sort {$a<=>$b}$value) = each %my_hash){
> &doing_something;
>From perlfunc keys:
[snip] how about sorted by key:
foreach $key (sort(keys %ENV))
[snip] Here's a descending numeric sort of a hash by its values:
foreach $key (sort { $hash{$b} <=> $hash{$a} } keys %hash)
and then, off course, $value is $hash{ $key }...
Staffan
------------------------------
Date: Tue, 05 Jan 1999 14:57:06 GMT
From: gattaz@hotmail.com
Subject: Split on whitespace sintax ?
Message-Id: <76t981$5t5$1@nnrp1.dejanews.com>
$var= "01 sss";
($a, $b) = split $var;
#doesn't work ...
#isn't it the same as ($a, $b) = split(/ /,$var) ????
print "$a <***> $b";
thanks !
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 05 Jan 1999 09:25:09 -0600
From: John Warner <jwarner@tivoli.com>
Subject: Re: Split on whitespace sintax ?
Message-Id: <36922ED5.833272BC@tivoli.com>
Not exactly. If you wish to split on whitespace, you would be better off
doing
($a,$b) = split(/\s+/,$var);
which is what split is supposed to do if you leave out the expression
(Programming Perl, p.220).
HTH,
John Warner
gattaz@hotmail.com wrote:
> $var= "01 sss";
>
> ($a, $b) = split $var;
> #doesn't work ...
> #isn't it the same as ($a, $b) = split(/ /,$var) ????
>
> print "$a <***> $b";
>
> thanks !
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 05 Jan 1999 16:09:36 GMT
From: dave@mag-sol.com
Subject: Re: Split on whitespace sintax ?
Message-Id: <76tdfv$9so$1@nnrp1.dejanews.com>
In article <76t981$5t5$1@nnrp1.dejanews.com>,
gattaz@hotmail.com wrote:
>
>
> $var= "01 sss";
>
> ($a, $b) = split $var;
> #doesn't work ...
> #isn't it the same as ($a, $b) = split(/ /,$var) ????
No, it's the same as
($a, $b) = split($var, $_);
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 5 Jan 1999 13:46:16 GMT
From: tdelong1@osf1.gmu.edu (Timothy P Delong)
Subject: Re: Unusual behavior of the int function.
Message-Id: <76t538$n56@portal.gmu.edu>
Tad McClellan (tadmc@metronet.com) wrote:
: Timothy P Delong (tdelong1@osf1.gmu.edu) wrote:
:: I assigned the value in question to a variable. I then printed that
:: variable. I did an int on the variable and assigned the result back
:: to itself. I then printed the variable again. For this all printing
:: was done with print.
:: The results of the output are:
:: 75
:: 74
: Where's the code that you are speaking of?
It won't be helpful, but ok, here is what the section looks like.
[ Code above here is a loop that does some addition, division, etc.
Normal math, just lots of it. ]
$tmp = $perday;
print "$perday\n"; [ Added for debugging ]
$perday = int $perday;
print "$perday\n"; [ Added for debugging ]
[ Code below here is for printing results into html. ]
Now, the first print shows 75, the second shows 74. The method of testing the
entire body of code, of which this is a very minor piece, was to use many sets
of test data. One set had a problem and it was due to this section of code.
All other sets passed through here perfectly fine.
Tim
------------------------------
Date: 5 Jan 1999 13:57:07 GMT
From: tdelong1@osf1.gmu.edu (Timothy P Delong)
Subject: Re: Unusual behavior of the int function.
Message-Id: <76t5nj$n56@portal.gmu.edu>
Pythagoras Watson (py@ecst.csuchico.edu) wrote:
: While your actual code would be a real help, I am going to guess that you
: are running into floating-point rounding difficulties. The number is close
: enough to 75 to be rounded automatically by the print function, but
: actually less than 75, so the int function gives 74. The following might
: be instructive:
: #!/usr/local/bin/perl -w
: $n = 74.99999999999999;
: print "$n -- ", int($n), "\n";
: printf "%.13f -- %.14f\n", $n, $n;
: if ($n < 75) { print "yes\n"; } else { print "no\n"; }
: When run on my computer, the above results in:
: 75 -- 74
: 75.0000000000000 -- 74.99999999999999
: yes
I did some more checking a moment ago and sure enough, that was the problem.
The number is actually 74.9999999999999.
Thank you, and everyone else that posted. :)
Tim
------------------------------
Date: Tue, 05 Jan 1999 14:31:45 GMT
From: pheon@hevanet.com (Andy Davidson)
Subject: Web server in perl
Message-Id: <369221ee.128543947@news.hevanet.com>
Is there a web server in perl? I am in need of very simple server for
use on isloated laptops where I would like to add some form processing
to a set of pages. Has anyone done this? I couldn't find anything
searching CPAN et al.
andy
------------------------------
Date: Tue, 05 Jan 1999 16:22:45 +0100
From: "J|rgen Ibelgaufts" <ibelgaufts@gfc-net.de>
Subject: Re: Web server in perl
Message-Id: <36922E45.9C58242C@gfc-net.de>
Hi,
it is not very difficult to write web servers in perl. Read the Perl Practicum by
Hal Pomeranz at:
http://www.usenix.org/publications/perl/
Enjoy
Juergen Ibelgaufts
------------------------------------------------------------------------
Andy Davidson schrieb:
>
> Is there a web server in perl? I am in need of very simple server for
> use on isloated laptops where I would like to add some form processing
> to a set of pages. Has anyone done this? I couldn't find anything
> searching CPAN et al.
>
> andy
------------------------------
Date: 5 Jan 1999 11:27:58 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Web server in perl
Message-Id: <76teie$sml@panix.com>
In <369221ee.128543947@news.hevanet.com> pheon@hevanet.com (Andy Davidson) writes:
>Is there a web server in perl? I am in need of very simple server for
>use on isloated laptops where I would like to add some form processing
>to a set of pages. Has anyone done this? I couldn't find anything
>searching CPAN et al.
Check the http section of Perl Reference:
http://reference.perl.com/query.cgi?http
--
Clay Irving
clay@panix.com
------------------------------
Date: Tue, 05 Jan 1999 15:23:14 +0100
From: "J|rgen Ibelgaufts" <ibelgaufts@gfc-net.de>
Subject: which database to take for perl + tk + win32?
Message-Id: <36922052.F9D23FA0@gfc-net.de>
Hi there,
I want to rewrite an old dBASE program with perl and tk. I looked at Win32::ODBC
which seems to give access to some .dbm files. Now I am stuck putting the things
togetner. Is it a good way to reuse the old .dbf files with odbc, or would it be
better to use another database (is there anything freely available for windows
nt?) I am not a windows freak so I do not like delphi, visual basic and access.
Hmm, questions over questions. Does anyone out there hava any experiences he (she)
would like to share?
Thanks
Juergen Ibelgaufts
------------------------------
Date: Tue, 5 Jan 1999 12:51:27 +0100
From: "Taco Bell" <Taco.Bell@rulez.the.net>
Subject: Re: why this doesn't work
Message-Id: <76subp$ikj$1@hdxf08.telecom.ptt.nl>
Should be more like the following. It's not completly correct but it gives
an idea where to find the answer.
open(MYFILE, "$image")|| die "Error opening file : $!";
$fileimage = @MYFILE;
close(MYFILE);
print "content-type:image\n\n"
print $fileimage;
it should more like this, you should print the content of the image file and
you have to put a http-header in front of it so the browser knows it will be
an image.
etrim@my-dejanews.com wrote in message <76smf8$n39$1@nnrp1.dejanews.com>...
>hi, i thought crating a simple perl script (and i have to do it in perl)
and
>calling it from web site would work but it didn't (i don't know much about
>perl).
>This is what i want: i want to display an image (only one static image) on
the
>HTML page by calling a perl script.
>HTML page:
><HTML><BODY><IMG SRC="http://host/cgi-bin/myscript.pl"></BODY></HTML>
>
>myscript.pl script:
>#!/usr/bin/perl
>$image = "http://host/myimage.gif";
>print $image;
>
>The script is chmod 755 (tried 777) but it gives me 500 internal server
error.
>If i execute the script from unix it correctly outputs
http://host/myimage.gif
>and therefore i think it should correctly put that into HTML: <IMG
>SRC="http://host/myimage.gif"> but it doesn't do that.
>
>Any help would be appreciated,
>
>thanx
>
>Erik.
>
>P.S. Later on, the plan is to add something like this: <HTML><BODY><IMG
>SRC="http://host/cgi-bin/myscript.pl?ID=myid"></BODY></HTML> which will
count
>how many times the image myimage.gif was displayed by the page containing
ID
>myid
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 05 Jan 1999 12:54:49 GMT
From: dave@mag-sol.com
Subject: Re: why this doesn't work
Message-Id: <76t22p$voq$1@nnrp1.dejanews.com>
In article <76smf8$n39$1@nnrp1.dejanews.com>,
etrim@my-dejanews.com wrote:
> hi, i thought crating a simple perl script (and i have to do it in perl) and
> calling it from web site would work but it didn't (i don't know much about
> perl).
> This is what i want: i want to display an image (only one static image) on the
> HTML page by calling a perl script.
> HTML page:
> <HTML><BODY><IMG SRC="http://host/cgi-bin/myscript.pl"></BODY></HTML>
>
> myscript.pl script:
> #!/usr/bin/perl
> $image = "http://host/myimage.gif";
> print $image;
>
> The script is chmod 755 (tried 777) but it gives me 500 internal server error.
> If i execute the script from unix it correctly outputs http://host/myimage.gif
> and therefore i think it should correctly put that into HTML: <IMG
> SRC="http://host/myimage.gif"> but it doesn't do that.
If you're writting a CGI script then you need to output the the correct CGI
headers. If you don't, it won't work. Try searching for CGI at
<http://www.perl.com> to get some reading matter that will put you straight.
hth,
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 05 Jan 1999 14:43:12 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: why this doesn't work
Message-Id: <369216F0.CA03595D@ngb.se>
> hi, i thought crating a simple perl script
You're using the cgi-script as a javascript -- The perlscript cannot
output something to the page... Either you do this
print "Content-Type: text/html\n\n";
print '<HTML><BODY><IMG
SRC="http://host/cgi-bin/myscript.pl"></BODY></HTML>';
and link to the script instead of the page (easy solution), or use what
Taco Bell suggested, and output the contents of the image, although I
think you should be careful with this. Read the file in binmode and so
on...
Or, you might be able to output a http-redirect (I haven't tried this
with images)
print "Location: $image\n\n";
------------------------------
Date: 5 Jan 1999 11:14:38 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: why this doesn't work
Message-Id: <76tdpe$qra@panix.com>
In <76subp$ikj$1@hdxf08.telecom.ptt.nl> "Taco Bell" <Taco.Bell@rulez.the.net> writes:
>Should be more like the following. It's not completly correct but it gives
>an idea where to find the answer.
If its "not completly correct," why bother posting it for a newbie?
[ nasty code omitted... ]
Basic plain-jane example:
#!/usr/local/bin/perl5
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<BODY>\n";
print "<img src=camel.gif alt=\"The image\">\n";
print "<\/BODY>\n";
Better example using the CGI.pm module which is included in the Perl
distribution:
#!/usr/local/bin/perl5
use CGI qw(:standard);
print header,
start_html(),
img({-src=>'camel.gif', -alt=>'The image'}),
end_html();
--
Clay Irving
clay@panix.com
------------------------------
Date: Tue, 05 Jan 1999 11:21:56 -0500
From: Ruben I Safir <ruben@llinderman.dental.nyu.edu>
Subject: Re: Writing many files efficiently
Message-Id: <36923C24.119C67F4@llinderman.dental.nyu.edu>
When I do something like this, I fork the process over and
this seems to work much faster.
Related to this, we often need to make a global change on a website with
maybe 10000 files.
We did something like this:
#! /usr/bin/perl
$direct = $ARGV[0] . "/";
$| = 1;
print "\nTOP DIRECTORY is $direct \n";
opendir(DATABASE, "$direct") || die "can't open WWW Directory";
@allfiles = readdir DATABASE;
for( $i=0; $i<@allfiles; $i++){
#print "$i : $allfiles[$i] \n";
next if( $allfiles[$i] =~ /^\.+/);
# print "CURRENT FILE $direct"."$allfiles[$i] \n";
if( -d "$direct"."$allfiles[$i]" ){
print "We have a directory $direct $allfiles[$i] \n";
$pid = fork;
if ($pid ){
print STDOUT "\nPARENT PID: $pid \n";
next if( $allfiles[$i] !~ /\.htm/);
&passit;
wait;
}
elsif($pid == 0 ){
print STDOUT "\n\n CHILD: $direct" . "$allfiles[$i] ";
exec ($0, "$direct". "$allfiles[$i]");
# exit;
}
}
else{
next if( $allfiles[$i] !~ /\.htm/);
&passit;
}
}
sub passit{
open( WORKING_FILE, "$direct"."$allfiles[$i]") or die "Can't open
$allfiles[$i]";
open(out_file, ">$direct" . "$allfiles[$i].new");
print "\n PARSEOUT: $direct"."$allfiles[$i].new\n";
while($parse_file = <WORKING_FILE>){
$parse_file =~
s/http:\/\/128.122.223.103\/www\//http:\/\/rsafir2.dental.nyu.edu\//g;
# open(out_file, ">>$direct" . "$allfiles[$i].new");
print out_file $parse_file;
}
close(out_file);
}
Ruben
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4553
**************************************