[18959] in Perl-Users-Digest
Perl-Users Digest, Issue: 1154 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 18 18:09:01 2001
Date: Mon, 18 Jun 2001 15:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <992901911-v10-i1154@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 18 Jun 2001 Volume: 10 Number: 1154
Today's topics:
[ map { @{ $_ || [ ] } } @$to ] (what does this mean?) <dg@sfs.nphil.uni-tuebingen.de>
Re: [ map { @{ $_ || [ ] } } @$to ] (what does this mea <rsherman@ce.gatech.edu>
Re: [ map { @{ $_ || [ ] } } @$to ] (what does this mea nobull@mail.com
Re: Access Sybase from PERL on NT <dbusby3@slb.com>
DBM in a CGI (please help) <amittai@amittai.com>
Re: DBM in a CGI (please help) <jhall@ifxonline.com>
Re: File::Find skips the leaf nodes in a directory tree (jon chang)
Re: File::Find skips the leaf nodes in a directory tree (Charles DeRykus)
Re: File::Find skips the leaf nodes in a directory tree <ren@tivoli.com>
help with the perl scripts u518615722@spawnkill.ip-mobilphone.net
Re: Install Perl on HP <h.m.brand@hccnet.nl>
Re: Looking for DB Extension for Perl v5 to work with O <gnarinn@hotmail.com>
Re: LOOKING FOR PERL JOBS (David H. Adler)
Re: Mix JS variables - David Eff.. (BUCK NAKED1)
modulesmanpages Greymaus
Re: modulesmanpages <comdog@panix.com>
Re: modulesmanpages <gnarinn@hotmail.com>
Performance Advice: CGI servers files (Ted Smith)
Re: Performance Advice: CGI servers files <buggs-clpm@splashground.de>
Re: Performance Advice: CGI servers files <bop@mypad.com>
Perl 4 Book (Michael)
Re: Printing filenames that are in a directory (E.Chang)
Re: Q: How to make a Perlscript Shareware? <camerond@mail.uca.edu>
Re: Re: I can't belive I'm asking this here... <kimmfc@mydeja.com>
Re: setting @INC at perl compile time (Andy Dougherty)
Simple Info Aggregation Perl Sample Scrip? <mark_chou@hotmail.com>
Re: Simple Info Aggregation Perl Sample Scrip? <andras@mortgagestats.com>
Re: Simple Info Aggregation Perl Sample Scrip? <Allan@due.net>
Re: Simple Info Aggregation Perl Sample Scrip? <ren@tivoli.com>
Storing a hash in a DBM file - example wanted. <patelnavin@icenet.net>
UserAgent <esheesley@mitre.org>
Re: UserAgent <tony_curtis32@yahoo.com>
Re: UserAgent <comdog@panix.com>
Re: windows 2000 <comp-lang-perl-misc@-spambreak-southcot.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 18 Jun 2001 17:24:59 +0200
From: Dale Gerdemann <dg@sfs.nphil.uni-tuebingen.de>
Subject: [ map { @{ $_ || [ ] } } @$to ] (what does this mean?)
Message-Id: <3B2E1D4B.235BFF22@sfs.nphil.uni-tuebingen.de>
In the book "Algorithms with Perl" (Orwant et al), the code
from the subject line:
[ map { @{ $_ || [ ] } } @$to ]
is used to concatenate the bins in a radix sort (p. 146). At
least the comment says that's what it does, but I don't have
a clue how this works. Help, anyone?
Thanks,
Dale Gerdemann
------------------------------
Date: Mon, 18 Jun 2001 12:38:45 +0500
From: Robert Sherman <rsherman@ce.gatech.edu>
Subject: Re: [ map { @{ $_ || [ ] } } @$to ] (what does this mean?)
Message-Id: <3B2DB005.4005F9E2@ce.gatech.edu>
Dale Gerdemann wrote:
> In the book "Algorithms with Perl" (Orwant et al), the code
> from the subject line:
>
> [ map { @{ $_ || [ ] } } @$to ]
>
> is used to concatenate the bins in a radix sort (p. 146). At
> least the comment says that's what it does, but I don't have
> a clue how this works. Help, anyone?
>
> Thanks,
>
> Dale Gerdemann
perldoc -f map
<snip>
Evaluates the BLOCK or EXPR for each element of LIST
(locally setting "$_" to each element) and returns
the list value composed of the results of each such
evaluation.
</snip>
so this dereferences the array reference $to and maps the block to each
element in that array
the [] is used to create an anonymous array reference.
hth
-rob
------------------------------
Date: 18 Jun 2001 18:03:24 +0100
From: nobull@mail.com
Subject: Re: [ map { @{ $_ || [ ] } } @$to ] (what does this mean?)
Message-Id: <u9lmmp90v7.fsf@wcl-l.bham.ac.uk>
Dale Gerdemann <dg@sfs.nphil.uni-tuebingen.de> writes:
> In the book "Algorithms with Perl" (Orwant et al), the code
> from the subject line:
>
> [ map { @{ $_ || [ ] } } @$to ]
>
> is used to concatenate the bins in a radix sort (p. 146). At
> least the comment says that's what it does,
Sounds about right. Given a reference to a sparse array of arrayref
in $to it returns a single array.
So if:
$to = [ [ 4,5,6 ], undef, [7,8]];
The result of the above expression is:
[ 4,5,6,7,8 ];
> but I don't have a clue how this works.
Clues can be found in the Perl reference manuals. If you don't have
Perl reference manuals you should not be attempting to read
"Algorithms with Perl". If you do have reference manuals your
statement "I don't have a clue" is not true.
> Help, anyone?
Once you have looked up all the constucts used above in the manual
then I'm sure lots of people will be eager to help with any questions
you may have. Simply treating newsgroups as an alternative to
consulting manuals is not encouraged.
[ LIST ] is an anonymous array reference constructor described in perlref.
[ ] is an empty anonymous array reference constructor.
map {BLOCK} LIST is the map function described in perlfunc.
@{BLOCK} and @$var are dereferencing a an array reference as described
in perlref.
$_ is the default scalar variable ("the current thing") used by,
amongst other things, the map() function. It is described in perlvar.
|| is the lazy "or" operator as described in perlop.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 18 Jun 2001 12:09:30 -0500
From: David Busby <dbusby3@slb.com>
Subject: Re: Access Sybase from PERL on NT
Message-Id: <3B2E35CA.968509E9@slb.com>
That is correct and I think I did everything correct but I get an error in
DynaLoader.pm line 206. I am not sure how to proceed in trying to diag./fix
Michael Peppler wrote:
> In article <db67a7f3.0106160724.36e9b72d@posting.google.com>, "isterin"
> <isterin@hotmail.com> wrote:
>
> > David Busby <dbusby3@slb.com> wrote in message
> > news:<3B2A6B46.230A1369@slb.com>...
> >> Does anyone know how to access sybase from PERL running on NT with IIS.
> >
> > Yes. Are you trying to access from a non wintel platform, or are both
> > the Perl script and the server on the wintel platform?
> >
> >> I have tried several times but keep getting the error that for some
> >> reason PERL can't load the sybperl::dblib or sybperl::ctlib dll files
> >> from dynaloader.pm. If anyone has any suggestions please let me know.
> >
> > Did you install DBI/DBD::Sybase successfully? If yes let's see a snip
> > of your code.
>
> He's trying to use the Sybase::* modules (aka sybperl). I think he's
> installed the ActiveState versions of these modules, but I'm not sure.
>
> In any case he needs to make sure that the Sybase client libraries are
> properly installed.
>
> Michael
>
> >> Thanks in advance.
> >>
> >> Please send email to dbusby@houston.geoquest.slb.com
>
> --
> Michael Peppler - Data Migrations Inc. - mpeppler@peppler.org
> http://www.mbay.net/~mpeppler - mpeppler@mbay.net
> International Sybase User Group - http://www.isug.com
> Sybase on Linux mailing list: ase-linux-list@isug.com
------------------------------
Date: Mon, 18 Jun 2001 21:22:38 +0200
From: "Amittai Aviram" <amittai@amittai.com>
Subject: DBM in a CGI (please help)
Message-Id: <9glkh8$5hg$1@rznews2.rrze.uni-erlangen.de>
I am just getting started in both Perl and Unix. A project I am building
takes data from a form and stores it in a series of DBM database files.
Since I use Windows 98 (sorry!) at home, I have been working with Perl for
Windows and the Personal Web Server(PWS), where everything seems to work
fine. Not so on my Unix server. As a test, I wrote a small script that
would create a DBM in my Unix shell account. This _did_ work when I ran the
script from the command line, but when I made the necessary small changes
and tried running the script as a true CGI script from my browser, it did
not create the DBM database file. Other circumstances were identical -- in
both cases, I uploaded the program in ASCII to my CGI-BIN directory and
assigned it 755 permissions. When I point my browser to the script, I do
get the HTML text on my screen (colors, etc.), but no DBM is created. My
account is on a FreeBSD system. Below is my simple script. What am I doing
wrong? I would be grateful for any suggestions or help with regard to
getting a CGI script to read and write data to and from DBM files on a Unix
server. Thanks!
Amittai amittai@amittai.com
#!/usr/local/bin/perl
print <<HTML;
Content-type: text/html
<head>
<title>DBM Test</title>
</head>
<body bgcolor="#dd0000" text="white">
<h1>This is a test to see whether a DBM is being created</h1>
HTML
%fruits =
(
"one" => "apples",
"two" => "oranges",
"three" => "pears",
"four" => "plums",
"five" => "peaches"
);
@keys = keys %fruits;
print "<p>@keys</p>\n";
dbmopen (%DATA, "database2", 0666) || die "$!";
%DATA = %fruits;
dbmclose (%DATA) || die "$!";
print <<HTML;
</body>
</html>
HTML
------------------------------
Date: Mon, 18 Jun 2001 21:47:30 GMT
From: "John Hall" <jhall@ifxonline.com>
Subject: Re: DBM in a CGI (please help)
Message-Id: <SFuX6.54890$%a.2759560@news1.rdc1.sdca.home.com>
Make sure that the account the webserver is running under has permission to
write in the directory where your DBM files will be stored. It has to be
able to create the files in the directory. Look in the logs for those kinds
of failures, after you make your 'or die' statement after the dbmopen
command more informative.
"Amittai Aviram" <amittai@amittai.com> wrote in message
news:9glkh8$5hg$1@rznews2.rrze.uni-erlangen.de...
> I am just getting started in both Perl and Unix. A project I am building
> takes data from a form and stores it in a series of DBM database files.
> Since I use Windows 98 (sorry!) at home, I have been working with Perl for
> Windows and the Personal Web Server(PWS), where everything seems to work
> fine. Not so on my Unix server. As a test, I wrote a small script that
> would create a DBM in my Unix shell account. This _did_ work when I ran
the
> script from the command line, but when I made the necessary small changes
> and tried running the script as a true CGI script from my browser, it did
> not create the DBM database file. Other circumstances were identical --
in
> both cases, I uploaded the program in ASCII to my CGI-BIN directory and
> assigned it 755 permissions. When I point my browser to the script, I do
> get the HTML text on my screen (colors, etc.), but no DBM is created. My
> account is on a FreeBSD system. Below is my simple script. What am I
doing
> wrong? I would be grateful for any suggestions or help with regard to
> getting a CGI script to read and write data to and from DBM files on a
Unix
> server. Thanks!
>
> Amittai amittai@amittai.com
>
> #!/usr/local/bin/perl
>
> print <<HTML;
> Content-type: text/html
>
> <head>
> <title>DBM Test</title>
> </head>
>
> <body bgcolor="#dd0000" text="white">
>
> <h1>This is a test to see whether a DBM is being created</h1>
>
> HTML
>
> %fruits =
> (
> "one" => "apples",
> "two" => "oranges",
> "three" => "pears",
> "four" => "plums",
> "five" => "peaches"
> );
>
> @keys = keys %fruits;
>
> print "<p>@keys</p>\n";
>
>
> dbmopen (%DATA, "database2", 0666) || die "$!";
> %DATA = %fruits;
> dbmclose (%DATA) || die "$!";
>
> print <<HTML;
> </body>
> </html>
> HTML
>
>
>
------------------------------
Date: 18 Jun 2001 10:26:03 -0700
From: jonchang@my-deja.com (jon chang)
Subject: Re: File::Find skips the leaf nodes in a directory tree?
Message-Id: <774e29f8.0106180926.1bf5569d@posting.google.com>
Thanks to both the people who replied with their scripts. Unfortunately,
they too don't take care of the leaf directories if they are empty.
Perhaps some File::Find experts need to look into this.
Regards,
"John W. Krahn" <krahnj@acm.org> wrote in message news:<3B2AD72F.DC969227@acm.org>...
> jon chang wrote:
> >
> > Hi,
> >
> > I'm trying to write a small script that'd scan a directory recursively
> > and create a blank index.html in each subdirectory where no index.html,
> > index.htm, or index.cgi is found.
> >
> > I found the following script skipping the leaf nodes of a directory. Any
> > help would be appreciated.
> >
> > Also, is there a better way of doing things below in Perl, instead
> > of invoking system() call.
> >
> > Regards.
> >
> > #!/usr/local/bin/perl -w
> >
> > use File::Find;
> > @ARGV = ('.') unless @ARGV;
> > find sub {
> > if ( !(-e 'index.cgi' || -e 'index.html' || -e 'index.htm') ) {
> > system("touch index.html; chown www:www index.html; chmod 644 index.html")
> > ;
> > }
> > }, @ARGV;
>
>
> #!/usr/local/bin/perl -w
> use strict;
> use File::Find;
> @ARGV = ('.') unless @ARGV;
> my $indexfile = 'index.html';
> find sub {
> return if -e $indexfile or -e 'index.htm' or -e 'index.cgi';
> if ( open TEMP, "> $indexfile" ) {
> close TEMP;
> chown scalar getpwnam( 'www' ), scalar getgrnam( 'www' ),
> $indexfile;
> chmod 0644, $indexfile;
> return;
> }
> warn "Cannot create $indexfile: $!";
> }, @ARGV;
>
>
>
> John
------------------------------
Date: Mon, 18 Jun 2001 19:35:27 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: File::Find skips the leaf nodes in a directory tree?
Message-Id: <GF5533.E3t@news.boeing.com>
In article <774e29f8.0106180926.1bf5569d@posting.google.com>,
jon chang <jonchang@my-deja.com> wrote:
>Thanks to both the people who replied with their scripts. Unfortunately,
>they too don't take care of the leaf directories if they are empty.
>Perhaps some File::Find experts need to look into this.
>
>
A possible workaround:
use File::Find;
@ARGV = (".") unless @ARGV;
my @dirs;
find
sub {
my $d = $File::Find::dir;
push @dirs, "$d/$_"
if -d $_ and ! (-e "$d/index.cgi" || -e "$d/index.html" ||
-e "$d/index.htm");
} , @ARGV;
foreach my $dir (@dirs) { open ... chmod ... etc. }
__END__
--
Charles DeRykus
------------------------------
Date: 18 Jun 2001 13:25:15 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: File::Find skips the leaf nodes in a directory tree?
Message-Id: <m3d781fxx0.fsf@dhcp9-173.support.tivoli.com>
[Jeopardectomy]
On 18 Jun 2001, jonchang@my-deja.com wrote:
>> jon chang wrote:
>> >
>> > Hi,
>> >
>> > I'm trying to write a small script that'd scan a directory
>> > recursively and create a blank index.html in each subdirectory
>> > where no index.html, index.htm, or index.cgi is found.
>> >
>> > I found the following script skipping the leaf nodes of a
>> > directory. Any help would be appreciated.
>> >
>> > Also, is there a better way of doing things below in Perl,
>> > instead of invoking system() call.
>> >
>> > Regards.
>> >
>> > #!/usr/local/bin/perl -w
>> >
>> > use File::Find;
>> > @ARGV = ('.') unless @ARGV;
>> > find sub {
>> > if ( !(-e 'index.cgi' || -e 'index.html' || -e 'index.htm') )
>> > { system("touch index.html; chown www:www index.html; chmod
>> > 644 index.html")
>> > ;
>> > }
>> > }, @ARGV;
>>
> Thanks to both the people who replied with their
> scripts. Unfortunately, they too don't take care of the leaf
> directories if they are empty. Perhaps some File::Find experts need
> to look into this.
The problem you're running into is hard for me to describe, but
basically, you are expecting the current directory to be each
subdirectory in turn. However, the current directory is only set when
a *file* is being examined.
What you really want to do is look at *directories*, not files, and
then look inside the directory.
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
@ARGV = "." unless @ARGV;
find sub {
-d || return; # only care about directories
unless ( -e "$File::Find::name/index.cgi" ||
-e "$File::Find::name/index.html" ||
-e "$File::Find::name/index.htm" ) {
my $file = "$File::Find::name/index.html";
my $fh;
open $fh, ">", $file
and close $fh
or warn "Could not create $file, $!\n";
my $uid = getpwnam "www";
my $gid = getgrnam "www";
chown $uid, $gid, $file;
chmod 0644, $file;
}
}, @ARGV;
__END__
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Mon, 18 Jun 2001 18:32:53 GMT
From: u518615722@spawnkill.ip-mobilphone.net
Subject: help with the perl scripts
Message-Id: <l.992889174.1843963623@[198.138.198.252]>
We need to run the following scripts to change phone #s once a while.
perl -pi.bak -e 's/string1/string2/g' `find /opt2/oracle/product/ 8.1.7/dba/ -name "*" -print`
because we have hundreds of files and sub-directories so we can not
change them one by one. Sometimes somebody put a huge dmp files w/o let us know, so we will run out of spaces by running this scripts.
How can we make smarter that it will only make a copy of the files
that get changed and do not make copy of those that are not changed?
Thanks
--
Sent by dbadba62 from hotmail within field com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.com/cgi/content/new
------------------------------
Date: Mon, 18 Jun 2001 17:58:20 +0200
From: "H. Merijn Brand" <h.m.brand@hccnet.nl>
To: comp.lang.perl.misc
Subject: Re: Install Perl on HP
Message-Id: <Xns90C4B6D2E86CCMerijn@192.0.1.90>
Philip Newton <pne-news-20010618@newton.digitalspace.net> wrote in
news:tbkrit8819c20ebmt5m9dgs4ipo06jsak0@4ax.com:
> On Mon, 18 Jun 2001 11:28:48 +0200, "H. Merijn Brand"
><h.m.brand@hccnet.nl> wrote:
>
>> Philip Newton <pne-news-20010617@newton.digitalspace.net> wrote in
>> news:1q4pit4so3hcel3lrlqgkhcvm3grej7uo1@4ax.com:
>> >> so before I install, should I clean up previous version ?
>> >
>> > With 4.036, that shouldn't be necessary.
>>
>> Would be very bad for the system too, cause HP uses this for their
>> updates. (HP has plans to upgrade to perl5 for internal use ;-)
>
> They do? I thought the perl4 that comes with HP-UX was only for the
> kernel debugger q4 and for nothing else (just like the cc that comes
> with it is *only* for rebuilding the kernel, so it doesn't need any
> steenking ANSI compliance).
Ever studied the way swinstall works? (or swlist or swremove or ...)
Shhhhst, don't anyone else ... ;-)
When you are arguing with some customer about using open source software in a
/real/ project, and they object, propose to remove perl from the system, and
then ask them to install a patch from CD. Have the appropriate amount of fun
(or duck and run).
http://devresource.hp.com/OpenSource/ and
http://devresource.hp.com/OpenSourcebin/ are great examples of HP's effort
into the open source world. Use it!
--
H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
using perl-5.6.1, 5.7.1 & 626 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
WinNT 4, Win2K pro & WinCE 2.11 often with Tk800.022 &/| DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
------------------------------
Date: Mon, 18 Jun 2001 15:19:37 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: Looking for DB Extension for Perl v5 to work with Oracle (ex OraPerl)
Message-Id: <992877577.0169126242399216.gnarinn@hotmail.com>
In article <GF4qB7.x4w@alfalfa.utcs.utoronto.ca>,
Daniel Czajko <czajko@ocas.on.ca> wrote:
>I'm running some Perl programs that access INGRES DB. We are currently
>switching to an Oracle DB, rendering my IngPerl code a little useless. I
>need to be able to find some kind of a DB extension (like OraPerl) that
>would help me access the new Oracle DB using Perl v5. I have been able to
>find one, (OraPerl) but it will not work with Perl v.5, which is what I'm
>running.
>
>Or perhaps there is some other program what would help me access an Oracle
>DB with Perl v5.
>
You should go for DBI and DBD::Oracle
>Does anyone know where I can find such an extension
CPAN
good luck
gnari
------------------------------
Date: 18 Jun 2001 17:46:50 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: LOOKING FOR PERL JOBS
Message-Id: <slrn9isfka.hu6.dha@panix2.panix.com>
In article <120620012310093500%cometlinear@yahoo.com>, dot-comet wrote:
> I am interested in doing small/medium-scale perl programming jobs.
You have posted a job posting or a resume in a technical group.
Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.
Had you read and understood the Usenet user manual posted frequently to
"news.announce.newusers", you might have already known this. :) (If
n.a.n is quieter than it should be, the relevent FAQs are available at
http://www.faqs.org/faqs/by-newsgroup/news/news.announce.newusers.html)
Another good source of information on how Usenet functions is
news.newusers.questions (information from which is also available at
http://www.geocities.com/nnqweb/).
Please do not explain your posting by saying "but I saw other job
postings here". Just because one person jumps off a bridge, doesn't
mean everyone does. Those postings are also in error, and I've
probably already notified them as well.
If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.
http://jobs.perl.org may be of more use to you
Yours for a better usenet,
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Hello breasts! - subbes
------------------------------
Date: Mon, 18 Jun 2001 14:12:41 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Mix JS variables - David Eff..
Message-Id: <18991-3B2E52A9-81@storefull-247.iap.bryant.webtv.net>
"I had already tried sprintf, double quotes, [etc]. and that didn't work
either. Can you see any other reason why $ref is not interpolating?"
"etc" included trying it without any quotes. Now, what part of "etc" and
"did not work" did YOU not understand, O Wise One???
Either answer the question or don't; but trying to be a wise-ass is not
helpful.
--Dennis
------------------------------
Date: 18 Jun 2001 14:41:06 -0500
From: Greymaus
Subject: modulesmanpages
Message-Id: <3b2e5952@post.newsfeeds.com>
*** post for FREE via your newsreader at post.newsfeeds.com ***
I have installed lots of modules off cpan , I can scroll
these with xman
but with X temporarily out :) , any ideas how to
find out
what I have installed ?
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 90,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Mon, 18 Jun 2001 16:28:05 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: modulesmanpages
Message-Id: <comdog-55E11B.16280518062001@news.panix.com>
In article <3b2e5952@post.newsfeeds.com>, Greymaus wrote:
> I have installed lots of modules off cpan , I can scroll
> these with xman
> but with X temporarily out :) , any ideas how to
> find out
> what I have installed ?
do you just want to see what you have installed?
http://www.ddj.com/columns/perl/2001/0105pl001/0105pl001.htm
it's lynx friendly even. :)
--
brian d foy <comdog@panix.com>
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html
------------------------------
Date: Mon, 18 Jun 2001 20:06:40 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: modulesmanpages
Message-Id: <992894800.979425533208996.gnarinn@hotmail.com>
In article <3b2e5952@post.newsfeeds.com>, <Greymaus> wrote:
>*** post for FREE via your newsreader at post.newsfeeds.com ***
>
> I have installed lots of modules off cpan , I can scroll
>these with xman
> but with X temporarily out :) , any ideas how to
>find out
> what I have installed ?
>
perldoc perllocal
perldoc perlmodlib
this has been discussed before:
http://groups.google.com/groups?q=installed+perl+modules
gnari
------------------------------
Date: 18 Jun 2001 13:58:22 -0700
From: bluearchtop@my-deja.com (Ted Smith)
Subject: Performance Advice: CGI servers files
Message-Id: <9d2caaf1.0106181258.2598b6e1@posting.google.com>
I have a simple cgi that takes files (below the doctree) and serves it
to authenticated users over HTTPS. I can't use FTP. When the files
are big, 20-30MB usually, it takes a while to download obviously. The
perl process is pretty high. And when there are a lot of people
downloading, the server crawls. Anything I can do that you suggest?
I do a simple:
1) Set content-disposition/content-type
2) open (FILE,"file.zip");
binmode(STDOUT);
while (<FILE>) {
print $_;
}
3) cleanup
------------------------------
Date: Mon, 18 Jun 2001 23:18:04 +0200
From: buggs <buggs-clpm@splashground.de>
Subject: Re: Performance Advice: CGI servers files
Message-Id: <9glr3s$qgr$01$1@news.t-online.com>
Ted Smith wrote:
> I have a simple cgi that takes files (below the doctree) and serves it
> to authenticated users over HTTPS. I can't use FTP. When the files
> are big, 20-30MB usually, it takes a while to download obviously. The
> perl process is pretty high. And when there are a lot of people
> downloading, the server crawls. Anything I can do that you suggest?
Do not use Perl.
Use better hardware.
Use another NG.
Buggs
------------------------------
Date: Mon, 18 Jun 2001 17:40:52 -0400
From: "flash" <bop@mypad.com>
Subject: Re: Performance Advice: CGI servers files
Message-Id: <exuX6.16202$uR5.1390220@news20.bellglobal.com>
try using perlcc or perl2exe
--
#--*--*--*--*--*--*--*--*--*--*--#
# The smash script archive. #
# http://www.floodbox.com #
#--*--*--*--*--*--*--*--*--*--*--#
"Ted Smith" <bluearchtop@my-deja.com> wrote in message
news:9d2caaf1.0106181258.2598b6e1@posting.google.com...
> I have a simple cgi that takes files (below the doctree) and serves it
> to authenticated users over HTTPS. I can't use FTP. When the files
> are big, 20-30MB usually, it takes a while to download obviously. The
> perl process is pretty high. And when there are a lot of people
> downloading, the server crawls. Anything I can do that you suggest?
>
> I do a simple:
>
> 1) Set content-disposition/content-type
> 2) open (FILE,"file.zip");
> binmode(STDOUT);
> while (<FILE>) {
> print $_;
> }
> 3) cleanup
>
------------------------------
Date: 18 Jun 2001 13:33:44 -0700
From: msperanza@rtnyc.com (Michael)
Subject: Perl 4 Book
Message-Id: <c1d4e54.0106181233.5ccb79e8@posting.google.com>
Any one have a Perl 4 Book collecting dust that they would like to sell?
thanks
mike
------------------------------
Date: Mon, 18 Jun 2001 15:34:19 GMT
From: echang@netstorm.net (E.Chang)
Subject: Re: Printing filenames that are in a directory
Message-Id: <Xns90C4762E68F25echangnetstormnet@207.106.93.86>
"John Imrie" <john.imrie@pa.press.net> wrote in
<tWjX6.1442$h45.8975@news.uk.colt.net>:
[snip]
>However to bullit proof the script a test should be done on the
>return value like this
Thanks! Testing the return value gave me the answer I was looking for.
--
EBC
------------------------------
Date: Mon, 18 Jun 2001 12:24:38 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Q: How to make a Perlscript Shareware?
Message-Id: <3B2E3956.17383107@mail.uca.edu>
Tom Klinger wrote:
>
> Cameron Dorey <camerond@mail.uca.edu> schrieb in im Newsbeitrag:
> 3B28DC4C.984AA4A1@mail.uca.edu...
> > Send out your code with a "do not function after xx/xx/xxxx" generated
> > when the program is downloaded and buried in a module somewhere. Then
> > when the user registers, send him/her the replacement module without the
> > die code.
>
> Hi,
>
> this could be one way I may choose, but I still wonder how to write such a
> piece of code which is first protecting your script with an expiration code
> and second hide it in such a way that it will be worth to buy it than rather
> try to onvest a couple of times and remove that pieces of code.
>
> I still try to get some examplecodes but my search is, unfortunatly, not
> very successful.
As I said after that, it will only encourage the smarter clients to pay
for the program, the dumb ones do not understand the concept of "time is
money." So, the best thing to do is to write programs ony smart people
would want to use (by this I do not mean "write a program that is so
convoluted/user-unfriendly that you are wracking your brain just to get
simple things done," but "write a program that does something other than
enable the user to put up a guestbook or download dirty pictures, maybe
write one that predicts the stock market with such accuracy that the
user will think of the cost of the program as less than pocket change").
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Mon, 18 Jun 2001 16:43:40 GMT
From: Kim C <kimmfc@mydeja.com>
Subject: Re: Re: I can't belive I'm asking this here...
Message-Id: <bpasitor8oo27i80nhn33nf1mrn1vdn1lu@4ax.com>
On Mon, 18 Jun 2001 10:13:53 +0200, Philip Newton
<pne-news-20010618@newton.digitalspace.net> wrote:
>[Please use a subject line that relates to the subject of your post]
Will do, sorry.
>On Sun, 17 Jun 2001 23:14:55 GMT, Kim C <kimmfc@mydeja.com> wrote:
>
>> I have an embarrassingly simple question to ask: How does one copy an
>> entire directory (with sub directories if necessary)?
>
>TMTOWTDI. One way is to use File::Find to go through the directory
>structure and then use mkdir and File::Copy. Another would be to shell
>out to a utility program for that purpose (e.g. 'system "cp -R foo bar"'
>or whatever).
>
>> the File::Copy man pages mention File::Copydir
>
>I didn't see that mention. However, it may not be in my version of
>File::Copy.
>
>> but this does not work on my system (win2000 / ActivePerl 5.6).
>
>Where did you find the File::Copydir that didn't work? (There appears to
>be nothing on CPAN by that name.) What did you expect it to do? What did
>it actually do? ("doesn't work" is rather vague.)
>
>> I saw nothing in the FAQ (Win32 or otherwise) and I didn't find anything
>> in the File::Tools,
>
>Where is that available? (Apparently not from CPAN, either.)
>
>> Win32::API or File::Spec::Win32 modules either.
>
>Looking on CPAN for modules matching /^File::/ brought nothing I
>consider likely, so you may have to roll your own method or call an
>external program.
>
>Or write File::CopyDir yourself and submit it to CPAN!
>
>Cheers,
>Philip
The modules mentioned are tools available through ActivePerl's package
manager utility - PPM. Realizing this may be considered blasphemy in
this NG, I've never used CPAN or Perl on any other system than Windows
(ducking rotten vegetables).
File::Copydir (which I was unaware of before I went digging prior to
posting my question) is mentioned inside the documentation for
File::Copy (the version that comes standard with ActivePerl) it reads
as follows:
copydir
copydir takes two directory names. If the second directory does not
exist, it will be created. If it does exist, a directory will be
created in it to copy to. Copydir copies every file and directory from
the source directory (first parameter) to the destination directory
(second parameter). The structure of the source directory will be
preserved, and warnings will be issued if a particular file or
directory cannot be accessed or created.
Return value:
copydir returns true on success and false on failure, though failure
to copy a single file or directory from the source tree may still
result in ``success''. The return value simply indicates whether or
not anything was done.
</doc snippet>
It looks like I'll wind up rolling my own on this one. Thanks for
your help.
Kim
------------------------------
Date: Mon, 18 Jun 2001 17:15:02 -0000
From: doughera@maxwell.phys.lafayette.edu (Andy Dougherty)
Subject: Re: setting @INC at perl compile time
Message-Id: <slrn9isdr6.l8c.doughera@maxwell.phys.lafayette.edu>
In article <eli$0106141555@qz.little-neck.ny.us>, Eli the Bearded wrote:
>So I've playing around with perl 5.6.1 trying to customize the
>build to minimize my use of -Ilibdir and $ENV{PERL5LIB}.
>
>I don't see an easy way to specify the exact list of directories
>to search. And although I specified a binary compatible build,
>and told configure to use my 5.005 and 5.6.1 lib directories,
>I didn't see those get added automatically.
Are you *sure* ? Last time I checked, it worked just as documented in
the INSTALL file.
Perl understands the default library structure. It does not
understand or attempt to guess at non-default library structures.
Perhaps your 5.005 and 5.6.1 lib directories are structured
differently from the default?
>I've ended up pushing a bunch of stuff into the config.sh
>"otherlibdirs" variable, but is that the right way?
If they don't fit into the "normal" scheme, then yes, that's the right
way. "Otherlibdirs" is intended to be a catch-all to handle
unanticipated situations, though I had hoped there wouldn't be too
many such situations.
And how
>much of a bad thing is it to have a directory appear multiple
>times in @INC? I've still got my PERL5LIB environment variable
>for now...
It's probably not so bad. Typically a 'use' statement probably
succeeds on one of the first few directories searched. Having extra
directories listed after that is mostly harmless since those
directories are usually not searched anyway.
If a 'use' statement is going to fail, it will take longer with
multiple entries, but I suspect execution time is probably not your
top consideration in such cases.
--
Andy Dougherty doughera@lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
------------------------------
Date: Mon, 18 Jun 2001 23:08:01 +0800
From: Mark Chou <mark_chou@hotmail.com>
Subject: Simple Info Aggregation Perl Sample Scrip?
Message-Id: <3B2E1950.B9C0F832@hotmail.com>
Dear Perl Guru,
Anyone can help me with a Simple Info Aggregation Perl Sample Scrip?
Basically what I want to do is to have a web page which extract some
simple infomation from different websites and combine them on one web
page. In particular, I want to know how to extract a field from a line?
Such as how to extract, say 3rd field from linw " Simple Info
Aggregation Perl Sample Scrip" which should be "Aggregation". You help
is most appreciated.
--
Thanks & Regards,
Mark
------------------------------
Date: Mon, 18 Jun 2001 11:27:45 -0400
From: Andras Malatinszky <andras@mortgagestats.com>
Subject: Re: Simple Info Aggregation Perl Sample Scrip?
Message-Id: <3B2E1DF1.14E07C7A@mortgagestats.com>
Mark Chou wrote:
> Dear Perl Guru,
>
> Anyone can help me with a Simple Info Aggregation Perl Sample Scrip?
> Basically what I want to do is to have a web page which extract some
> simple infomation from different websites and combine them on one web
> page. In particular, I want to know how to extract a field from a line?
> Such as how to extract, say 3rd field from linw " Simple Info
> Aggregation Perl Sample Scrip" which should be "Aggregation". You help
> is most appreciated.
>
> --
>
> Thanks & Regards,
>
> Mark
The split function would be a handy tool to do what you seem to want. You
can read up on it in perlfunc or your favorite Perl reference.
------------------------------
Date: Mon, 18 Jun 2001 12:44:13 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: Simple Info Aggregation Perl Sample Scrip?
Message-Id: <9glb1u$r81$1@slb6.atl.mindspring.net>
"Mark Chou" <mark_chou@hotmail.com> wrote in message
news:3B2E1950.B9C0F832@hotmail.com...
: Dear Perl Guru,
:
: Anyone can help me with a Simple Info Aggregation Perl Sample Scrip?
: Basically what I want to do is to have a web page which extract some
: simple infomation from different websites and combine them on one web
: page. In particular, I want to know how to extract a field from a line?
: Such as how to extract, say 3rd field from linw " Simple Info
: Aggregation Perl Sample Scrip" which should be "Aggregation". You help
: is most appreciated.
:
$_ = "Simple Info Aggregation Perl Sample Scrip";
my $field = (split)[2];
You will want to read up on split and the module LWP in all likelihood.
HTH
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
They sicken of the calm who know the storm.
- Dorothy Parker
------------------------------
Date: 18 Jun 2001 10:25:57 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Simple Info Aggregation Perl Sample Scrip?
Message-Id: <m3bsnlhksa.fsf@dhcp9-173.support.tivoli.com>
On Mon, 18 Jun 2001, mark_chou@hotmail.com wrote:
> Anyone can help me with a Simple Info Aggregation Perl Sample Scrip?
> Basically what I want to do is to have a web page which extract some
> simple infomation from different websites and combine them on one
> web page. In particular, I want to know how to extract a field from
> a line? Such as how to extract, say 3rd field from linw " Simple
> Info Aggregation Perl Sample Scrip" which should be
> "Aggregation". You help is most appreciated.
Here are a couple of ways. (Keep in mind that element numbering in
Perl starts at 0.)
my $string = " Simple Info Aggregation perl Sample Scrip";
my $one_way = (split ' ', $string)[2];
my $another_way = ($string =~ /\w+/g)[2];
Note that with the split solution it is important to use the literal
" " rather than the more explicit / /, as a split treats a literal
space special -- it ignores leading, trailing and multiple spaces (and
other whitespace).
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Mon, 18 Jun 2001 16:59:30 +0530
From: "Aman Patel" <patelnavin@icenet.net>
Subject: Storing a hash in a DBM file - example wanted.
Message-Id: <9glq29$9li0c$1@ID-93885.news.dfncis.de>
any one has ever used DBM files to store hashes ? i was looking for good
examples, I have already read the documentation, but in vain for finding
good examples.
thanks,
------------------------------
Date: Mon, 18 Jun 2001 13:42:17 -0400
From: Eric Sheesley <esheesley@mitre.org>
Subject: UserAgent
Message-Id: <3B2E3D79.9743AF4F@mitre.org>
I am trying to run a perl script called checklink.pl downloaded from
validator.w3.org. I can't seem to get it to work. I got the latest
version of perl(perl 5.6.1) and compiled and installed it. Still a no
go. Where can I find this library or addon?
Thanks,
Eric
------------------------------
Date: 18 Jun 2001 13:26:28 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: UserAgent
Message-Id: <87ae35lk4r.fsf@limey.hpcc.uh.edu>
>> On Mon, 18 Jun 2001 13:42:17 -0400,
>> Eric Sheesley <esheesley@mitre.org> said:
> Subject: UserAgent
That's not a good subject. It does not summarise the
content of the post at all.
> I am trying to run a perl script called checklink.pl
> downloaded from validator.w3.org. I can't seem to get
> it to work. I got the latest version of perl(perl
Care to enlighten anyone as to what goes wrong?
What happens? What output do you get?
> 5.6.1) and compiled and installed it. Still a no go.
> Where can I find this library or addon?
What library? What add-on?
Now I know how Dr. Evil felt... :-)
t
--
Just reach into these holes. I use a carrot.
------------------------------
Date: Mon, 18 Jun 2001 14:29:07 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: UserAgent
Message-Id: <comdog-E0450F.14290718062001@news.panix.com>
In article <3B2E3D79.9743AF4F@mitre.org>, Eric Sheesley
<esheesley@mitre.org> wrote:
> I am trying to run a perl script called checklink.pl downloaded from
> validator.w3.org. I can't seem to get it to work. I got the latest
> version of perl(perl 5.6.1) and compiled and installed it. Still a no
> go. Where can I find this library or addon?
if you are missing a module, then you can most likely find it
on CPAN.
http://search.cpan.org
--
brian d foy <comdog@panix.com>
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html
------------------------------
Date: Mon, 18 Jun 2001 21:49:15 GMT
From: Charlie Markwick <comp-lang-perl-misc@-spambreak-southcot.com>
Subject: Re: windows 2000
Message-Id: <7ptsit4unop6uqucgpnoe136r0vsi7an00@4ax.com>
Thanks all for the help.
Charlie Markwick
On Mon, 18 Jun 2001 14:37:53 GMT, Bart Lateur <bart.lateur@skynet.be>
wrote:
>Philip Newton wrote:
>
>>Or get IndigoPerl ( http://www.indigostar.com/indigoperl.htm ) which
>>comes with an Apache web server (with mod_perl, even). Possibly easier
>>than downloading ActivePerl and Apache separately and configuring them.
>>However, I have no experience with IndigoPerl.
>
>I have. Good stuff. Only, it's still 5.6.0. I don't know if 5.6.1 is in
>the works.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.
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 V10 Issue 1154
***************************************