From anotheranne at fables.co.za Sun Oct 12 03:37:05 2008 From: anotheranne at fables.co.za (Anne Wainwright) Date: Sun, 12 Oct 2008 12:37:05 +0200 Subject: [Za-pm] Getting DBD::mysql installed In-Reply-To: References: <20080911201400.040e2685.anotheranne@fables.co.za> Message-ID: <20081012123705.045d3975.anotheranne@fables.co.za> Tielman, hi, Thanks for your support. I had in error dropped off za-pm when I moved all my mailing lists from work to home, I thought we were chatting on the group and only a while back did I realise that I wasn't where I thought I was. I have corrected that and will continue on there. I now have tables with data in both mySQL and SQLite format. lots of hours getting this correct with output from my own database and then into these two sql variants The former because it is seemingly a big standard, and a version was already on my computer. The latter because I decided to experiment with Maypole. I decided to try our Maypole because my aim is specifically at this intitial phase to build a browser interface to the database, I am not cranking up a whole website yet. Maypole looks like a precursor to Mason, and seems aimed at data display especially, even if currently it is not maintained up to date. The Maypole examples use SQLite. However, before moving onto Maypole I thought I would try Cruddy which looks a quick and dirty application, My aim is to have as few problems at a time as possible. Cruddy uses mySQL and I wanted just to make a 'proof of concept' as it were, in other word to see some data in the browser in a minimal time, understand the basic idea of how it works. Cruddy promises minimal effort hence the attraction for a first try. So I need to get DBD::mysql installed (well there was a whole tree of modules to install, each one depending on more, all done now) but here comes the problem. When running in the DBD-mysql directory # perl Makefile.PL # goes without a hitch # make # also no problem # make test # :( It fails and I paste the main output here. PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00base....................String found where operator expected at t/00base.t line 20, near "BAIL_OUT "Unable to load DBI"" (Do you need to predeclare BAIL_OUT?) String found where operator expected at t/00base.t line 21, near "BAIL_OUT "Unable to load DBD::mysql"" (Do you need to predeclare BAIL_OUT?) syntax error at t/00base.t line 20, near "BAIL_OUT "Unable to load DBI"" syntax error at t/00base.t line 21, near "BAIL_OUT "Unable to load DBD::mysql"" BEGIN not safe after errors--compilation aborted at t/00base.t line 22. # Looks like your test died before it could output anything. this is followed by a host of error output, mainly to do with not being able to connect to database. I nominally got an install of DBD::mysql via cpan, but it ends up with Cruddy not running on accounts of cannot connect to database errors wo presume that in fact it also does notinstall correctly and that the above is the problem that is fouling further progress Not said anywhere, but I installed all the perl modules as root which I assume should be correct. Any ideas please? Anne On Thu, 11 Sep 2008 22:45:41 +0100 Tielman wrote: |> Hi Anne, |> |> I'm not sure which other databases implement that feature, but personally I |> am a big fan of PostgreSQL. PostgreSQL has an excellent pedigree and has |> been at the forefront of the "open source" databases of being a full fledged |> relational database. |> |> Saying that, you're probably "safer" with MySQL, as it is the de facto |> standard with PHP (BTW, I'm personally not a big fan of PHP either; I prefer |> HTML::Mason, a pure Perl templating engine). You might also want to look at |> Ruby on Rails. |> |> |> Le me know how you get along, -- so much to do, so little time :( From tvilliers at gmail.com Sun Oct 12 07:43:02 2008 From: tvilliers at gmail.com (Tielman de Villiers) Date: Sun, 12 Oct 2008 15:43:02 +0100 Subject: [Za-pm] Getting DBD::mysql installed In-Reply-To: <20081012123705.045d3975.anotheranne@fables.co.za> References: <20080911201400.040e2685.anotheranne@fables.co.za> <20081012123705.045d3975.anotheranne@fables.co.za> Message-ID: 2008/10/12 Anne Wainwright : > So I need to get DBD::mysql installed (well there was a whole tree of modules to install, each one depending on more, all done now) but here comes the problem. When running in the DBD-mysql directory > > # perl Makefile.PL # goes without a hitch > # make # also no problem > # make test # :( > > It fails and I paste the main output here. > > PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t > t/00base....................String found where operator expected at t/00base.t line 20, near "BAIL_OUT "Unable to load DBI"" > (Do you need to predeclare BAIL_OUT?) > String found where operator expected at t/00base.t line 21, near "BAIL_OUT "Unable to load DBD::mysql"" > (Do you need to predeclare BAIL_OUT?) > syntax error at t/00base.t line 20, near "BAIL_OUT "Unable to load DBI"" > syntax error at t/00base.t line 21, near "BAIL_OUT "Unable to load DBD::mysql"" Hi Anne, Can you please post these details? OS details: Perl version: DBI version: DBD::mysql version: MySQL version: location of MySQL library and header files: Thanks, --tielman From anotheranne at fables.co.za Sun Oct 12 11:11:51 2008 From: anotheranne at fables.co.za (Anne Wainwright) Date: Sun, 12 Oct 2008 20:11:51 +0200 Subject: [Za-pm] Getting DBD::mysql installed In-Reply-To: References: <20080911201400.040e2685.anotheranne@fables.co.za> <20081012123705.045d3975.anotheranne@fables.co.za> Message-ID: <20081012201151.5653c17c.anotheranne@fables.co.za> Info requested given below. On Sun, 12 Oct 2008 15:43:02 +0100 Tielman wrote: |> 2008/10/12 Anne Wainwright : |> > So I need to get DBD::mysql installed (well there was a whole tree of modules to install, each one depending on more, all done now) but here comes the problem. When running in the DBD-mysql directory |> > |> > # perl Makefile.PL # goes without a hitch |> > # make # also no problem |> > # make test # :( |> > |> > It fails and I paste the main output here. |> > |> > PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t |> > t/00base....................String found where operator expected at t/00base.t line 20, near "BAIL_OUT "Unable to load DBI"" |> > (Do you need to predeclare BAIL_OUT?) |> > String found where operator expected at t/00base.t line 21, near "BAIL_OUT "Unable to load DBD::mysql"" |> > (Do you need to predeclare BAIL_OUT?) |> > syntax error at t/00base.t line 20, near "BAIL_OUT "Unable to load DBI"" |> > syntax error at t/00base.t line 21, near "BAIL_OUT "Unable to load DBD::mysql"" |> |> |> Hi Anne, |> |> Can you please post these details? |> |> OS details: Linux 2.4.21 i386 on a i686 HP laptop |> Perl version: 5.8.4 |> DBI version: 1.607 |> DBD::mysql version: 4.008 |> MySQL version: manual says 3.34.39 but I did do an update from Debian archives, apparently no new manual supplied # mysqld -V --> Version 4.1.11 |> location of MySQL library and header files: for example ... /usr/include/mysql/mysql.h lots of other stuff /usr/.../... the mysql.h was not supplied in the distro, I downloaded from Debian a -dev package that I found included it from backports Anne |> |> Thanks, |> |> --tielman -- so much to do, so little time :( From anotheranne at fables.co.za Mon Oct 13 14:36:40 2008 From: anotheranne at fables.co.za (Anne Wainwright) Date: Mon, 13 Oct 2008 23:36:40 +0200 Subject: [Za-pm] Getting DBD::mysql installed In-Reply-To: References: <20081012201151.5653c17c.anotheranne@fables.co.za> Message-ID: <20081013233640.4b7001c1.anotheranne@fables.co.za> Tielman, hi, Don't know where you developed your detective skills, but that works! OK, I have to sort out the access to the database for the test. I'll look at that tomorrow evening with a fresh head. bestest Anne On Mon, 13 Oct 2008 21:17:52 +0100 Tielman wrote: |> |> |> |> On 2008-10-12 19:11:51, "Anne Wainwright" wrote: |> |> > Info requested given below. |> > |> > On Sun, 12 Oct 2008 15:43:02 +0100 |> > Tielman wrote: |> > |> > |> 2008/10/12 Anne Wainwright : |> > |> > So I need to get DBD::mysql installed (well there was a whole tree of |> > modules to install, each one depending on more, all done now) but here comes |> > the problem. When running in the DBD-mysql directory |> > |> > |> > |> > # perl Makefile.PL # goes without a hitch |> > |> > # make # also no problem |> > |> > # make test # :( |> > |> > |> > |> > It fails and I paste the main output here. |> > |> > |> > |> > PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" |> > "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t |> > |> > t/00base....................String found where operator expected at |> > t/00base.t line 20, near "BAIL_OUT "Unable to load DBI"" |> > |> > (Do you need to predeclare BAIL_OUT?) |> > |> > String found where operator expected at t/00base.t line 21, near |> > "BAIL_OUT "Unable to load DBD::mysql"" |> > |> > (Do you need to predeclare BAIL_OUT?) |> > |> > syntax error at t/00base.t line 20, near "BAIL_OUT "Unable to load DBI"" |> > |> > syntax error at t/00base.t line 21, near "BAIL_OUT "Unable to load |> > DBD::mysql"" |> > |> |> > |> |> |> |> Ok, the problem seems to be your version of Test::More. Upgrade it to |> Test-Simple-0.80 and try the tests again: |> http://translate.google.co.uk/translate?hl=en&sl=ja&u=http://kaigo.okwave.jp |> /qa4377091.html&sa=X&oi=translate&resnum=2&ct=result&prev=/search%3Fq%3DStri |> ng%2Bfound%2Bwhere%2Boperator%2Bexpected%2Bat%2Bt/00base.t%2Bline%2B20,%2Bne |> ar%2B%2522BAIL_OUT%2B%2522Unable%2Bto%2Bload%2BDBI%2522%26hl%3Den%26rlz%3D1G |> 1GGLQ_ENUK245%26sa%3DG |> |> --tielman |> |> |> -- so much to do, so little time :( From anotheranne at fables.co.za Wed Oct 15 23:51:12 2008 From: anotheranne at fables.co.za (Anne Wainwright) Date: Thu, 16 Oct 2008 08:51:12 +0200 Subject: [Za-pm] Getting DBD::mysql installed In-Reply-To: References: <20081012201151.5653c17c.anotheranne@fables.co.za> Message-ID: <20081016085112.69793a88.anotheranne@fables.co.za> Tielman, hi again, Thanks for help so far. I sorted out the interaction between Makefile.PL and the password to gain access to mysql. Now the make test goes so far but no further. On Mon, 13 Oct 2008 21:17:52 +0100 Tielman wrote: |> |> Ok, the problem seems to be your version of Test::More. Upgrade it to |> Test-Simple-0.80 and try the tests again: Installed that, as suggested. # Makefile.PL :) # make :) # make test :( now the output is (see end at t/76 where it stops root at Pandora:/home/anotheranne/linux-downloads/DBD-mysql-4.008# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00base....................ok t/10connect.................ok t/20createdrop..............ok t/25lockunlock..............ok t/29warnings................ok t/30insertfetch.............ok t/31insertid................ok t/32insert_error............ok t/35limit...................ok t/35prepare.................ok t/40bindparam...............ok t/40bindparam2..............ok t/40blobs...................ok t/40catalog.................ok 35/77 skipped: various reasons t/40keyinfo.................ok t/40listfields..............ok t/40nulls...................ok t/40numrows.................ok t/40server_prepare..........ok t/40server_prepare_error....ok t/40types...................ok 19/20 skipped: New Data types not supported by server t/41bindparam...............ok t/41blobs_prepare...........ok t/42bindparam...............ok t/50chopblanks..............NOK 15 # Failed test '$name should not have blanks chopped' # at t/50chopblanks.t line 60. # got: '' # expected: ' ' t/50chopblanks..............NOK 22 # Failed test '$name should not have blanks chopped' # at t/50chopblanks.t line 60. # got: ' a b c' # expected: ' a b c ' t/50chopblanks..............ok 29/29# Looks like you failed 2 tests of 29. t/50chopblanks..............dubious Test returned status 2 (wstat 512, 0x200) DIED. FAILED tests 15, 22 Failed 2/29 tests, 93.10% okay t/50commit..................ok t/55utf8....................skipped all skipped: SKIP TEST: You must have MySQL version 5.0 and greater for this test to run t/60leaks...................skipped all skipped: Skip $ENV{SLOW_TESTS} is not set t/65types...................ok t/70takeimp.................skipped all skipped: This test is disabled t/71impdata.................skipped all skipped: This test is disabled t/75supported_sql...........ok t/76multi_statement.........NOK 13 # Failed test 'Second update had 2 warnings' # at t/76multi_statement.t line 50. # got: '0' # expected: '2' t/76multi_statement.........ok 19/24 at this point it stops and stays stopped. Since all the previous tests zip by at lightning speed, a cup of coffee should see it through a sticky patch, but it doesn't so assume it is terminal. I also notice these snippets from the Makefile.PL output (the first from the standard settings that it puts out first) ................... Use of uninitialized value in printf at Makefile.PL line 175, line 93. ................... Multiple copies of Driver.xst found in: /usr/local/lib/perl/5.8.4/auto/DBI/ /usr/lib/perl5/auto/DBI/ at Makefile.PL line 747 Using DBI 1.607 (for perl 5.008004 on i386-linux-thread-multi) installed in /usr/local/lib/perl/5.8.4/auto/DBI .................. |> --tielman -- so much to do, so little time :( From anotheranne at fables.co.za Thu Oct 23 11:06:00 2008 From: anotheranne at fables.co.za (Anne Wainwright) Date: Thu, 23 Oct 2008 20:06:00 +0200 Subject: [Za-pm] paths in @INC global special array Message-ID: <20081023200600.1ec98542.anotheranne@fables.co.za> Hi, Any one at home? I upgraded my entire system (a Debian upgrade) for various reasons and now my perl is broken. Specifically the path /usr/lib/perl/5.8.4 is not in the perl @INC array so things like Dynaloader.pm , POSIX.pm , Config.pm, and other stuff do not get found when needed. Following some googled help I did as follows # PERL5LIB=/usr/lib/perl/5.8.4 # export PERL5LIB success! for instance, an item that did not previously execute, like the following, did in fact now execute. # perldoc lib .... now ran OK Of course when I closed the terminal, and opened another the setting had evaporated. So I now put this new environment variable into the .bashrc file. # perl -V --> now shows the new path in @INC [I note that if I try to update perl online that the configuration fails precisely because IO/File.pm cannot be found in @INC ... and of course it is in /usr/lib/perl/5.8.4 . How this happened I cannot say. Probably something yours truly did.] Could I cheat the array and put a link to /usr/lib/perl/5.8.4 in one of the @INC paths? like in /usr/local/lib/perl/5.8.4 (which exists with some stuff in) OR in ... /usr/local/share/perl/5.8.4 ( which also exists with some other stuff in) or just copy everything over into one of them even? haven't played with links or symlinks ever. LATER ... failure :( From my browser I am calling a cruddy.pl script in /var/www/cgi-bin . Despite $PERL5LIB the apache error.log reflects that Dynaloader.pm and other folowing modules are not found and lists the @INC paths which do _not_ include my new one - and that is where it is of course. I don't want to have to put something like use lib "/usr/lib/perl/5.8.4"; in every script or module I use. Is there any way around this or should I unistall perl and try a reinstall again? thanks in advance for any light in the dark corners. Anne -- so much to do, so little time :( From tvilliers at gmail.com Thu Oct 23 12:31:43 2008 From: tvilliers at gmail.com (Tielman de Villiers) Date: Thu, 23 Oct 2008 20:31:43 +0100 Subject: [Za-pm] paths in @INC global special array In-Reply-To: <20081023200600.1ec98542.anotheranne@fables.co.za> References: <20081023200600.1ec98542.anotheranne@fables.co.za> Message-ID: 2008/10/23 Anne Wainwright : > I upgraded my entire system (a Debian upgrade) for various reasons and now my perl is broken. Specifically the path > > /usr/lib/perl/5.8.4 > > is not in the perl @INC array > > so things like Dynaloader.pm , POSIX.pm , Config.pm, and other stuff do not get found when needed. What does "which perl" say, ie, where does your default perl binary live? Also please post the output of "perl -V" without $PERL5LIB being set. --tielman From anotheranne at fables.co.za Thu Oct 23 13:19:54 2008 From: anotheranne at fables.co.za (Anne Wainwright) Date: Thu, 23 Oct 2008 22:19:54 +0200 Subject: [Za-pm] paths in @INC global special array In-Reply-To: References: <20081023200600.1ec98542.anotheranne@fables.co.za> Message-ID: <20081023221954.15f2ae0e.anotheranne@fables.co.za> Hello, Tielman, see below On Thu, 23 Oct 2008 20:31:43 +0100 Tielman wrote: |> 2008/10/23 Anne Wainwright : |> |> > I upgraded my entire system (a Debian upgrade) for various reasons and now my perl is broken. Specifically the path |> > |> > /usr/lib/perl/5.8.4 |> > |> > is not in the perl @INC array |> > |> > so things like Dynaloader.pm , POSIX.pm , Config.pm, and other stuff do not get found when needed. |> |> What does "which perl" say, ie, where does your default perl binary |> live? Also please post the output of "perl -V" without $PERL5LIB being |> set. # which perl --> /usr/bin/perl anotheranne at Pandora:~$ PERL5LIB="" # I just unset it so anotheranne at Pandora:~$ echo $PERL5LIB # blank output so unset anotheranne at Pandora:~$ perl -V Can't locate Config.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .). BEGIN failed--compilation aborted. anotheranne at Pandora:~$ obviously if I have $PERL5LIB set, then the output is much greater with all sorts of stuff re perl, with it unset all you get is what is shown above. bestest Anne |> |> --tielman |> _______________________________________________ |> Za-pm mailing list |> Za-pm at pm.org |> http://mail.pm.org/mailman/listinfo/za-pm -- so much to do, so little time :( From tvilliers at gmail.com Thu Oct 23 15:03:07 2008 From: tvilliers at gmail.com (Tielman de Villiers) Date: Thu, 23 Oct 2008 23:03:07 +0100 Subject: [Za-pm] paths in @INC global special array In-Reply-To: <20081023221954.15f2ae0e.anotheranne@fables.co.za> References: <20081023200600.1ec98542.anotheranne@fables.co.za> <20081023221954.15f2ae0e.anotheranne@fables.co.za> Message-ID: 2008/10/23 Anne Wainwright : > > # which perl --> /usr/bin/perl > > anotheranne at Pandora:~$ PERL5LIB="" # I just unset it so > anotheranne at Pandora:~$ perl -V > Can't locate Config.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .). > BEGIN failed--compilation aborted. > anotheranne at Pandora:~$ > > obviously if I have $PERL5LIB set, then the output is much greater with all sorts of stuff re perl, with it unset all you get is what is shown above. > Is this the vendor supplied perl, or did you build it yourself, and what does Config.pm say about how your perl was compiled, eg, the values of archlib etc? Either way, it seems a reinstall/rebuild is on the cards: http://www.perlmonks.org/?node_id=190478 http://www.perlmonks.org/?node_id=460342 --tielman From brentgclarklist at gmail.com Thu Oct 23 23:42:23 2008 From: brentgclarklist at gmail.com (Brent Clark) Date: Fri, 24 Oct 2008 08:42:23 +0200 Subject: [Za-pm] paths in @INC global special array In-Reply-To: <20081023200600.1ec98542.anotheranne@fables.co.za> References: <20081023200600.1ec98542.anotheranne@fables.co.za> Message-ID: <49016E4F.305@gmail.com> Anne Wainwright wrote: > Hi, > > Any one at home? > > I upgraded my entire system (a Debian upgrade) for various reasons and now my perl is broken. Specifically the path Hiya What debian are your running. If you not sure .... cat /etc/issue Regards Brent Clark From anotheranne at fables.co.za Fri Oct 24 11:10:40 2008 From: anotheranne at fables.co.za (Anne Wainwright) Date: Fri, 24 Oct 2008 20:10:40 +0200 Subject: [Za-pm] paths in @INC global special array In-Reply-To: <49016E4F.305@gmail.com> References: <20081023200600.1ec98542.anotheranne@fables.co.za> <49016E4F.305@gmail.com> Message-ID: <20081024201040.6a749b0a.anotheranne@fables.co.za> Hello, Brent, well, $ /cat/etc/issue returned my original Libranet logo with "Libranet GNU/Linux 2.8.1 \m \n \l so I suppose that is the kernel which is same as ever it was. The debian name that I use when updating online is Sarge which I realise is a bit dated now. Not tonight, but I'll have a go at uninstall / reinstall of Perl this weekend, I am just worried that I may leave stuff lying around that will give me the same problem again after doing that. thanks, enjoy your w/e Anne On Fri, 24 Oct 2008 08:42:23 +0200 Brent wrote: |> Anne Wainwright wrote: |> > Hi, |> > |> > Any one at home? |> > |> > I upgraded my entire system (a Debian upgrade) for various reasons and now my perl is broken. Specifically the path |> |> Hiya |> |> What debian are your running. |> |> If you not sure .... cat /etc/issue |> |> Regards |> Brent Clark |> _______________________________________________ |> Za-pm mailing list |> Za-pm at pm.org |> http://mail.pm.org/mailman/listinfo/za-pm -- so much to do, so little time :( From anotheranne at fables.co.za Thu Nov 6 12:56:21 2008 From: anotheranne at fables.co.za (Anne Wainwright) Date: Thu, 6 Nov 2008 22:56:21 +0200 Subject: [Za-pm] Cant get correct count of files in directory :( Message-ID: <20081106225621.6f15ff1f.anotheranne@fables.co.za> Hi, Stupid count! # get a list of filenames in current directory into an array opendir (THISDIR, ".") or die "serious brain damage: $!"; @allfiles = readdir (THISDIR); closedir (THISDIR); $howmany = @allfiles; print "\tthere are $howmany files in the array\n\n"; At this point it outputs a count of 133 files in the array I count 125 + 1 hidden @ file + 5 subdirectories + the parent /.. = 132 I am sure my trusty Midnight Commander can count the files. Am I having a blonde moment? -- so much to do, so little time :( From jonathan at hst.org.za Thu Nov 6 20:27:39 2008 From: jonathan at hst.org.za (Jonathan McKeown) Date: Fri, 7 Nov 2008 06:27:39 +0200 Subject: [Za-pm] Cant get correct count of files in directory :( In-Reply-To: <20081106225621.6f15ff1f.anotheranne@fables.co.za> References: <20081106225621.6f15ff1f.anotheranne@fables.co.za> Message-ID: <200811070627.39697.jonathan@hst.org.za> On Thursday 06 November 2008 22:56, Anne Wainwright wrote: > Hi, > > Stupid count! > > # get a list of filenames in current directory into an array > opendir (THISDIR, ".") or die "serious brain damage: $!"; > @allfiles = readdir (THISDIR); > closedir (THISDIR); > $howmany = @allfiles; > print "\tthere are $howmany files in the array\n\n"; > > At this point it outputs a count of 133 files in the array > > I count 125 + 1 hidden @ file + 5 subdirectories + the parent /.. = 132 > > I am sure my trusty Midnight Commander can count the files. Am I having a > blonde moment? Stupid question - did you count . , the directory itself? readdir does. Jonathan From anotheranne at fables.co.za Sun Nov 9 12:18:36 2008 From: anotheranne at fables.co.za (Anne Wainwright) Date: Sun, 9 Nov 2008 22:18:36 +0200 Subject: [Za-pm] Cant get correct count of files in directory :( In-Reply-To: <200811070627.39697.jonathan@hst.org.za> References: <20081106225621.6f15ff1f.anotheranne@fables.co.za> <200811070627.39697.jonathan@hst.org.za> Message-ID: <20081109221836.0751f9af.anotheranne@fables.co.za> Jonathan et al, No, I didn't think it would count itself when counting what is in itself :( I suppose there is a reason for that - something to do with exactly what a filehandle is. Should of course have looked in my Camel book but just didn't imagine it was a readdir thing. Thanks for all the replies. I can work with what it does. bestest Anne On Fri, 7 Nov 2008 06:27:39 +0200 Jonathan wrote: |> On Thursday 06 November 2008 22:56, Anne Wainwright wrote: |> > Hi, |> > |> > Stupid count! |> > |> > # get a list of filenames in current directory into an array |> > opendir (THISDIR, ".") or die "serious brain damage: $!"; |> > @allfiles = readdir (THISDIR); |> > closedir (THISDIR); |> > $howmany = @allfiles; |> > print "\tthere are $howmany files in the array\n\n"; |> > |> > At this point it outputs a count of 133 files in the array |> > |> > I count 125 + 1 hidden @ file + 5 subdirectories + the parent /.. = 132 |> > |> > I am sure my trusty Midnight Commander can count the files. Am I having a |> > blonde moment? |> |> Stupid question - did you count . , the directory itself? readdir does. |> |> Jonathan -- so much to do, so little time :(