From John.Hockaday at ga.gov.au Wed May 3 18:41:51 2006 From: John.Hockaday at ga.gov.au (John.Hockaday at ga.gov.au) Date: Thu, 4 May 2006 11:41:51 +1000 Subject: [Canberra-pm] Most efficient way to find the ISO 8602 date of a the most recently modifiec file in a directory Message-ID: Hi All, I am trying to find the date of the most recently modified file in a directory. I thought that someone should have done this already. I have been looking into: Date::Calc(Time_to_Date) File::stat localtime but if someone has already done this can I please have your code? The output should be in ISO 8601 format. IE, 2006-05-04T11:21:20 This latter part I can easily do with printf. Thanks. John Hockaday Geoscience Australia GPO Box 378 Canberra ACT 2601 (02) 6249 9735 http://www.ga.gov.au/ john.hockaday\@ga.gov.au From Michael.James at csiro.au Wed May 3 19:01:53 2006 From: Michael.James at csiro.au (Michael James) Date: Thu, 4 May 2006 12:01:53 +1000 Subject: [Canberra-pm] Most efficient way to find the ISO 8602 date of a the most recently modifiec file in a directory In-Reply-To: References: Message-ID: <200605041201.53921.Michael.James@csiro.au> On Thu, 4 May 2006 11:41 am, John.Hockaday at ga.gov.au wrote: > I am trying to find the date > of the most recently modified file in a directory. > I thought that someone should have done this already. > I have been looking into: > > Date::Calc(Time_to_Date) > File::stat > localtime > The output should be in ISO 8601 format. > IE, 2006-05-04T11:21:20 There is a good section on this in the perl Cookbook, recipe 3.9 page 101. You Do have the Perl Cookbook don't you? The only question is whether you need a second copy, it's a heavy book to carry around ... Seriously though, If you can't lay your hands on one quickly, I'll relay some of the goodness therein. -- Michael James michael.james at csiro.au System Administrator voice: 02 6246 5040 CSIRO Bioinformatics Facility fax: 02 6246 5166 You Do have the Perl Cookbook don't you? The only question is whether you need a second copy, it's a heavy book to carry home... seriously though, If you can't lay your hands on one quickly, I'll relay some of the goodness therein. From kim at holburn.net Wed May 3 19:21:22 2006 From: kim at holburn.net (Kim Holburn) Date: Thu, 4 May 2006 12:21:22 +1000 Subject: [Canberra-pm] Most efficient way to find the ISO 8602 date of a the most recently modifiec file in a directory In-Reply-To: References: Message-ID: <2A2D6927-38B2-4810-AD32-2B5E7D99FDF3@holburn.net> I use Posix::strftime On 2006 May 04, at 11:41 AM, wrote: > Hi All, > > I am trying to find the date of the most recently modified file in a > directory. I thought that someone should have done this already. > I have > been looking into: > > Date::Calc(Time_to_Date) > File::stat > localtime > > but if someone has already done this can I please have your code? > > The output should be in ISO 8601 format. IE, 2006-05-04T11:21:20 > This > latter part I can easily do with printf. > > Thanks. > > > John Hockaday > Geoscience Australia > GPO Box 378 > Canberra ACT 2601 > (02) 6249 9735 > http://www.ga.gov.au/ > john.hockaday\@ga.gov.au > _______________________________________________ > Canberra-pm mailing list > Canberra-pm at pm.org > http://mail.pm.org/mailman/listinfo/canberra-pm > -- Kim Holburn Security Manager, National ICT Australia Ltd. Ph: +61 2 61258620 M: +61 417820641 F: +61 2 6230 6121 mailto:kim.holburn at nicta.com.au aim://kimholburn skype://kholburn - PGP Public Key on request Cacert Root Cert: http://www.cacert.org/cacert.crt Aust. Spam Act: To stop receiving mail from me: reply and let me know. Use ISO 8601 dates [YYYY-MM-DD] http://www.saqqara.demon.co.uk/ datefmt.htm Democracy imposed from without is the severest form of tyranny. -- Lloyd Biggle, Jr. Analog, Apr 1961 -- Kim Holburn Network Consultant Ph: +61 2 61258620 M: +61 417820641 F: +61 2 6230 6121 mailto:kim at holburn.net aim://kimholburn skype://kholburn - PGP Public Key on request Cacert Root Cert: http://www.cacert.org/cacert.crt Aust. Spam Act: To stop receiving mail from me: reply and let me know. Use ISO 8601 dates [YYYY-MM-DD] http://www.saqqara.demon.co.uk/ datefmt.htm Democracy imposed from without is the severest form of tyranny. -- Lloyd Biggle, Jr. Analog, Apr 1961 From kim at holburn.net Wed May 3 22:40:34 2006 From: kim at holburn.net (Kim Holburn) Date: Thu, 4 May 2006 15:40:34 +1000 Subject: [Canberra-pm] Most efficient way to find the ISO 8602 date of a the most recently modifiec file in a directory In-Reply-To: <2A2D6927-38B2-4810-AD32-2B5E7D99FDF3@holburn.net> References: <2A2D6927-38B2-4810-AD32-2B5E7D99FDF3@holburn.net> Message-ID: <84064D75-8D9F-4214-8A77-9FFF86C2AD6A@holburn.net> Here's a script I use to get the date from log files It's a bit different to what you want as it takes the first word of the first line of a log file as an epoch timestamp.: #!/usr/bin/perl -w use strict; use POSIX qw(strftime); my $file = $ARGV[0]; my $test = 1; if ($file eq "-y") { shift; $test = 0; $file = $ARGV[0]; } my $file1 = $file; if ($file =~ /z$/i) { $file1 = "zcat $file|"; } my ($time, $junk); if (open (FILE, $file1)) { my $line = ; close FILE; ($time, $junk) = split (/\t/, $line, 2); } else { print "Couldn't open file ($file)"; exit (1); } print strftime ("%Y-%m-%dT%H:%M:%S \n", localtime ($time)); On 2006 May 04, at 12:21 PM, Kim Holburn wrote: > I use Posix::strftime > > On 2006 May 04, at 11:41 AM, > wrote: > >> Hi All, >> >> I am trying to find the date of the most recently modified file in a >> directory. I thought that someone should have done this already. >> I have >> been looking into: >> >> Date::Calc(Time_to_Date) >> File::stat >> localtime >> >> but if someone has already done this can I please have your code? >> >> The output should be in ISO 8601 format. IE, 2006-05-04T11:21:20 >> This >> latter part I can easily do with printf. >> >> Thanks. >> >> >> John Hockaday >> Geoscience Australia >> GPO Box 378 >> Canberra ACT 2601 >> (02) 6249 9735 >> http://www.ga.gov.au/ >> john.hockaday\@ga.gov.au >> _______________________________________________ >> Canberra-pm mailing list >> Canberra-pm at pm.org >> http://mail.pm.org/mailman/listinfo/canberra-pm >> > > -- > Kim Holburn > Security Manager, National ICT Australia Ltd. > Ph: +61 2 61258620 M: +61 417820641 F: +61 2 6230 6121 > mailto:kim.holburn at nicta.com.au aim://kimholburn > skype://kholburn - PGP Public Key on request > Cacert Root Cert: http://www.cacert.org/cacert.crt > Aust. Spam Act: To stop receiving mail from me: reply and let me know. > > Use ISO 8601 dates [YYYY-MM-DD] http://www.saqqara.demon.co.uk/ > datefmt.htm > Democracy imposed from without is the severest form of tyranny. > -- Lloyd Biggle, Jr. Analog, Apr 1961 > > > > > -- > Kim Holburn > Network Consultant > Ph: +61 2 61258620 M: +61 417820641 F: +61 2 6230 6121 > mailto:kim at holburn.net aim://kimholburn > skype://kholburn - PGP Public Key on request > Cacert Root Cert: http://www.cacert.org/cacert.crt > Aust. Spam Act: To stop receiving mail from me: reply and let me know. > > Use ISO 8601 dates [YYYY-MM-DD] http://www.saqqara.demon.co.uk/ > datefmt.htm > Democracy imposed from without is the severest form of tyranny. > -- Lloyd Biggle, Jr. Analog, Apr 1961 > > > _______________________________________________ > Canberra-pm mailing list > Canberra-pm at pm.org > http://mail.pm.org/mailman/listinfo/canberra-pm > -- Kim Holburn Network Consultant Ph: +61 2 61258620 M: +61 417820641 F: +61 2 6230 6121 mailto:kim at holburn.net aim://kimholburn skype://kholburn - PGP Public Key on request Cacert Root Cert: http://www.cacert.org/cacert.crt Aust. Spam Act: To stop receiving mail from me: reply and let me know. Use ISO 8601 dates [YYYY-MM-DD] http://www.saqqara.demon.co.uk/ datefmt.htm Democracy imposed from without is the severest form of tyranny. -- Lloyd Biggle, Jr. Analog, Apr 1961 From John.Hockaday at ga.gov.au Wed May 3 23:54:10 2006 From: John.Hockaday at ga.gov.au (John.Hockaday at ga.gov.au) Date: Thu, 4 May 2006 16:54:10 +1000 Subject: [Canberra-pm] Most efficient way to find the ISO 8602 date of athe most recently modifiec file in a directory Message-ID: Thanks to everyone who provided solutions. I took the first one that had code in it. Here is what I used: ############################################################ #!/usr/local/bin/perl ##################### # Checks to see if we can get the date of the last file in a directory. ##################### use strict; use Date::Manip; my ($fileDir) = "/public/http/www/docs/meta"; my ($prefix) = "ga"; opendir( DIRECTORY, "$fileDir" ) or die "Can't open directory $fileDir: $! \n"; my @entries = grep {m/\A$prefix.*/} readdir DIRECTORY; closedir DIRECTORY; return undef if (scalar at entries == 0); my $newest = 0; foreach my $file (@entries) { $file = "$fileDir/$file"; next if (!-f $file); my @stat = stat $file; if ($stat[9] > $newest) { $newest = $stat[9]; } } my $date = &ParseDateString("epoch $newest"); print &UnixDate($date, "%Y-%m-%dT%H:%M:%S"); exit(0); ############################################################ Thanks again. Great list. John > -----Original Message----- > From: canberra-pm-bounces+john.hockaday=ga.gov.au at pm.org > [mailto:canberra-pm-bounces+john.hockaday=ga.gov.au at pm.org] > On Behalf Of Michael James > Sent: Thursday, 4 May 2006 12:02 PM > To: canberra-pm at pm.org > Subject: Re: [Canberra-pm] Most efficient way to find the ISO > 8602 date of athe most recently modifiec file in a directory > > > On Thu, 4 May 2006 11:41 am, John.Hockaday at ga.gov.au wrote: > > > I am trying to find the date > > of the most recently modified file in a directory. > > I thought that someone should have done this already. > > I have been looking into: > > > > Date::Calc(Time_to_Date) > > File::stat > > localtime > > > The output should be in ISO 8601 format. > > IE, 2006-05-04T11:21:20 > > There is a good section on this in the perl Cookbook, > recipe 3.9 page 101. > > > You Do have the Perl Cookbook don't you? > The only question is whether you need a second copy, > it's a heavy book to carry around ... > > Seriously though, If you can't lay your hands on one quickly, > I'll relay some of the goodness therein. > > > -- > Michael James michael.james at csiro.au > System Administrator voice: 02 6246 5040 > CSIRO Bioinformatics Facility fax: 02 6246 5166 > > You Do have the Perl Cookbook don't you? > The only question is whether you need a second copy, > it's a heavy book to carry home... > > seriously though, If you can't lay your hands on one quickly, > I'll relay some of the goodness therein. > _______________________________________________ > Canberra-pm mailing list > Canberra-pm at pm.org > http://mail.pm.org/mailman/listinfo/canberra-pm > From jarich at perltraining.com.au Wed May 10 20:05:21 2006 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Thu, 11 May 2006 13:05:21 +1000 Subject: [Canberra-pm] Discount on upcoming Perl Training Australia courses Message-ID: <4462A9F1.2080800@perltraining.com.au> G'day everyone, Get up to two days of free training with our latest special. Perl Training Australia would like to invite you and your colleagues to join us on our next set of courses in Canberra. We're running the following courses: Course Date -------------------------------------------------------- Programming Perl 4th - 7th July 2006 Object Oriented Perl 11th - 12th July 2006 Databases and Perl 13th - 15th July 2006 Web Development with Perl 19th - 20th July 2006 Perl Security 21st July 2006 Programming Perl is the amalgamation of our two most popular courses, Introduction to Perl and Intermediate Perl. Mention Canberra Perl Mongers to get a 5% discount off any full price course. Book on multiple courses to get a 25% off each subsequent course, with our "Bundle and Save" special. For example, book on the full set (Programming Perl, Object Oriented Perl, Database Programming with Perl, Web Development with Perl and Perl Security) and you can *save $1100* per person! That's a two day course for free! Even better, if you book 3 or more attendees on each of these courses, you'll also be eligible for the "Group discount" of an additional 5% off all courses. A potential saving of *$1408* per person! To book on these courses visit http://perltraining.com.au/bookings/Melbourne.html Please don't hesitate to contact me for further information. All the best, Jacinta -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From jarich at perltraining.com.au Wed May 10 20:07:23 2006 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Thu, 11 May 2006 13:07:23 +1000 Subject: [Canberra-pm] Discount on upcoming Perl Training Australia courses In-Reply-To: <4462A9F1.2080800@perltraining.com.au> References: <4462A9F1.2080800@perltraining.com.au> Message-ID: <4462AA6B.1060209@perltraining.com.au> Jacinta Richardson wrote: > To book on these courses visit > > http://perltraining.com.au/bookings/Melbourne.html Of course this should be: http://perltraining.com.au/bookings/Canberra.html Sorry about that everyone. You're very welcome to book on Melbourne courses too if you like. ;) Jacinta -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From kim at holburn.net Sun May 21 19:46:28 2006 From: kim at holburn.net (Kim Holburn) Date: Mon, 22 May 2006 12:46:28 +1000 Subject: [Canberra-pm] Can't locate library Message-ID: <1ABECBA9-81FE-48A2-A1C3-9B15F488A231@holburn.net> Anyone give me a clue here? # l /usr/lib/perl5/5.8.0/File/ total 196 drwxr-xr-x 3 root root 4096 Jun 8 2005 ./ drwxr-xr-x 42 root root 4096 Jun 8 2005 ../ -r--r--r-- 1 root root 9420 Feb 2 2005 Basename.pm -r--r--r-- 1 root root 7351 Feb 2 2005 CheckTree.pm -r--r--r-- 1 root root 4284 Feb 2 2005 Compare.pm -r--r--r-- 1 root root 13697 Feb 2 2005 Copy.pm -r--r--r-- 1 root root 16626 Feb 2 2005 DosGlob.pm -r--r--r-- 1 root root 34332 Feb 2 2005 Find.pm -r--r--r-- 1 root root 7352 Feb 2 2005 Path.pm drwxr-xr-x 2 root root 4096 Jun 8 2005 Spec/ -r--r--r-- 1 root root 8716 Feb 2 2005 Spec.pm -r--r--r-- 1 root root 3372 Feb 2 2005 stat.pm -r--r--r-- 1 root root 54085 Feb 2 2005 Temp.pm root at inside:/opt/coldfusionmx/wwwroot/nicta_intranet/finder/people # ./aliases-exim.pl -h Can't locate FILE/Copy.pm in @INC (@INC contains: /usr/lib/ perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/ perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/ site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/ 5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/ lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi / usr/lib/perl5/5.8.0 .) at ./aliases-ADS-exim.pl line 196. BEGIN failed--compilation aborted at ./aliases-ADS-exim.pl line 196. Kim -- Kim Holburn Network Consultant Ph: +61 2 61258620 M: +61 417820641 F: +61 2 6230 6121 mailto:kim at holburn.net aim://kimholburn skype://kholburn - PGP Public Key on request Cacert Root Cert: http://www.cacert.org/cacert.crt Aust. Spam Act: To stop receiving mail from me: reply and let me know. Use ISO 8601 dates [YYYY-MM-DD] http://www.saqqara.demon.co.uk/ datefmt.htm Democracy imposed from without is the severest form of tyranny. -- Lloyd Biggle, Jr. Analog, Apr 1961 From andrew-pm at andrew.net.au Sun May 21 19:50:43 2006 From: andrew-pm at andrew.net.au (Andrew Pollock) Date: Mon, 22 May 2006 12:50:43 +1000 Subject: [Canberra-pm] Can't locate library In-Reply-To: <1ABECBA9-81FE-48A2-A1C3-9B15F488A231@holburn.net> References: <1ABECBA9-81FE-48A2-A1C3-9B15F488A231@holburn.net> Message-ID: <20060522025043.GI7015@daedalus.andrew.net.au> On Mon, May 22, 2006 at 12:46:28PM +1000, Kim Holburn wrote: > Anyone give me a clue here? > > # l /usr/lib/perl5/5.8.0/File/ > total 196 > drwxr-xr-x 3 root root 4096 Jun 8 2005 ./ > drwxr-xr-x 42 root root 4096 Jun 8 2005 ../ > -r--r--r-- 1 root root 9420 Feb 2 2005 Basename.pm > -r--r--r-- 1 root root 7351 Feb 2 2005 CheckTree.pm > -r--r--r-- 1 root root 4284 Feb 2 2005 Compare.pm > -r--r--r-- 1 root root 13697 Feb 2 2005 Copy.pm > -r--r--r-- 1 root root 16626 Feb 2 2005 DosGlob.pm > -r--r--r-- 1 root root 34332 Feb 2 2005 Find.pm > -r--r--r-- 1 root root 7352 Feb 2 2005 Path.pm > drwxr-xr-x 2 root root 4096 Jun 8 2005 Spec/ > -r--r--r-- 1 root root 8716 Feb 2 2005 Spec.pm > -r--r--r-- 1 root root 3372 Feb 2 2005 stat.pm > -r--r--r-- 1 root root 54085 Feb 2 2005 Temp.pm > root at inside:/opt/coldfusionmx/wwwroot/nicta_intranet/finder/people > # ./aliases-exim.pl -h > Can't locate FILE/Copy.pm in @INC (@INC contains: /usr/lib/ > perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/ > perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/ > site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/ > 5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/ > lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi / > usr/lib/perl5/5.8.0 .) at ./aliases-ADS-exim.pl line 196. > BEGIN failed--compilation aborted at ./aliases-ADS-exim.pl line 196. Based on the case of that error message, I'd say that your Perl script is trying to use FILE::Copy instead of File::Copy regards Andrew From John.Hockaday at ga.gov.au Sun May 21 19:51:40 2006 From: John.Hockaday at ga.gov.au (John.Hockaday at ga.gov.au) Date: Mon, 22 May 2006 12:51:40 +1000 Subject: [Canberra-pm] Can't locate library Message-ID: Kim, The path to the Copy.pm package "/usr/lib/perl5/5.8.0/File" is not in your @INC array. You can fix this by adding in your script: use lib "/usr/lib/perl5/5.8.0/File"; It should find it then. There are other ways of doing this by setting your LD_LIBRARY_PATH but that may not be available on your operating system. I hope that this helps. John > -----Original Message----- > From: canberra-pm-bounces+john.hockaday=ga.gov.au at pm.org > [mailto:canberra-pm-bounces+john.hockaday=ga.gov.au at pm.org] > On Behalf Of Kim Holburn > Sent: Monday, 22 May 2006 12:46 PM > To: canberra-pm at pm.org > Subject: [Canberra-pm] Can't locate library > > > Anyone give me a clue here? > > # l /usr/lib/perl5/5.8.0/File/ > total 196 > drwxr-xr-x 3 root root 4096 Jun 8 2005 ./ > drwxr-xr-x 42 root root 4096 Jun 8 2005 ../ > -r--r--r-- 1 root root 9420 Feb 2 2005 Basename.pm > -r--r--r-- 1 root root 7351 Feb 2 2005 CheckTree.pm > -r--r--r-- 1 root root 4284 Feb 2 2005 Compare.pm > -r--r--r-- 1 root root 13697 Feb 2 2005 Copy.pm > -r--r--r-- 1 root root 16626 Feb 2 2005 DosGlob.pm > -r--r--r-- 1 root root 34332 Feb 2 2005 Find.pm > -r--r--r-- 1 root root 7352 Feb 2 2005 Path.pm > drwxr-xr-x 2 root root 4096 Jun 8 2005 Spec/ > -r--r--r-- 1 root root 8716 Feb 2 2005 Spec.pm > -r--r--r-- 1 root root 3372 Feb 2 2005 stat.pm > -r--r--r-- 1 root root 54085 Feb 2 2005 Temp.pm > root at inside:/opt/coldfusionmx/wwwroot/nicta_intranet/finder/people > # ./aliases-exim.pl -h > Can't locate FILE/Copy.pm in @INC (@INC contains: /usr/lib/ > perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/ > perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/ > site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/ > 5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/ > lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi / > usr/lib/perl5/5.8.0 .) at ./aliases-ADS-exim.pl line 196. > BEGIN failed--compilation aborted at ./aliases-ADS-exim.pl line 196. > > > Kim > -- > Kim Holburn > Network Consultant > Ph: +61 2 61258620 M: +61 417820641 F: +61 2 6230 6121 > mailto:kim at holburn.net aim://kimholburn > skype://kholburn - PGP Public Key on request > Cacert Root Cert: http://www.cacert.org/cacert.crt > Aust. Spam Act: To stop receiving mail from me: reply and let me know. > > Use ISO 8601 dates [YYYY-MM-DD] http://www.saqqara.demon.co.uk/ > datefmt.htm > Democracy imposed from without is the severest form of tyranny. > -- Lloyd Biggle, Jr. Analog, Apr 1961 > > > _______________________________________________ > Canberra-pm mailing list > Canberra-pm at pm.org > http://mail.pm.org/mailman/listinfo/canberra-pm > From kim at holburn.net Sun May 21 19:55:50 2006 From: kim at holburn.net (Kim Holburn) Date: Mon, 22 May 2006 12:55:50 +1000 Subject: [Canberra-pm] Can't locate library In-Reply-To: <20060522025043.GI7015@daedalus.andrew.net.au> References: <1ABECBA9-81FE-48A2-A1C3-9B15F488A231@holburn.net> <20060522025043.GI7015@daedalus.andrew.net.au> Message-ID: <096A8B63-4BB2-4DDC-9B77-4C6964CAD98E@holburn.net> Ah Crap, Thanks Andrew. On 2006 May 22, at 12:50 PM, Andrew Pollock wrote: > On Mon, May 22, 2006 at 12:46:28PM +1000, Kim Holburn wrote: >> Anyone give me a clue here? >> > > Based on the case of that error message, I'd say that your Perl > script is > trying to use FILE::Copy instead of File::Copy > > regards > > Andrew > -- Kim Holburn Security Manager, National ICT Australia Ltd. Ph: +61 2 61258620 M: +61 417820641 F: +61 2 6230 6121 mailto:kim.holburn at nicta.com.au aim://kimholburn skype://kholburn - PGP Public Key on request Cacert Root Cert: http://www.cacert.org/cacert.crt Aust. Spam Act: To stop receiving mail from me: reply and let me know. Use ISO 8601 dates [YYYY-MM-DD] http://www.saqqara.demon.co.uk/ datefmt.htm Democracy imposed from without is the severest form of tyranny. -- Lloyd Biggle, Jr. Analog, Apr 1961 From grail at goldweb.com.au Mon May 22 05:53:14 2006 From: grail at goldweb.com.au (Alex Satrapa) Date: Mon, 22 May 2006 22:53:14 +1000 Subject: [Canberra-pm] Looking for maintenance/documentation contractor Message-ID: <3546740A-E750-4EF7-85A4-3F1F6922E89E@goldweb.com.au> Apologies if this is an inappropriate forum, but my employer is looking for a Perl/SQL programmer familiar with documenting and maintaining legacy code. We have a web-based application which was written over the course of 5 years - most of the documentation about how things work is in the original programmer's head, and he's on long service leave for another 7 months. If you have experience with documenting the code left behind by others, and even better maintaining old code (bug fixes, adding features, refactoring, writing regression tests), please contact me - reply to this message, or send a message to alex.satrapa at anu.edu.au expressing your interest. We will tailor the contract to the skills of the contractor, and we need the extra body. So if you or someone you now might even be interested in doing some maintenance work at a junior level, we'd love to hear from you just as much as the established and experienced contractor. I'm just a point of contact, I can't talk dollars and cents but I can tell you about the work. Alex Satrapa M: +61 4 0770 5332 grail at goldweb.com.au From andrew-pm at andrew.net.au Wed May 24 17:53:57 2006 From: andrew-pm at andrew.net.au (Andrew Pollock) Date: Thu, 25 May 2006 10:53:57 +1000 Subject: [Canberra-pm] Recursion in Perl Message-ID: <20060525005357.GU7015@daedalus.andrew.net.au> My turn to ask a question. (Disclaimer: recursion does my head in at the best of times) I'm trying to walk through a bunch a config files to build up a data structure that represents the inclusion relationships between them. So at the moment, as I prototype this, I've got a subroutine that will call itself again on a file if it hasn't already seen it, and see what includes it mentions, and then call itself again on them. What I seem to be encountering is a bunch of "readline() on closed filehandle" errors, so I'm wondering if the filehandle namespace isn't unique to each call of the subroutine, and I'm closing it in a subsequent invokation, or I've caused my brain to explode in another more subtle manner. regards Andrew From kim at holburn.net Wed May 24 18:24:34 2006 From: kim at holburn.net (Kim Holburn) Date: Thu, 25 May 2006 11:24:34 +1000 Subject: [Canberra-pm] Recursion in Perl In-Reply-To: <20060525005357.GU7015@daedalus.andrew.net.au> References: <20060525005357.GU7015@daedalus.andrew.net.au> Message-ID: <0A74A2E3-E46C-40B8-A5D8-BAEB7EAE5E84@holburn.net> Can't you slurp the file into an array or hash once then refer to it in each recursion? This would surely be better than reading it over and over. On 2006 May 25, at 10:53 AM, Andrew Pollock wrote: > My turn to ask a question. > > (Disclaimer: recursion does my head in at the best of times) > > I'm trying to walk through a bunch a config files to build up a data > structure that represents the inclusion relationships between them. > > So at the moment, as I prototype this, I've got a subroutine that > will call > itself again on a file if it hasn't already seen it, and see what > includes > it mentions, and then call itself again on them. > > What I seem to be encountering is a bunch of "readline() on closed > filehandle" errors, so I'm wondering if the filehandle namespace isn't > unique to each call of the subroutine, and I'm closing it in a > subsequent > invokation, or I've caused my brain to explode in another more subtle > manner. > > regards > > Andrew > _______________________________________________ > Canberra-pm mailing list > Canberra-pm at pm.org > http://mail.pm.org/mailman/listinfo/canberra-pm > -- Kim Holburn Network Consultant Ph: +61 2 61258620 M: +61 417820641 F: +61 2 6230 6121 mailto:kim at holburn.net aim://kimholburn skype://kholburn - PGP Public Key on request Cacert Root Cert: http://www.cacert.org/cacert.crt Aust. Spam Act: To stop receiving mail from me: reply and let me know. Use ISO 8601 dates [YYYY-MM-DD] http://www.saqqara.demon.co.uk/ datefmt.htm Democracy imposed from without is the severest form of tyranny. -- Lloyd Biggle, Jr. Analog, Apr 1961 From jepri at alphacomplex.org Wed May 24 19:09:19 2006 From: jepri at alphacomplex.org (Jepri) Date: Thu, 25 May 2006 12:09:19 +1000 Subject: [Canberra-pm] Recursion in Perl In-Reply-To: <20060525005357.GU7015@daedalus.andrew.net.au> References: <20060525005357.GU7015@daedalus.andrew.net.au> Message-ID: <447511CF.1010604@alphacomplex.org> Heh, I had to resubscribe to the list to post this You haven't included any code, so I'm going to have to guess a little here. If you are using filehandles created with open HANDLE, "<", "file" then HANDLE is NOT lexical (does not behave like a normal variable), and further calls to your function will overwrite HANDLE, possibly causing the first one to close. I'm a bit vague here because I never use FILEHANDLES due to their scoping issues. If you use the (much better) lexical my $handle; open $handle, "<", "file" then $handle is lexically scoped and will be handled with the usual variable rules. If you're using this method then I'd really need to see some code to help further. HTH, Jeremy Andrew Pollock wrote: >My turn to ask a question. > >(Disclaimer: recursion does my head in at the best of times) > >I'm trying to walk through a bunch a config files to build up a data >structure that represents the inclusion relationships between them. > >So at the moment, as I prototype this, I've got a subroutine that will call >itself again on a file if it hasn't already seen it, and see what includes >it mentions, and then call itself again on them. > >What I seem to be encountering is a bunch of "readline() on closed >filehandle" errors, so I'm wondering if the filehandle namespace isn't >unique to each call of the subroutine, and I'm closing it in a subsequent >invokation, or I've caused my brain to explode in another more subtle >manner. > >regards > >Andrew >_______________________________________________ >Canberra-pm mailing list >Canberra-pm at pm.org >http://mail.pm.org/mailman/listinfo/canberra-pm > > > From andrew-pm at andrew.net.au Wed May 24 19:13:57 2006 From: andrew-pm at andrew.net.au (Andrew Pollock) Date: Thu, 25 May 2006 12:13:57 +1000 Subject: [Canberra-pm] Recursion in Perl In-Reply-To: <4475101B.7010205@alphacomplex.org> References: <20060525005357.GU7015@daedalus.andrew.net.au> <4475101B.7010205@alphacomplex.org> Message-ID: <20060525021357.GV7015@daedalus.andrew.net.au> On Thu, May 25, 2006 at 12:02:03PM +1000, Jepri wrote: > You haven't included any code, so I'm going to have to guess a little here. > > If you are using filehandles created with > > open HANDLE, " > then HANDLE is NOT lexical (does not behave like a normal variable), and > further calls to your function will overwrite HANDLE, probably causing > the first one to close. I'm guessing here because I never use > FILEHANDLES due to their scoping issues. I was using this method. > If you use the (much better) lexical > > my $handle; open $handle, " > then $handle is lexically scoped and will be automatically closed when > you leave scope. If you're using this construction then I'd really need > to see some code to help further. Yeah, this looks (and sounds) better. I actually got around the problem (mostly) by loading up an array with all the files I discovered, and then after I closed the file, loop over the array and call the recursive subroutine, so the file wasn't kept open as it recursed. regards Andrew From kim at holburn.net Wed May 24 20:16:33 2006 From: kim at holburn.net (Kim Holburn) Date: Thu, 25 May 2006 13:16:33 +1000 Subject: [Canberra-pm] Recursion in Perl In-Reply-To: <20060525021357.GV7015@daedalus.andrew.net.au> References: <20060525005357.GU7015@daedalus.andrew.net.au> <4475101B.7010205@alphacomplex.org> <20060525021357.GV7015@daedalus.andrew.net.au> Message-ID: <21B44E77-5B4B-43B1-9F4C-B660487EDA44@holburn.net> There's an excellent section on why not to use bare-word filehandles in "Perl Best Practises" which explains it but I always forget it and do it wrong. On 2006 May 25, at 12:13 PM, Andrew Pollock wrote: > On Thu, May 25, 2006 at 12:02:03PM +1000, Jepri wrote: >> You haven't included any code, so I'm going to have to guess a >> little here. >> >> If you are using filehandles created with >> >> open HANDLE, "> >> then HANDLE is NOT lexical (does not behave like a normal >> variable), and >> further calls to your function will overwrite HANDLE, probably >> causing >> the first one to close. I'm guessing here because I never use >> FILEHANDLES due to their scoping issues. > > I was using this method. > >> If you use the (much better) lexical >> >> my $handle; open $handle, "> >> then $handle is lexically scoped and will be automatically closed >> when >> you leave scope. If you're using this construction then I'd >> really need >> to see some code to help further. > > Yeah, this looks (and sounds) better. I actually got around the > problem > (mostly) by loading up an array with all the files I discovered, > and then > after I closed the file, loop over the array and call the recursive > subroutine, so the file wasn't kept open as it recursed. > > regards > > Andrew > _______________________________________________ > Canberra-pm mailing list > Canberra-pm at pm.org > http://mail.pm.org/mailman/listinfo/canberra-pm > -- Kim Holburn Network Consultant Ph: +61 2 61258620 M: +61 417820641 F: +61 2 6230 6121 mailto:kim at holburn.net aim://kimholburn skype://kholburn - PGP Public Key on request Cacert Root Cert: http://www.cacert.org/cacert.crt Aust. Spam Act: To stop receiving mail from me: reply and let me know. Use ISO 8601 dates [YYYY-MM-DD] http://www.saqqara.demon.co.uk/ datefmt.htm Democracy imposed from without is the severest form of tyranny. -- Lloyd Biggle, Jr. Analog, Apr 1961 From steve at nerdvana.org.au Wed May 24 21:24:00 2006 From: steve at nerdvana.org.au (Steve Walsh) Date: Thu, 25 May 2006 14:24:00 +1000 Subject: [Canberra-pm] Perl Flavoured PSIG In-Reply-To: <21B44E77-5B4B-43B1-9F4C-B660487EDA44@holburn.net> Message-ID: Hi Folks Just a reminder than the June PSIG (June 8th) is a Perl-Flavoured Programmer's Special Interest Group. If you have anything Perl-related you'd like to talk about, please feel free to drop me a line. It doesn't have to be any thing long, complex or convoluted, even if you'd like to expound the virtues of use strict. Hope to hear from some one soon. Steve From andrew-pm at andrew.net.au Wed May 24 22:07:34 2006 From: andrew-pm at andrew.net.au (Andrew Pollock) Date: Thu, 25 May 2006 15:07:34 +1000 Subject: [Canberra-pm] Recursion in Perl In-Reply-To: <21B44E77-5B4B-43B1-9F4C-B660487EDA44@holburn.net> References: <20060525005357.GU7015@daedalus.andrew.net.au> <4475101B.7010205@alphacomplex.org> <20060525021357.GV7015@daedalus.andrew.net.au> <21B44E77-5B4B-43B1-9F4C-B660487EDA44@holburn.net> Message-ID: <20060525050734.GW7015@daedalus.andrew.net.au> On Thu, May 25, 2006 at 01:16:33PM +1000, Kim Holburn wrote: > There's an excellent section on why not to use bare-word filehandles > in "Perl Best Practises" which explains it but I always forget it and > do it wrong. Ah yes, I've bought that book, but it's sitting on the shelf unread because I'm working in a mostly Python shop... regards Andrew From jarich at perltraining.com.au Wed May 24 22:48:47 2006 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Thu, 25 May 2006 15:48:47 +1000 (EST) Subject: [Canberra-pm] Perl Flavoured PSIG In-Reply-To: Message-ID: > Just a reminder than the June PSIG (June 8th) is a Perl-Flavoured > Programmer's Special Interest Group. Damn. I was expecting the next Perl P-SIG to be in July and was hoping to suggest we move it forward a week (to the first Thursday) so that Paul could be in town and give a talk (assuming the course goes ahead... likely) Well I guess Paul could just give a talk anyway... Two PM meetings in a row! (And if the DBI course goes ahead, he'll be able to make it to the regular PSIG meet too). All the best, Jacinta -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From steve at nerdvana.org.au Wed May 24 22:57:25 2006 From: steve at nerdvana.org.au (Steve Walsh) Date: Thu, 25 May 2006 15:57:25 +1000 Subject: [Canberra-pm] Perl Flavoured PSIG In-Reply-To: Message-ID: Hmm...I had it down as June, but I could be wrong on that... (very rare, but it has been known to happen)... I'm happy to move it a month, but trying to move the PSIG by a week is a bit hard, as a gaming group meet there on the Thursday before PSIG. I can see it now; "I can speak Middle Elfen" "So what, I can speak Perl" "It's the same thing you idiot" Steve. -----Original Message----- From: Jacinta Richardson [mailto:jarich at perltraining.com.au] Sent: Thursday, 25 May 2006 3:49 PM To: Steve Walsh Cc: canberra-pm at pm.org Subject: Re: [Canberra-pm] Perl Flavoured PSIG > Just a reminder than the June PSIG (June 8th) is a Perl-Flavoured > Programmer's Special Interest Group. Damn. I was expecting the next Perl P-SIG to be in July and was hoping to suggest we move it forward a week (to the first Thursday) so that Paul could be in town and give a talk (assuming the course goes ahead... likely) Well I guess Paul could just give a talk anyway... Two PM meetings in a row! (And if the DBI course goes ahead, he'll be able to make it to the regular PSIG meet too). All the best, Jacinta -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From jarich at perltraining.com.au Mon May 29 00:55:21 2006 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Mon, 29 May 2006 17:55:21 +1000 Subject: [Canberra-pm] Open Source Developers' Conference 2006 - Call for papers Message-ID: <447AA8E9.4040706@perltraining.com.au> http://www.osdc.com.au/papers/cfp06.html The Open Source Developers' Conference is an Australian conference designed for developers, by developers. It covers numerous programming languages across a range of operating systems. We're seeking papers on Open Source languages, technologies, projects and tools as well as topics of interest to Open Source developers. The conference will be held in Melbourne, Victoria (Monash University's Caulfield Campus) from the 6th to the 8th of December, 2006. Last year's conference had about 160 people and around 60 presentations on a range of topics - see http://osdc2005.cgpublisher.com/proposals/ for a list. This list might also be useful if you're looking for ideas on what sort of thing would be appropriate. If you have any questions, or have never submitted a paper proposal before, please read our FAQ page at http://www.osdc.com.au/faq/index.html If you don't find an answer there, please contact richard at osdc.com.au To submit a proposal, follow the instructions at http://www.osdc.com.au/papers/cfp06.html This year we're also going to run a day of tutorials. See the CFP for more information. The deadline for proposals is 12th July 2006. Hope to see you there! The OSDC 2006 committee.