[22976] in Perl-Users-Digest
Perl-Users Digest, Issue: 5196 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 9 18:15:50 2003
Date: Tue, 8 Jul 2003 08:05:08 -0700 (PDT)
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, 8 Jul 2003 Volume: 10 Number: 5196
Today's topics:
Cannot build perl 5.8.0 with Berkley DB 4.1.15 <pkeller@breathe.com>
Connecting Unix to iSeries AS/400 DB2 (Biegster)
Re: CPAN modules for Apache 2.0.XX (Randy Kobes)
Curses compile problems (tjchamp)
Re: Dynamically generating multi-table SQL <glex_nospam@qwest.net>
Re: How do I clone a structure? <bart.lateur@pandora.be>
Re: How do I clone a structure? <bernie@fantasyfarm.com>
Re: How do I clone a structure? (Greg Bacon)
Matt's Simple Search - a new angle? (Toby Newman)
Re: Matt's Simple Search - a new angle? <cat@no-spam.com>
Re: Matt's Simple Search - a new angle? <john.thetenant-s@moving-picture.com>
Re: Matt's Simple Search - a new angle? <REMOVEsdnCAPS@comcast.net>
Re: naming hash using a variable name. <g4rry_short@zw4llet.com>
Re: Perl 5.8.0 compilation fails in chrooted environmen <nospam-abuse@ilyaz.org>
Re: Perl 5.8.0 compilation fails in chrooted environmen <bernie@fantasyfarm.com>
Re: Perl Script Problems <peb@bms.umist.ac.uk>
Re: Question about Devel::Cover (Himal)
Re: script for unrestricted permutation (weberh)
some terrible problems with glob <zoran@iehk.rwth-aachen.de>
Re: some terrible problems with glob <REMOVEsdnCAPS@comcast.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 08 Jul 2003 15:00:53 +0100
From: Peter Keller <pkeller@breathe.com>
Subject: Cannot build perl 5.8.0 with Berkley DB 4.1.15
Message-Id: <beeiql$kpa$1@niobium.hgmp.mrc.ac.uk>
Hi,
I am trying to build perl 5.8.0 on a HP/Compaq Tru64 Unix system with the
current version of the Berkeley DB library (version 4.1.25), in order
to work around the known problem with the system-supplied libdb.
I have managed to get the configure script to use the correct libdb.so
and db.h (some manipulation of the rpath is necessary - I will post
more details if I get the whole build to work), but DB_File.xs does
not compile:
Making DB_File (dynamic)
cc -c -pthread -std -D_INTRINSICS -fprm d -ieee
-I/ebi/msd/software/perl5.8.0/db-4.1.25/include -DLANGUAGE_C -O4
-DVERSION=\"1.804\" -DXS_VERSION=\"1.804\" "-I../.." DB_File.c
cc: Warning: DB_File.xs, line 1369: In this statement, the referenced
type of the pointer value "name" is "char", which is not compatible with
"struct __db_txn". (ptrmismatch)
status = (RETVAL->dbp->open)(RETVAL->dbp, name, NULL, RETVAL->type,
--------------------------------------------------^
cc: Warning: DB_File.xs, line 1369: In this statement, "RETVAL->type" of
type "enum declared without a tag", is being converted to "pointer to
const char". (cvtdiftypes)
status = (RETVAL->dbp->open)(RETVAL->dbp, name, NULL, RETVAL->type,
--------------------------------------------------------------^
cc: Error: DB_File.xs, line 1369: In this statement,
"(RETVAL->dbp->open)" expects 7 arguments, but 6 are supplied. (toofewargs)
status = (RETVAL->dbp->open)(RETVAL->dbp, name, NULL, RETVAL->type,
-----------------^
*** Exit 1
I have double-checked (using cc -P and looking at DB_File.i) that I am
getting the right db.h here. From the comments at
http://archive.develooper.com/perl5-changes@perl.org/msg06998.html it
seems that someone has managed to get beyond this point with the same
version of libdb that I am using. Does anyone have any idea how they
did it?
Any suggestions much appreciated,
Peter.
======= output of myconfig follows =========
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=dec_osf, osvers=5.1, archname=alpha-dec_osf-thread-multi
uname='osf1 rum.ebi.ac.uk v5.1 1885 alpha '
config_args='-Dmksymlinks -Duseithreads
-Dlocincpth=/ebi/msd/software/perl5.8.0/db-4.1.25/include
-Dloclibpth=/ebi/msd/software/perl5.8.0/db-4.1.25/dec/lib'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=define uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-pthread -std -D_INTRINSICS -fprm d -ieee
-I/ebi/msd/software/perl5.8.0/db-4.1.25/include -DLANGUAGE_C',
optimize='-O4',
cppflags='-pthread -std -D_INTRINSICS -fprm d -ieee
-I/ebi/msd/software/perl5.8.0/db-4.1.25/include -DLANGUAGE_C'
ccversion='V6.4-014', gccversion='', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='ld', ldflags ='-L/ebi/msd/software/perl5.8.0/db-4.1.25/dec/lib
-L/usr/shlib -rpath /ebi/msd/software/perl5.8.0/db-4.1.25/dec/lib'
libpth=/ebi/msd/software/perl5.8.0/db-4.1.25/dec/lib /usr/shlib
/usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /var/shlib
libs=-ldbm -ldb -lm -lutil -lpthread -lexc
perllibs=-lm -lutil -lpthread -lexc
libc=/usr/shlib/libc.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='
-Wl,-rpath,/ebi/msd/software/perl5.8.0/lib/5.8.0/alpha-dec_osf-thread-multi/CORE:/ebi/msd/software/perl5.8.0/db-4.1.25/dec/lib'
cccdlflags=' ', lddlflags='-shared -expect_unresolved "*" -O4 -msym
-std -s -L/ebi/msd/software/perl5.8.0/db-4.1.25/dec/lib -L/usr/shlib'
------------------------------
Date: 8 Jul 2003 07:10:13 -0700
From: biegster@charter.net (Biegster)
Subject: Connecting Unix to iSeries AS/400 DB2
Message-Id: <4176c4f1.0307080610.3e50d352@posting.google.com>
I am working on a conversion from Unix (HP-UX v10.20) compressed files
to the iSeries DB2 on V5R2. I cannot find a Perl DB400 driver that
does not require the installation of IBM Application Developer Client
on the Unix machine. The version of HP-UX on this machine is WAY
unsupported, and the sysadmins will not install anything on it, though
I think I could get perl modules installed.
Can anyone suggest an alternative solution for the database
connectivity?
Thanks for any help you can provide!
------------------------------
Date: 8 Jul 2003 14:14:55 GMT
From: randy@theoryx5.uwinnipeg.ca (Randy Kobes)
Subject: Re: CPAN modules for Apache 2.0.XX
Message-Id: <slrnbgljg1.ld3.randy@theoryx5.uwinnipeg.ca>
On 8 Jul 2003 02:04:21 -0700, Oren Laadan <olaadan@checkpoint.com> wrote:
>How can one find CPAN modules suitable for Apache 2.0.XX ?
>How can I know if a certain module can/will work with it ?
At http://perl.apache.org/, in the documents for mod_perl 2,
there's a section about using and porting modules from 1 to 2.
For simple cases the use of Apache::compat may work, as a
stopgap measure.
>For example, Apache::Cookie (and in general "libapreq-1.2")...
libapreq requires a complete rewrite for Apache 2. This is
being done, as well as the Perl glue of Apache::Cookie and
Apache::Request.
--
best regards,
randy kobes
------------------------------
Date: 8 Jul 2003 07:09:34 -0700
From: todd.champ@honeywell.com (tjchamp)
Subject: Curses compile problems
Message-Id: <cc05db28.0307080609.4e5a8bee@posting.google.com>
newbie needs help with Curses. I used source code to compile my own
Perl 5.8 using gcc compiler. I need to get Curses working but get the
following errors when doing my make:
gcc -c -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-DUSE_NATIVE_DLOPEN -fno-strict-aliasing -D_LARGE_FILES -O
-DVERSION=\"1.06\" -DXS_VERSION=\"1.06\"
"-I/usr/local/lib/perl5/5.8.0/aix/CORE" Curses.c
In file included from
/usr/local/lib/perl5/5.8.0/aix/CORE/iperlsys.h:51,
from /usr/local/lib/perl5/5.8.0/aix/CORE/perl.h:2200,
from Curses.c:14:
/usr/local/lib/perl5/5.8.0/aix/CORE/perlio.h:104: parse error before
`->'
/usr/local/lib/perl5/5.8.0/aix/CORE/perlio.h:107: parse error before
`->'
In file included from Curses.c:344:
CursesFun.c: In function `XS_Curses_newterm':
CursesFun.c:1279: warning: initialization from incompatible pointer
type
CursesFun.c:1280: warning: initialization from incompatible pointer
type
CursesFun.c: In function `XS_Curses_putwin':
CursesFun.c:3453: warning: initialization from incompatible pointer
type
CursesFun.c: In function `XS_Curses_getwin':
CursesFun.c:3472: warning: initialization from incompatible pointer
type
make: 1254-004 The error code from the last command is 1.
Stop.
This is on an AIX 5.1 box. Any help/directions on how to proceed will
be appreciated.
------------------------------
Date: Tue, 08 Jul 2003 09:20:31 -0500
From: "J. Gleixner" <glex_nospam@qwest.net>
Subject: Re: Dynamically generating multi-table SQL
Message-Id: <8qAOa.58$wW.18136@news.uswest.net>
Jesse Sheidlower wrote:
> I'm trying to automatically generate multi-table SQL
> statements from a Web environment, and am having a lot of
> difficulty doing it in a way that doesn't feel kludgy to
> me.[...]
>
> I'd be grateful for any suggestions for approaches, or
> pointers to sample code, etc.
Check out Tangram or Alzabo for possible solutions.
------------------------------
Date: Tue, 08 Jul 2003 10:44:03 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: How do I clone a structure?
Message-Id: <nr7lgvs503ch5r5j9hhh8nvjtvocoj73um@4ax.com>
Tassilo v. Parseval wrote:
>I don't see where Perl data structures are recursive. A recursive data
>structure is for instance a linked list as we know it from C. In Perl
>structures are usually not recursive but simply nested iteratively
>(hash-ref in an array-ref in a hash etc).
"nested iteratively" == "recursive", no? :)
Anyway... even though the data structure isn't recursive in the literal
sense, the definition of it can be, just as with a programming language.
A block contains statements, an if statement can contain blocks...
That's a recursive definition, or at least, a recursive description. In
the same way, perl data structures can be defined as references to
arrays or hashes (and scalars) which can in turn contain references to
arrays, hashes, or scalars. That's a recursive description.
--
Bart.
------------------------------
Date: Tue, 08 Jul 2003 07:58:01 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: How do I clone a structure?
Message-Id: <3aclgvcsvoumo5o46lp7t7eo7p1fvlqek7@library.airnews.net>
"Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote:
} I don't see where Perl data structures are recursive. A recursive data
} structure is for instance a linked list as we know it from C. In Perl
} structures are usually not recursive but simply nested iteratively
} (hash-ref in an array-ref in a hash etc).
How about:
my %hash;
$hash{myself} = \%hash ;
or
my (@a, @b) ;
$a[0] = \@b ;
$b[0] = \@a ;
That 'recursion' is actually no different than the way any other language
implements and deals with recursive data structures
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: Tue, 08 Jul 2003 13:34:16 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: How do I clone a structure?
Message-Id: <vgli2ocoqu8nff@corp.supernews.com>
In article <bedord$qu9$1@nets3.rz.RWTH-Aachen.DE>,
Tassilo v. Parseval <tassilo.parseval@post.rwth-aachen.de> wrote:
: Also sprach Greg Bacon:
:
: > Even the humble array can be viewed as being a recursive data structure,
: > but the questions elicit very different answers:
: > [...]
:
: @_ is just an array, it's not a recursive data structure. I don't see
: how it can be viewed as such.
It depends on your perspective. You mentioned C equivalent, but how
about the O'Caml equivalent, in which a list is recursively defined as
the first element (the head) followed by the rest of the list (the
tail)?
With Perl, TMTOWTDI even when it comes to your perspective. :-)
: > Used as an adverb, 'recursively' modifies the verb 'print'. Used as an
: > adjective, 'recursive' modifies the noun 'data structure'. The
: > questions are not equivalent.
:
: Certainly they aren't. If they were, there'd be no point in discussing
: them. ;-) And indeed, that was my point: if one insists on using the
: term at all, it should line up with 'print' and not with
: 'data-structure' for the reasons given above. Btw, the answer to this
: FAQ says:
:
: [...] The Storable module,
: found on CPAN, provides a function called "dclone" that
: recursively copies its argument.
:
: So there the recursion is clearly targeted towards the implementation.
How so? The FAQ recommends one of the following:
use Data::Dumper;
print Dumper \%eg_some_hash;
use Storable qw(dclone);
$r2 = dclone($r1);
There is no recursion at this level, i.e., from the FAQ-asker's
perspective, and the FAQ-asker doesn't care whether Data::Dumper::Dumper
and Storable::dclone are recursive or iterative. He just wants to print
or copy some data structure.
If the question should be worded as you suggest, where do these answers
show how to recursively print or copy data structures?
Greg
--
Not a place upon earth might be so happy as America. Her situation is
remote from all the wrangling world and she has nothing to do but trade
with them.
-- Thomas Paine
------------------------------
Date: 8 Jul 2003 04:42:06 -0700
From: google@asktoby.com (Toby Newman)
Subject: Matt's Simple Search - a new angle?
Message-Id: <25a29397.0307080342.2e0aed38@posting.google.com>
Hi,
I'm using Matt's Simple Search script, and have set it up to work
correctly. It searches my '/home/public_html/' directory and returns
results. Great!
Problem:
I'd like it to search through *.wiki files (they're just text files)
in '/home/wiki/', i.e. not inside my public_html folder.
It doesn't seem to work!
i.e It works if I use the following variables:
$basedir = '/home/public_html/';
$baseurl = 'http://www.asktoby.com/';
@files = ('*.html','*.php');
$title = "TITLE";
$title_url = 'http://www.asktoby.com/';
$search_url = 'http://www.asktoby.com/search.html';
But if I use these variables:
$basedir = '/home/wiki/';
$baseurl = 'http://www.asktoby.com/';
@files = ('*.wiki');
$title = "TITLE";
$title_url = 'http://www.asktoby.com/';
$search_url = 'http://www.asktoby.com/search.html';
I get no results.
Why could this be?
Thanks for any insight you can give.
Toby
(ps I am working on my ISP's server, not locally).
------------------------------
Date: Tue, 08 Jul 2003 22:08:47 +1000
From: Cat <cat@no-spam.com>
Subject: Re: Matt's Simple Search - a new angle?
Message-Id: <3F0AB44F.D0C8A414@no-spam.com>
Toby Newman wrote:
>
> I'd like it to search through *.wiki files (they're just text files)
> in '/home/wiki/', i.e. not inside my public_html folder.
>
> It doesn't seem to work!
>
> i.e It works if I use the following variables:
>
> $basedir = '/home/public_html/';
> $baseurl = 'http://www.asktoby.com/';
> @files = ('*.html','*.php');
> $title = "TITLE";
> $title_url = 'http://www.asktoby.com/';
> $search_url = 'http://www.asktoby.com/search.html';
>
> But if I use these variables:
>
> $basedir = '/home/wiki/';
> $baseurl = 'http://www.asktoby.com/';
> @files = ('*.wiki');
> $title = "TITLE";
> $title_url = 'http://www.asktoby.com/';
> $search_url = 'http://www.asktoby.com/search.html';
>
> I get no results.
>
> Why could this be?
>
Do you have permission to view the contents of /home/wiki ?
Do you get any results with ls /home/wiki/*.wiki ?
Are you executing the script from a web page ?
------------------------------
Date: Tue, 8 Jul 2003 12:50:26 +0100
From: John Strauss <john.thetenant-s@moving-picture.com>
Subject: Re: Matt's Simple Search - a new angle?
Message-Id: <20030708125026.76970ba0.john.thetenant-s@moving-picture.com>
On 8 Jul 2003 04:42:06 -0700
google@asktoby.com (Toby Newman) wrote:
>
> Hi,
>
> I'm using Matt's Simple Search script, and have set it up to work
> correctly. It searches my '/home/public_html/' directory and returns
> results. Great!
>
> Problem:
>
> I'd like it to search through *.wiki files (they're just text files)
> in '/home/wiki/', i.e. not inside my public_html folder.
>
> It doesn't seem to work!
>
> i.e It works if I use the following variables:
>
> $basedir = '/home/public_html/';
> $baseurl = 'http://www.asktoby.com/';
> @files = ('*.html','*.php');
> $title = "TITLE";
> $title_url = 'http://www.asktoby.com/';
> $search_url = 'http://www.asktoby.com/search.html';
>
> But if I use these variables:
>
> $basedir = '/home/wiki/';
> $baseurl = 'http://www.asktoby.com/';
> @files = ('*.wiki');
> $title = "TITLE";
> $title_url = 'http://www.asktoby.com/';
> $search_url = 'http://www.asktoby.com/search.html';
>
> I get no results.
>
> Why could this be?
>
> Thanks for any insight you can give.
> Toby
>
> (ps I am working on my ISP's server, not locally).
have you asked matt?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drop the .thetenant to get me via mail
------------------------------
Date: Tue, 08 Jul 2003 09:44:17 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Matt's Simple Search - a new angle?
Message-Id: <Xns93B26D43B840Esdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
google@asktoby.com (Toby Newman) wrote in news:25a29397.0307080342.2e0aed38
@posting.google.com:
> Hi,
>
> I'm using Matt's Simple Search script, and have set it up to work
> correctly. It searches my '/home/public_html/' directory and returns
> results. Great!
>
> Problem:
>
> I'd like it to search through *.wiki files (they're just text files)
> in '/home/wiki/', i.e. not inside my public_html folder.
>
> It doesn't seem to work!
Matt's scripts are notoriously bad, and Simple Search is no exception. Why
come here asking questions? Why not ask Matt? He should support his crap.
- --
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPwrYyWPeouIeTNHoEQK2XQCglO5O9KKG47bpjIkNqyWckoHPwnYAoNLY
fWCZZWemIe8nMOlh+YracI2o
=2LYl
-----END PGP SIGNATURE-----
------------------------------
Date: Tue, 08 Jul 2003 13:40:58 +0000
From: Garry Short <g4rry_short@zw4llet.com>
Subject: Re: naming hash using a variable name.
Message-Id: <beee9t$4kn$1$830fa7b3@news.demon.co.uk>
Tad McClellan wrote:
> Garry Short <g4rry_short@zw4llet.com> wrote:
>
>> what does :
>> @aliases = @{ $expand_aliases{ $alias } } ;
>> do?
>
>
> Dereferences the array ref contained in $expand_aliases{ $alias }.
>
> It is an application of "Use Rule 1" from:
>
> perldoc perlreftut
>
>
>> I'm assuming that:
> [snip]
>> would give the same results as:
> [snip]
>> Is that right?
>
>
> use Data::Dumper;
>
>
> and find out for yourself. :-)
>
>
Thanks, I was right! That Data::Dumper could be handy - I'll have to
remember that one!
Garry
------------------------------
Date: Tue, 8 Jul 2003 12:13:40 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Perl 5.8.0 compilation fails in chrooted environment
Message-Id: <beechk$1cnr$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
<vrihad@myway.com>], who wrote in article <2a024f54.0307080143.71242ae1@posting.google.com>:
> I replaced the file lib/Cwd.pm with the one having following content:
> package Cwd;
> sub cwd { my $p = `pwd`; chop $p; $p }
> 1;
> Now the new error while doing make is:
> Undefined subroutine &File::Spec::Unix::cwd called at
> ../../lib/File/Spec/Unix.pm line 457.
I see: you need to make Cwd::cwd() exportable. Insert the Exporter
boilerplate at start (e.g., see how the original Cwd did it).
Hope this helps,
Ilya
P.S. And, please, report the whole story as a bug via perlbug.
------------------------------
Date: Tue, 08 Jul 2003 08:33:50 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Perl 5.8.0 compilation fails in chrooted environment
Message-Id: <geelgv8qrg9iotr6brc8smbnb0ggomqcnp@library.airnews.net>
Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
} If `pwd' works, try replacing Cwd.pm with
}
} package Cwd;
} sub cwd { my $p = `pwd`; chop $p; $p }
} 1;
Meta-question: why use 'chop' instead of 'chomp'? Isn't there a danger on
a system that returns \r\n that chop will leave the \r? [Granted that's
not the case in the OP's situation, but why have to make the determination
that 'chop' will do when I thought that to avoid that problem was why
'chomp' was added in the first place.
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: Tue, 08 Jul 2003 14:07:59 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Perl Script Problems
Message-Id: <3F0AC22F.6040505@bms.umist.ac.uk>
Robert wrote:
> The first post tells what it is unless your definition of it is not the
> normal one
<snip rest of post>
Look, Robert, no one here is getting paid to help you out. If you look
at *any* of the other questions posted here, you'll notice that they all
give some kind of hint as to where the problem is. The only hint we get
off you is "all works fine except for the card creation". Now, how on
earth is anyone supposed to be able to help with such little information?
It's like saying "I've got this car and I can't start it." There's no
useful information there at all.
Do you know any Perl? If not, I would suggest trying to get in touch
with the author of the script. They might be more forthcoming. I'm
hoping they'll have more of a clue about what you are asking.
HTH
Paul
------------------------------
Date: 8 Jul 2003 07:06:29 -0700
From: himal5@hotmail.com (Himal)
Subject: Re: Question about Devel::Cover
Message-Id: <365e1935.0307080606.2cd7eb46@posting.google.com>
Hi Tina,
I downloaded it from cpan.
tar -xvf
make
make test
perl -Mdevel::Cover temp.pl
There were no error messages during make or make test.
Tina Mueller <usenet@expires082003.tinita.de> wrote in message news:<bec888$3gga8$1@ID-24002.news.dfncis.de>...
> Himal wrote:
> > I am trying to do covegage on perl (5.8.0)
> > And have installed Devel::Cover 2.0 from Cpan. But when I try
> > perl -Mdevel::Cover temp.pl I get :
> > "Can't locate loadable object for module Devel::Cover in @INC"
>
> how did you install it?
> were there any error-messages during the make or make test?
>
> hth, tina
------------------------------
Date: 8 Jul 2003 05:40:35 -0700
From: weberh@zedat.fu-berlin.de (weberh)
Subject: Re: script for unrestricted permutation
Message-Id: <7003ec4a.0307080440.33f823fc@posting.google.com>
> All scripts for permutation I found yet, were restricted by depth
> (loops have to be hardcoded) or memory (recursive approach).
So there are many nice ideas not depending on eval().
Here's a (some kind of primitive) benchmark
(if necessary, scripts were slightly modified, so
command line arguments are accepted).
[Abacus3]~/perltest/bench: for x in `/bin/ls`; do echo $x; time ./$x
10 a b c d > /dev/null; echo xxx; done
bdperm
real 1m12.404s
user 1m11.622s
sys 0m0.061s
xxx
benperm
real 0m15.092s
user 0m14.805s
sys 0m0.049s
xxx
chrisperm
real 1m26.948s
user 1m23.068s
sys 0m3.254s
xxx
haraldperm
real 0m15.749s
user 0m15.656s
sys 0m0.048s
xxx
jayperm
real 1m32.635s
user 1m32.105s
sys 0m0.182s
xxx
johnperm
real 1m49.748s
user 1m48.612s
sys 0m0.362s
xxx
equal output ?
[Abacus3]~/perltest/bench: for x in `/bin/ls`; do echo $x; ./$x 10 a b
c d | wc; echo xxx; done
bdperm
1048576 10485760 22020096
xxx
benperm
1048576 10485760 20971520
xxx
chrisperm
1048576 10485760 22020096
xxx
haraldperm
1048576 10485760 22020096
xxx
jayperm
1048576 1048576 11534336
xxx
johnperm
1048576 10485760 20971520
bdperm
#!/usr/bin/perl -w
use strict;
my $count = shift @ARGV;
my @elements = @ARGV;
my @indices;
unshift @indices, 0 for (0..$count - 1);
while($indices[0] < @elements){
foreach my $index (@indices) {
print "$elements[$index] ";
}
print "\n";
$indices[-1]++;
for($_ = $#indices; $_ > 0; $_--){
if($indices[$_] >= @elements){
$indices[$_] = 0;
$indices[$_ - 1]++;
}
}
}
xxx
benperm
#!/usr/bin/perl -w
use strict;
sub perm {
if( my $x = pop ) {
--$x;
perm( @_, $_, $x ) for @ARGV;
} else {
print "@_\n";
}
}
perm(shift);
xxx
chrisperm
#!/usr/bin/perl -w
use strict;
my $group = shift;
my @perms = perm($group,@ARGV);
for my $i (0..$#perms) {
for my $j (0..$group-1) {
print "$perms[$i][$j] ";
} print "\n";
}
# function perm($groupings, @elements)
sub perm {
my $groupings = shift @_;
my @elements = @_;
my @odometer = (0) x $groupings;
my @perms;
while ( 1 ) {
push @perms, [ @elements[@odometer] ];
my $wheel= 0;
$odometer[$wheel] = ($odometer[$wheel] + 1) % @elements;
while ($odometer[$wheel] == 0 && ++$wheel< @odometer) {
$odometer[$wheel] = ($odometer[$wheel] + 1) % @elements;
}
return @perms if $wheel == @odometer;
}
}
xxx
haraldperm
#!/usr/bin/perl -w
#perm: permutation with user defined depth and number of elements
#usage: perm depth element1 element2 ...
#version 0.02
use strict;
my ($code,$i);
my ($depth,@element) = @ARGV;
for ($i = 1; $i <= $depth; $i++) #Code generation starts here
{$code .= "for (my \$i$i = 0; \$i$i <= $#element; \$i$i++)\n{"}
$code .= 'print "';
for (my $c=1; $c <= $depth; $c++)
{$code .= "\$element[\$i$c] "}
$code .= '\n"' . '}' x$depth . "\n"; #End of Code generation
eval($code); #Code evaluation gives the
permutation
xxx
jayperm
#!/usr/bin/perl -w
my($count, @elements) = @ARGV;
my $permutation = sub {
use integer;
my($i) = @_;
my @indices = ($elements[0]) x $count;
my $c = $count;
while($c && $i) {
$indices[--$c] = $elements[ $i % @elements ];
$i /= @elements;
}
@indices;
};
print $permutation->($_), "\n"
for 0 .. @elements ** $count -1;
xxx
johnperm
#!/usr/bin/perl -w
my $group = shift;
my @elements = @ARGV;
for ( 0 .. ( @elements ** $group ) - 1 ) {
my @odometer;
do { unshift @odometer, $_ % @elements } while $_ = int( $_ /
@elements );
print "@{[ map $elements[$_], (0) x ($group - @odometer),
@odometer ]}\n";
}
xxx
------------------------------
Date: Tue, 08 Jul 2003 13:09:45 +0200
From: Zoran <zoran@iehk.rwth-aachen.de>
Subject: some terrible problems with glob
Message-Id: <fh8lgv4b8m8n9qj57kgd70f4kmk3attbnf@4ax.com>
Hello guys,some things in my code are happening,which I don't
understand.I am trying to open different directories and to load a
bunch of files.But this don't work.
It is all fine,when I am working in my home directoy.But if I change
it the glob-function don't work.
Here is the code:
#!/usr/local/bin/perl -w
print "\nHi please tell me your directory!\n";
chomp ($directory = <STDIN>);
print "\nOK now tell me the glob name!\n";
chomp ($opname = <STDIN>);
print "\nWorking ... \n";
###########################
if (!opendir VH,$directory)
{
print "\nThe directory $directory was not found !!\n";
return;}
print "\nEnter 2 \n";
$MJJ=-1;
foreach $datei (readdir VH){
$MJJ=$MJJ+1;
$files[$MJJ]=$datei;
print "$files[$MJJ]\n";
}
print "\n@files \n";
@files=glob "*$opname*";
print "\n$opname \n";
print "\nEnter 3 \n";
print "\n@files \n";
------------------------------
Date: Tue, 08 Jul 2003 06:56:43 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: some terrible problems with glob
Message-Id: <Xns93B250DBF2C7Dsdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Zoran <zoran@iehk.rwth-aachen.de> wrote in
news:fh8lgv4b8m8n9qj57kgd70f4kmk3attbnf@4ax.com:
>
> Hello guys,some things in my code are happening,which I don't
> understand.I am trying to open different directories and to load a
> bunch of files.But this don't work.
> It is all fine,when I am working in my home directoy.But if I change
> it the glob-function don't work.
>
> Here is the code:
...
> $MJJ=-1;
> foreach $datei (readdir VH){
> $MJJ=$MJJ+1;
> $files[$MJJ]=$datei;
> print "$files[$MJJ]\n";
> }
FYI, this whole loop is unnecessary. You could just do:
@files = readdir VH;
> print "\n@files \n";
>
> @files=glob "*$opname*";
This glob happens in the current directory, not in $directory.
Perhaps you should do
chdir $directory;
first.
- --
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPwqxgmPeouIeTNHoEQLTnwCbBwVDuKCuUZ4FCYWguGm19j9aEvIAoJ2n
4092UqAWX+H3TZuyeDPi8zxn
=HDT4
-----END PGP SIGNATURE-----
------------------------------
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 5196
***************************************