From pjf at perltraining.com.au Wed Jan 9 00:30:41 2002 From: pjf at perltraining.com.au (Paul Fenwick) Date: Wed Aug 4 00:02:29 2004 Subject: Melb.pm meetings Message-ID: <20020109173041.K4705@mukc.org.au> G'day everyone, I haven't heard any objections to the 2nd Wednesday of each month at 6pm idea, so I presume that everyone's happy with it. So, I'm going to start putting names with dates and see how people react. :) Venue: MyInternet House, Blackwood St, North Melbourne Time: 6pm February 13th - Fastmail.FM (Jeremy Howard & Rob Mueller) March 13th - Extreme Perl (Damian Conway) April 10th - Perl Redispatch (Paul Fenwick) May 8th - Bovine Perl(?) (Rob Casey) Anyone who wants to insert/delete themselves from talks, please do so sooner rather than later, so that alternate speakers can be arranged. Scotty came up with the suggestion that we have 4-6 short talks (of say five minutes each) at each meeting, so people have the chance to talk about new modules or ideas or whatever. I think it's a great idea. So if you want to do a short talk on anything Perl related at all, just announce your intention to do so. Damian has mentioned that his talk will take a good 2-3 hours, and he has a long drive afterwards, so I suggest we keep the short talks light (or non-existant) for March. I'm happy to volunteer myself for a short humourous talk on using strict for the Feb meeting. :) All the best, Paul -- Paul Fenwick | http://perltraining.com.au/ Director of Training | Ph: +61 3 9354 6001 Perl Training Australia | Fax: +61 3 9354 2681 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/melbourne-pm/attachments/20020109/fbefac04/attachment.bin From scottp at dd.com.au Wed Jan 9 03:23:03 2002 From: scottp at dd.com.au (Scott Penrose) Date: Wed Aug 4 00:02:29 2004 Subject: Melb.pm meetings In-Reply-To: <20020109173041.K4705@mukc.org.au> Message-ID: <7B4A2BE0-04E2-11D6-B93F-003065B58CF8@dd.com.au> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday, January 9, 2002, at 05:30 , Paul Fenwick wrote: > G'day everyone, > > I haven't heard any objections to the 2nd Wednesday of > each month at 6pm idea, so I presume that everyone's happy with > it. So, I'm going to start putting names with dates and see > how people react. :) Yes you did. I objected ot the time. I am concerned that people will not be able to get there in time :-) > Venue: MyInternet House, Blackwood St, North Melbourne > Time: 6pm > > February 13th - Fastmail.FM (Jeremy Howard & Rob Mueller) > March 13th - Extreme Perl (Damian Conway) > April 10th - Perl Redispatch (Paul Fenwick) > May 8th - Bovine Perl(?) (Rob Casey) > > Anyone who wants to insert/delete themselves from talks, please > do so sooner rather than later, so that alternate speakers can > be arranged. > > Scotty came up with the suggestion that we have 4-6 short talks > (of say five minutes each) at each meeting, so people have the > chance to talk about new modules or ideas or whatever. I think it's > a great idea. So if you want to do a short talk on anything > Perl related at all, just announce your intention to do so. I am happy to fit in a few (since I suggested it :-) Beginner: - IO:File (and others) NOT open(FILE) - File::* (Path, Basename...) - Time::HiRes - Net::* (SMTP, POP, and more) - Data::Dumper - Date::Parse - Sys::Hostname (and my Sys::Hostname::Long) More Advanced - XML::Parser - overload - VCS - Device::SerialPort (and my own Device::SerialPort2) Just slot em in Paul. As a talk (maybe June...) I can do a talk on Unicode in perl (in particular utf8) > Damian has mentioned that his talk will take a good 2-3 hours, > and he has a long drive afterwards, so I suggest we keep the > short talks light (or non-existant) for March. Non-existant that week I think. > I'm happy to volunteer myself for a short humourous talk on > using strict for the Feb meeting. :) You mean there are people out there not using strict :-) Only kidding. Damian would have lots to say about only using police if you are in New York, and needing only Mounties if in Canada :-) Scott - --- Scott Penrose Open source and Linux Developer http://linux.dd.com.au/ scottp@dd.com.au -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE8PAv8DCFCcmAm26YRAkc/AJ4hRekaXqSkPaQZBK7bmXFJFavSiQCfaM7k 0e+R+V8S004NRPLRuCXoRq4= =dM3C -----END PGP SIGNATURE----- From jh_lists at fastmail.fm Wed Jan 9 19:12:30 2002 From: jh_lists at fastmail.fm (Jeremy Howard) Date: Wed Aug 4 00:02:29 2004 Subject: Melb.pm meetings References: <7B4A2BE0-04E2-11D6-B93F-003065B58CF8@dd.com.au> Message-ID: <009f01c19973$e5c2eb50$0101460a@optimaldecisions.com> > > February 13th - Fastmail.FM (Jeremy Howard & Rob Mueller) This is bad timing for us. Rob's going on holidays about this time. Put us back to June/July--we'll have been running commercially for a few months by then so will be able to talk more about how things actually went (rather than just the theory!) > > You mean there are people out there not using strict :-) > Only kidding. Damian would have lots to say about only using police if > you are in New York, and needing only Mounties if in Canada :-) > Damian scares me--he never uses strict, and it doesn't seem to bother him at all. I don't think I'd be able to produce working code without it, on the other hand. I guess that's why Damian is a Damian and I'm not. ;-) From scottp at dd.com.au Wed Jan 9 19:33:11 2002 From: scottp at dd.com.au (Scott Penrose) Date: Wed Aug 4 00:02:29 2004 Subject: Melb.pm meetings In-Reply-To: <009f01c19973$e5c2eb50$0101460a@optimaldecisions.com> Message-ID: <027E8085-056A-11D6-B93F-003065B58CF8@dd.com.au> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, January 10, 2002, at 12:12 , Jeremy Howard wrote: >> You mean there are people out there not using strict :-) >> Only kidding. Damian would have lots to say about only using police if >> you are in New York, and needing only Mounties if in Canada :-) >> > Damian scares me--he never uses strict, and it doesn't seem to bother > him at > all. I don't think I'd be able to produce working code without it, on > the > other hand. I guess that's why Damian is a Damian and I'm not. ;-) Personally I can't see a reason to NOT use strict... However, in Damians case, especially modules such as "NEXT" (one of my favorite examples of why perl is cool, an extension to the language written in native perl) you have to not use strict. I have a philosophy that I try and force on our developers where I work, which is you can do bad evil things in perl (eg: NEXT) and that is fine, but abstract it off into a separate module, both reusable and easy to test, code review etc. A good example is complex sorts. A neat feature (see use.perl.org) a while ago suggested that the fastest way to do a sort on multiple fields is to use pack and then the built in sort without an anonymous sub. By not passing a sub you are using the built in fast C sort method. Very cool, one of our developers used that to produce a massive increase in the performance of a mail system. However the code looks confusing and nasty, so it is best to either put it in a class method somewhere or make the array an object and a new method on that. eg: foreach my $bit ($ref->sort) or foreach my $bit (MyFastSort::sort(@somearray)) Scott - --- Scott Penrose Open source and Linux Developer http://linux.dd.com.au/ scottp@dd.com.au -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE8PO9fDCFCcmAm26YRAloSAJ48RG7X/4eGCb6/qu/jmCVaNVHAfQCfZDY3 25zufiUyigZpvV2ONnwRKyw= =mFS2 -----END PGP SIGNATURE----- From pmartin1 at bigpond.net.au Wed Jan 9 22:38:23 2002 From: pmartin1 at bigpond.net.au (pmartin1@bigpond.net.au) Date: Wed Aug 4 00:02:29 2004 Subject: Sorting queries. [was: Melb. PM] In-Reply-To: <027E8085-056A-11D6-B93F-003065B58CF8@dd.com.au> References: <009f01c19973$e5c2eb50$0101460a@optimaldecisions.com> Message-ID: <3C3DB56F.2062.507EB2C@localhost> On 10 Jan 2002, at 12:33, Scott Penrose wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > On Thursday, January 10, 2002, at 12:12 , Jeremy Howard wrote: > >> You mean there are people out there not using strict :-) > >> Only kidding. Damian would have lots to say about only using police > >> if you are in New York, and needing only Mounties if in Canada :-) > >> > > Damian scares me--he never uses strict, and it doesn't seem to > > bother him at all. I don't think I'd be able to produce working code > > without it, on the other hand. I guess that's why Damian is a Damian > > and I'm not. ;-) > > Personally I can't see a reason to NOT use strict... > However, in Damians case, especially modules such as "NEXT" (one of my > favorite examples of why perl is cool, an extension to the language > written in native perl) you have to not use strict. > > I have a philosophy that I try and force on our developers where I > work, which is you can do bad evil things in perl (eg: NEXT) and that > is fine, but abstract it off into a separate module, both reusable and > easy to test, code review etc. > > A good example is complex sorts. A neat feature (see use.perl.org) a > while ago suggested that the fastest way to do a sort on multiple > fields is to use pack and then the built in sort without an anonymous > sub. By not passing a sub you are using the built in fast C sort > method. Very cool, one of our developers used that to produce a > massive increase in the performance of a mail system. However the code > looks confusing and nasty, so it is best to either put it in a class > method somewhere or make the array an object and a new method on that. > eg: > foreach my $bit ($ref->sort) > or > foreach my $bit (MyFastSort::sort(@somearray)) > When the first draft of the paper showing that sort method was published, there was a suggestion the authors were throwing together a module to handle this kind of sorting. Anyone seen/heard what happened with that proposed module ? Meanwhile, I seem to recall the (revised) inbuilt sort in Perl was a quicksort with a median-of-three partitioning method for elements, and a subroutine for partly-sorted partitions that switched to insertion or bubble sort . I thought I could recognise the C code for this when I saw it, but looking at the Perl source only made my head hurt. Anyone recall the algorithms applied ? From pjf at perltraining.com.au Wed Jan 9 22:48:17 2002 From: pjf at perltraining.com.au (Paul Fenwick) Date: Wed Aug 4 00:02:29 2004 Subject: Melb.pm meetings In-Reply-To: <027E8085-056A-11D6-B93F-003065B58CF8@dd.com.au>; from scottp@dd.com.au on Thu, Jan 10, 2002 at 12:33:11PM +1100 References: <009f01c19973$e5c2eb50$0101460a@optimaldecisions.com> <027E8085-056A-11D6-B93F-003065B58CF8@dd.com.au> Message-ID: <20020110154816.D7839@mukc.org.au> G'day Scott/Mongers, On Thu, Jan 10, 2002 at 12:33:11PM +1100, Scott Penrose wrote: > Personally I can't see a reason to NOT use strict... > However, in Damians case, especially modules such as "NEXT" (one of my > favorite examples of why perl is cool, an extension to the language > written in native perl) you have to not use strict. *ahem* NEXT.pm uses strict. :) Of course, Damian removed all the in-line comments explaining how it all works from the patches I sent him. Hence the code as you see it today (0.50). If anyone's really curious as to how NEXT works, I'm sure I've got the original patches around someplace. > I have a philosophy that I try and force on our developers where I work, > which is you can do bad evil things in perl (eg: NEXT) and that is fine, > but abstract it off into a separate module, both reusable and easy to > test, code review etc. I'd say the same should go for nice good things written in Perl as well. Code reuse is your friend. :) Cheers, Paul -- Paul Fenwick | http://perltraining.com.au/ Director of Training | Ph: +61 3 9354 6001 Perl Training Australia | Fax: +61 3 9354 2681 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/melbourne-pm/attachments/20020110/c2f3b05d/attachment.bin From scottp at dd.com.au Wed Jan 9 23:16:27 2002 From: scottp at dd.com.au (Scott Penrose) Date: Wed Aug 4 00:02:29 2004 Subject: Melb.pm meetings In-Reply-To: <20020110154816.D7839@mukc.org.au> Message-ID: <32B2826A-0589-11D6-B93F-003065B58CF8@dd.com.au> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, January 10, 2002, at 03:48 , Paul Fenwick wrote: > G'day Scott/Mongers, > > On Thu, Jan 10, 2002 at 12:33:11PM +1100, Scott Penrose wrote: > >> Personally I can't see a reason to NOT use strict... >> However, in Damians case, especially modules such as "NEXT" (one of my >> favorite examples of why perl is cool, an extension to the language >> written in native perl) you have to not use strict. > > *ahem* NEXT.pm uses strict. :) Woops, my mistake, can't see them now, but there where examples he gave in last years talk which could not use strict. Scott - --- Scott Penrose Open source and Linux Developer http://linux.dd.com.au/ scottp@dd.com.au -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE8PSOwDCFCcmAm26YRAhkuAKCveOWKF13AxcJIf0hseI+4g9UUMQCcCQP0 Xg1nn5KnvyFmZZMWYF2CUbE= =qVSt -----END PGP SIGNATURE----- From agray at netconnect.com.au Fri Jan 11 00:50:23 2002 From: agray at netconnect.com.au (Andrew Gray) Date: Wed Aug 4 00:02:29 2004 Subject: Melb.pm meetings References: <32B2826A-0589-11D6-B93F-003065B58CF8@dd.com.au> Message-ID: <015e01c19a6c$3e6115e0$f135190a@netconnect.net.au> could someone kind please tell me how to sort a hash table ie I have the following code fragment, sorry if it's not elegant, I'm not a perl guru (yet!) and I want to sort by ip number so the file gets written ordered. open(LOG, "> deny.log") or die("Cant open deny.log for writing\n"); foreach $ip (keys %denylog) { ($sec,$min,$hour,$mday,$mon,$year,$wday,$ydat,$isdst) = localtime($denylog{$ip}); $year+=1900; $human_time=$year."/".$mon."/".$mday." ".$hour."\.".$min; if ( ($time-$denylog{$ip}) < $expire_time ) { print LOG ($ip,":",$denylog{$ip},": ",$human_time,"\n"); } else { # print "$ip was removed from deny list as it is too old\n"; $deny_list{$ip}=''; # remove it from the %deny_list as it has aged out of list } } close(LOG); regards Andrew Gray Systems Administrator, NetConnect Communications sysadmin@netconnect.com.au From scottp at dd.com.au Fri Jan 11 01:14:30 2002 From: scottp at dd.com.au (Scott Penrose) Date: Wed Aug 4 00:02:29 2004 Subject: Melb.pm meetings In-Reply-To: <015e01c19a6c$3e6115e0$f135190a@netconnect.net.au> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, January 11, 2002, at 05:50 , Andrew Gray wrote: > could someone kind please tell me how to sort a hash table > ie I have the following code fragment, sorry if it's not elegant, I'm > not a > perl guru (yet!) > and I want to sort by ip number so the file gets written ordered. > > open(LOG, "> deny.log") or die("Cant open deny.log for writing\n"); > foreach $ip (keys %denylog) in theory you can just do foreach my $ip (sort keys %denylog) { And that will sort your keys nicely, but it is alphabetically, not by IP number. eg: 100.1.1.1 2.3.3.3 2 would come after 100. What you really probably need to do is turn it into a 32 bit integer (does anyone remember the method?) You can think of arrays just like piping on the command line. %denylog returns pairs, key, value for each entry in the hash. keys returns the first of these (where as values returns just the values of each) then sort sorts those keys, you can add other things like grep and more. Also you can pass a sub... eg: foreach my $ip (sort {Net2Int($a) <=> Net2Int($b)} keys %denylog) { Of course you would have to have a sub Net2Int. $a is always the first and $b in a bubble sort being automatically run by sort. Scott > { > ($sec,$min,$hour,$mday,$mon,$year,$wday,$ydat,$isdst) = > localtime($denylog{$ip}); > $year+=1900; > $human_time=$year."/".$mon."/".$mday." ".$hour."\.".$min; > if ( ($time-$denylog{$ip}) < $expire_time ) > { > print LOG ($ip,":",$denylog{$ip},": ",$human_time,"\n"); > } else { > # print "$ip was removed from deny list as it is too > old\n"; > $deny_list{$ip}=''; # remove it from the %deny_list > as > it has aged out of list > } > } > close(LOG); > > > regards > > Andrew Gray > Systems Administrator, NetConnect Communications > sysadmin@netconnect.com.au > > > > > - --- Scott Penrose Open source and Linux Developer http://linux.dd.com.au/ scottp@dd.com.au -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE8PpDbDCFCcmAm26YRAtjiAJ91IC+5vrln219SohKOpFDQT4O5EgCfeV+T 4PqIyRrJovE9xyiyFzk/oj4= =VNdS -----END PGP SIGNATURE----- From Nathan.Bailey at its.monash.edu Fri Jan 11 02:46:34 2002 From: Nathan.Bailey at its.monash.edu (Nathan Bailey) Date: Wed Aug 4 00:02:29 2004 Subject: Melb.pm meetings In-Reply-To: agray's message of Fri, 11 Jan 2002 17:50:23 +1100. <015e01c19a6c$3e6115e0$f135190a@netconnect.net.au> Message-ID: <200201110846.TAA12184@goaway.cc.monash.edu.au> Andrew Gray wrote: >open(LOG, "> deny.log") or die("Cant open deny.log for writing\n"); personally, I like to make liberal use of $!, since it tends to tell you why it, failed, so: open(LOG, "> deny.log") or die("Cant open deny.log for writing: $!\n"); >foreach $ip (keys %denylog) There are two ways to sort a hash -- by key, or by value. From the code/your request, it seems you want by key, which is the easier of the two: foreach $ip (sort keys %denylog) but you can also do it by value -- and the man pages tell you how. See: perldoc -f sort and search for "by value" > $deny_list{$ip}=''; # remove it from the %deny_list as >it has aged out of list If you really want to remove it, why not delete $deny_list{$ip}; it? regards, Nate From Nathan.Bailey at its.monash.edu Fri Jan 11 02:56:57 2002 From: Nathan.Bailey at its.monash.edu (Nathan Bailey) Date: Wed Aug 4 00:02:29 2004 Subject: Melb.pm meetings In-Reply-To: Nathan.Bailey's message of Fri, 11 Jan 2002 19:46:34 +1100. <200201110846.TAA12184@goaway.cc.monash.edu.au> Message-ID: <200201110856.TAA12151@goaway.cc.monash.edu.au> Whoops, missed Scott's more comprehensive and earlier reply! :P N From jh_lists at fastmail.fm Fri Jan 11 05:00:16 2002 From: jh_lists at fastmail.fm (Jeremy Howard) Date: Wed Aug 4 00:02:29 2004 Subject: Melb.pm meetings References: Message-ID: <002201c19a8f$291a6100$0101460a@optimaldecisions.com> Scott Penrose wrote: > 2 would come after 100. What you really probably need to do is turn it > into a 32 bit integer (does anyone remember the method?) > perldoc -f pack From nicole20 at earthlink.net Wed Jan 16 08:37:17 2002 From: nicole20 at earthlink.net (nicole20@earthlink.net) Date: Wed Aug 4 00:02:30 2004 Subject: Hey get ready for this! :) Message-ID: <200201161437.g0GEbH610800@mail.pm.org> An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/melbourne-pm/attachments/20020116/2f2d7a2b/attachment.htm From pjf at perltraining.com.au Wed Jan 16 20:54:56 2002 From: pjf at perltraining.com.au (Paul Fenwick) Date: Wed Aug 4 00:02:30 2004 Subject: Melb.pm meetings In-Reply-To: <7B4A2BE0-04E2-11D6-B93F-003065B58CF8@dd.com.au>; from scottp@dd.com.au on Wed, Jan 09, 2002 at 08:23:03PM +1100 References: <20020109173041.K4705@mukc.org.au> <7B4A2BE0-04E2-11D6-B93F-003065B58CF8@dd.com.au> Message-ID: <20020117135456.D2996@mukc.org.au> G'day (All|Scotty), On Wed, Jan 09, 2002 at 08:23:03PM +1100, Scott Penrose wrote: > > I haven't heard any objections to the 2nd Wednesday of > > each month at 6pm idea, so I presume that everyone's happy with > > it. So, I'm going to start putting names with dates and see > > how people react. :) > > Yes you did. I objected ot the time. I am concerned that people will not > be able to get there in time :-) Oh, that's not the way in which democratic despotism is supposed to work. You're not supposed to object. :) Anyone else prefer a later starting time? I know that Scott can make it from his office to MyInternet in time. :) > I am happy to fit in a few (since I suggested it :-) [snip] > More Advanced > - XML::Parser > - overload > - VCS > - Device::SerialPort (and my own Device::SerialPort2) > > Just slot em in Paul. Well, I have to admit that I'm interested in the advanced modules (all of them), and would be delighted to see any of them presented at the Feb meeting. XML still seems to be a big buzzword these days, so I'd hope that XML::Parser would have universal appeal. > As a talk (maybe June...) I can do a talk on Unicode in perl (in > particular utf8) Oooh, I for one would very much like a talk on Unicode in Perl. In fact, given that Jeremy/Rob won't be doing the Feb talk, I'd be happy for you to volunteer. :) (Otherwise I already have most of the material ready for Perl Redispatch) > > I'm happy to volunteer myself for a short humourous talk on > > using strict for the Feb meeting. :) > > You mean there are people out there not using strict :-) > Only kidding. Damian would have lots to say about only using police if > you are in New York, and needing only Mounties if in Canada :-) Hard to believe, I know, but there are still some people who don't use strict. I'm going to show a couple of tricks that will make life without strict just a little more plesant. :) Cheers, Paul -- Paul Fenwick | http://perltraining.com.au/ Director of Training | Ph: +61 3 9354 6001 Perl Training Australia | Fax: +61 3 9354 2681 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/melbourne-pm/attachments/20020117/d8fb2d95/attachment.bin From scottp at dd.com.au Wed Jan 16 21:13:19 2002 From: scottp at dd.com.au (Scott Penrose) Date: Wed Aug 4 00:02:30 2004 Subject: Melb.pm meetings In-Reply-To: <20020117135456.D2996@mukc.org.au> Message-ID: <2832EF90-0AF8-11D6-9B0B-003065B58CF8@dd.com.au> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, January 17, 2002, at 01:54 , Paul Fenwick wrote: > G'day (All|Scotty), > > On Wed, Jan 09, 2002 at 08:23:03PM +1100, Scott Penrose wrote: > >> More Advanced >> - XML::Parser >> - overload >> - VCS >> - Device::SerialPort (and my own Device::SerialPort2) >> >> Just slot em in Paul. > > Well, I have to admit that I'm interested in the advanced modules > (all of them), and would be delighted to see any of them presented > at the Feb meeting. XML still seems to be a big buzzword these > days, so I'd hope that XML::Parser would have universal appeal. I will do some example code and demo of XML Parser, I think (being advanced) that it will take 10 minutes, not 5. >> As a talk (maybe June...) I can do a talk on Unicode in perl (in >> particular utf8) > > Oooh, I for one would very much like a talk on Unicode in Perl. > In fact, given that Jeremy/Rob won't be doing the Feb talk, > I'd be happy for you to volunteer. :) (Otherwise I already have > most of the material ready for Perl Redispatch) Love to but I am not really ready. Is there a later month free? Scott - --- Scott Penrose Open source and Linux Developer http://linux.dd.com.au/ scottp@dd.com.au -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE8RkFUDCFCcmAm26YRAvUmAJ0SGffVyendsuihKLs3osJEjQOoRgCgs7wD pxqrk5TFFNJ9oXh6D2q4wfU= =LReT -----END PGP SIGNATURE----- From simon at unisolve.com.au Wed Jan 16 21:19:10 2002 From: simon at unisolve.com.au (Simon Taylor) Date: Wed Aug 4 00:02:30 2004 Subject: Melb.pm meetings In-Reply-To: <20020117135456.D2996@mukc.org.au> References: <20020109173041.K4705@mukc.org.au> <7B4A2BE0-04E2-11D6-B93F-003065B58CF8@dd.com.au> <20020117135456.D2996@mukc.org.au> Message-ID: <02011714191003.03503@acacia.unisolve.com.au> Hello all, > Anyone else prefer a later starting time? I know that Scott can make > it from his office to MyInternet in time. :) A 6.00 pm start is fine by us, but if enough people want to start later, that's OK too. Regards, Simon Taylor -- Unisolve Pty Ltd - Melbourne, Australia +61 3 9568 2005 From jh_lists at fastmail.fm Wed Jan 16 21:30:34 2002 From: jh_lists at fastmail.fm (Jeremy Howard) Date: Wed Aug 4 00:02:30 2004 Subject: Melb.pm meetings References: <2832EF90-0AF8-11D6-9B0B-003065B58CF8@dd.com.au> Message-ID: <001701c19f07$557eb800$0101460a@optimaldecisions.com> > I will do some example code and demo of XML Parser, I think (being > advanced) that it will take 10 minutes, not 5. > It would be nice, if you had the time, to slot in a mention of libxml2 as well, since that seems faster, less resource-intensive, and more stable than XML::Parser. This is based mainly on what I've read from Matt Sergeant (the Axkit guy), and partially based on an extremely brief play with it (we still use XML::Parser in production). From scottp at dd.com.au Wed Jan 16 22:04:37 2002 From: scottp at dd.com.au (Scott Penrose) Date: Wed Aug 4 00:02:30 2004 Subject: Melb.pm meetings In-Reply-To: <001701c19f07$557eb800$0101460a@optimaldecisions.com> Message-ID: <52D10AAD-0AFF-11D6-9B0B-003065B58CF8@dd.com.au> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, January 17, 2002, at 02:30 , Jeremy Howard wrote: >> I will do some example code and demo of XML Parser, I think (being >> advanced) that it will take 10 minutes, not 5. >> > It would be nice, if you had the time, to slot in a mention of libxml2 > as > well, since that seems faster, less resource-intensive, and more stable > than > XML::Parser. This is based mainly on what I've read from Matt Sergeant > (the > Axkit guy), and partially based on an extremely brief play with it (we > still > use XML::Parser in production). Sure I will add in both. We use both here. For general parsing we still use XML::Parser, but we have now replaced our XSLT code with libxml-xslt-perl which uses libxml2 (gnome) libs in the back end. Scott > --- Scott Penrose Open source and Linux Developer http://linux.dd.com.au/ scottp@dd.com.au -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE8Rk1aDCFCcmAm26YRAvn3AJ43Hu0YPYMQgGA6aRDoPw8E22tb+wCeJjgT Ia3zcUvRnGTCc3VQtEYMe2E= =mm8c -----END PGP SIGNATURE----- From agray at netconnect.com.au Sun Jan 20 18:01:23 2002 From: agray at netconnect.com.au (Andrew Gray) Date: Wed Aug 4 00:02:30 2004 Subject: file locking References: <52D10AAD-0AFF-11D6-9B0B-003065B58CF8@dd.com.au> Message-ID: <016301c1a20e$c3cbcdc0$f135190a@netconnect.net.au> My thanks to Nathan and Scott for their replies to mys last question regarding hash tables and sorting. I now have another more generic question. What is the 'best' way to implment file locking to a multiple access file, from perl. in the past I have just created a 'lock' file (`touch lock`; do stuff; `rm -f lock`) but the must be a more elegant solution than this :) regards Andrew Gray Systems Administrator, NetConnect Communications sysadmin@netconnect.com.au From jh_lists at fastmail.fm Sun Jan 20 18:41:04 2002 From: jh_lists at fastmail.fm (Jeremy Howard) Date: Wed Aug 4 00:02:30 2004 Subject: file locking References: <52D10AAD-0AFF-11D6-9B0B-003065B58CF8@dd.com.au> <016301c1a20e$c3cbcdc0$f135190a@netconnect.net.au> Message-ID: <00a501c1a214$50594d80$0101460a@optimaldecisions.com> > I now have another more generic question. > What is the 'best' way to implment file locking to a multiple access file, > from perl. > > in the past I have just created a 'lock' file (`touch lock`; do stuff; > `rm -f lock`) > but the must be a more elegant solution than this :) > It depends a little on how you're using it. You will find MLDBM::Sync suitable for many problems that require shared access to files. From pjf at perltraining.com.au Sun Jan 20 18:47:34 2002 From: pjf at perltraining.com.au (Paul Fenwick) Date: Wed Aug 4 00:02:30 2004 Subject: file locking In-Reply-To: <016301c1a20e$c3cbcdc0$f135190a@netconnect.net.au>; from agray@netconnect.com.au on Mon, Jan 21, 2002 at 11:01:23AM +1100 References: <52D10AAD-0AFF-11D6-9B0B-003065B58CF8@dd.com.au> <016301c1a20e$c3cbcdc0$f135190a@netconnect.net.au> Message-ID: <20020121114734.C24230@mukc.org.au> G'day Andrew, On Mon, Jan 21, 2002 at 11:01:23AM +1100, Andrew Gray wrote: > I now have another more generic question. > What is the 'best' way to implment file locking to a multiple access file, > from perl. If you're doing the access over NFS, then despair. NFS makes file locking exceedingly difficult. If you're using a regular filesystem, then the usual method of file-locking is using Perl's inbuilt "flock" function ("perldoc -f flock" for details): use Fcntl ':flock'; # For LOCK_* constants flock(FILEHANDLE,LOCK_EX); # Exclusive lock flock(FILEHANDLE,LOCK_SH); # Shared lock flock(FILEHANDLE,LOCK_UN); # Unlock By default, flock will block until the requested lock is obtained. If you need non-blocking lock requests, then you can bitwise-or your request with LOCK_NB, like this: flock(FILEHANDLE,LOCK_EX|LOCK_NB); Of course, with non-blocking locks you have to check the return status to see if your lock was granted. (You should be doing this regardless.) Be aware that flock provides advisory locks. Other processes can choose to ignore your locks if they don't want to play by the rules. Cheers, Paul -- Paul Fenwick | http://perltraining.com.au/ Director of Training | Ph: +61 3 9354 6001 Perl Training Australia | Fax: +61 3 9354 2681 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/melbourne-pm/attachments/20020121/1c304d64/attachment.bin From mjs at beebo.org Sun Jan 20 19:21:21 2002 From: mjs at beebo.org (Michael S.) Date: Wed Aug 4 00:02:30 2004 Subject: file locking In-Reply-To: <20020121114734.C24230@mukc.org.au> References: <52D10AAD-0AFF-11D6-9B0B-003065B58CF8@dd.com.au> <016301c1a20e$c3cbcdc0$f135190a@netconnect.net.au> <20020121114734.C24230@mukc.org.au> Message-ID: <1011576081.31849.8.camel@rag.its.monash.edu.au> On Mon, 2002-01-21 at 11:47, Paul Fenwick wrote: > If you're using a regular filesystem, then the usual method > of file-locking is using Perl's inbuilt "flock" function > ("perldoc -f flock" for details): There are also at least two modules, File::Flock and LockFile::Simple. LockFile::Simple is more complicated. Storable (recent versions thereof) also locking versions of store and retrieve, which are bloody handy. Michael -- http://beebo.org From joshua at roughtrade.net Sun Jan 20 22:13:28 2002 From: joshua at roughtrade.net (Joshua Goodall) Date: Wed Aug 4 00:02:30 2004 Subject: file locking In-Reply-To: <20020121114734.C24230@mukc.org.au> References: <52D10AAD-0AFF-11D6-9B0B-003065B58CF8@dd.com.au> <016301c1a20e$c3cbcdc0$f135190a@netconnect.net.au> <20020121114734.C24230@mukc.org.au> Message-ID: <20020121041327.GA3469@roughtrade.net> On Mon, Jan 21, 2002 at 11:47:34AM +1100, Paul Fenwick wrote: > If you're doing the access over NFS, then despair. NFS makes > file locking exceedingly difficult. It isn't insurmountable. I've attached some sample code of how I do it. It does require a working lockd, and of course there's NFS's usual failure-modes to cope with. Cheers, Joshua. -------------- next part -------------- #!/usr/bin/perl # fcntldemo # NFS lockd-safe locking with fcntl # demo code by Joshua Goodall # * compatible with C library fcntl, lockf and (locally, not nfs) flock # * also works on ext2/ufs mounts # * fcntl can also lock file ranges # * beware that locking is advisory, not mandatory use IO::File; use Fcntl; use strict; use vars qw($fh $filename $basename); $basename = ($0 =~ /([^\/]+)$/)[0] || "fnctldemo"; sub usage () { print STDERR "usage: $basename outputfile [inputfile ...]\n"; exit 1; } sub fatal ($) { print STDERR "$basename: $_[0]\n"; exit 2; } # the meat sub lockf ($$) { my ($fh, $mode) = @_; my $params; die "bad mode \"$mode\" to lockf" unless $mode =~ /^[rw]$/; $params = pack("ssx32", ($mode eq "r" ? F_RDLCK : F_WRLCK), 0); return fcntl($fh, F_SETLKW, $params); } sub unlockf ($) { my $fh = shift; my $params; $params = pack("ssx32", F_UNLCK, 0); return fcntl($fh, F_SETLKW, $params); } # the cutlery usage unless scalar @ARGV; $filename = shift @ARGV; $fh = new IO::File; open ($fh, ">$filename") or fatal "can't open $filename for output: $!"; lockf ($fh, "w") or fatal "can't lock $filename: $!"; # prevent overwrite corruptions following lock race; # comment this out for entertainment value truncate($fh, 0); print "got lock; enter data\n"; while (<>) { chomp; print $fh "$$: $_\n"; } unlockf ($fh) or die "can't unlock $filename: $!"; close $fh; From pjf at perltraining.com.au Mon Jan 21 20:10:24 2002 From: pjf at perltraining.com.au (Paul Fenwick) Date: Wed Aug 4 00:02:30 2004 Subject: Melb.pm meetings In-Reply-To: <200201190154.g0J1sv832357@whirlwind.netspace.net.au>; from gcross@netspace.net.au on Sat, Jan 19, 2002 at 12:54:56PM +1100 References: <20020109173041.K4705@mukc.org.au> <7B4A2BE0-04E2-11D6-B93F-003065B58CF8@dd.com.au> <20020117135456.D2996@mukc.org.au> <200201190154.g0J1sv832357@whirlwind.netspace.net.au> Message-ID: <20020122131024.M27029@mukc.org.au> G'day Graeme, I've taken the liberty to quote the relevant parts of your mail to the melb.pm mailing list. I trust you don't object. On Sat, Jan 19, 2002 at 12:54:56PM +1100, Graeme Cross wrote: > I would prefer a later starting time. 6pm is a stretch for people working in > the eastern suburbs (I'm working in Mt Waverley). > > Would 6.30 be a reasonable compromise? I think 6:30pm sounds like a fine time, and since it will give me an extra 30 minutes to prepare my talk, I'm happy for it to be the starting time of the February talk. That's provided nobody else objects. :) I know that Dr Damian Conway is expecting an earlier (6pm) start for the March meeting, so that he can present his talk and get back to his country estate before turning into a pumpkin. Given that I know that he'll be doing 2-3 hours of commuting in order to provide our amusement, I'm hesitant to ask him to come any later. I think that going to a Damian talk is worth knocking off 30 minutes early. :) > On another note -- are you on the LUV Programmers SIG mailing list? If not, I > am happy to cross-post the MelbPM meeting announcements there for you (we > meet fourth Tuesday of the month at MyInternet). I used to be on the LUV Programmers list, but dissapeared from it at one point due to an incredibly lengthly .org.au re-delegation. I should really get myself re-subscribed. In the meantime, cross-posting Melb.pm meeting announcements would be very much appreciated. All the best, Paul -- Paul Fenwick | http://perltraining.com.au/ Director of Training | Ph: +61 3 9354 6001 Perl Training Australia | Fax: +61 3 9354 2681 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/melbourne-pm/attachments/20020122/7ec13eb4/attachment.bin From support at blackjackshack.com Mon Jan 28 14:22:00 2002 From: support at blackjackshack.com (support@blackjackshack.com) Date: Wed Aug 4 00:02:30 2004 Subject: Worlds First Player vs Player Blackjack Message-ID: <03b014302221c12STATION@station.blackjackstation.com> This message can only be viewed in HTML -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/melbourne-pm/attachments/20020128/8ffde78b/attachment.htm From agray at netconnect.com.au Tue Jan 29 02:00:04 2002 From: agray at netconnect.com.au (Andrew Gray) Date: Wed Aug 4 00:02:30 2004 Subject: qmail spam blocking References: <20020109173041.K4705@mukc.org.au> <7B4A2BE0-04E2-11D6-B93F-003065B58CF8@dd.com.au> <20020117135456.D2996@mukc.org.au> <200201190154.g0J1sv832357@whirlwind.netspace.net.au> <20020122131024.M27029@mukc.org.au> Message-ID: <01de01c1a89a$f5e17cf0$f135190a@netconnect.net.au> Dear all, For those of you running qmail mail server setup according to the 'life with qmail' web page (ie multilog etc rather than syslog) with a reasonable number of users. I have written a perl program that trawls the mail logs, and looks for IP's that have delivered too many emails over the last log period (about 5 hrs, in my case, 15K+ users) and rewrites the tcp server config file, and am looking for someone to evaluate it a bit further before releasing it to the public in general. I'm asking you because a) you're perl programmers and will understand the code rather than just running it, and therefore may be able to suggest improvements, and b) you're most likely to be on the same time zone as me. Details. List runs variables such as threshold number of mails, ban time etc. Uses existing /etc/tcp.smtp file for storing data. Copes with static as well as temp banned IP numbers, IP's can be excluded from being autobanned (things like yahoo, popular lists etc) works on the assumption that a lot of spam will come from one IP in a short period of time. (which has been my experience). Anyway If you're interested in trying it out, mail me, I still need to write some decent doco's. Code is available here for download here http://gray.ballarat.net.au/qmail/throttle_smtp.tgz (include web script) or view here http://gray.ballarat.net.au/qmail/throttle_smtp.pl.txt (just throttle script) including a script web page to display banned IPs sample http://mail.netconnect.com.au/cgi-bin/ip_ban_check (been running about a week) regards Andrew Gray Systems Administrator, NetConnect Communications sysadmin@netconnect.com.au From scottp at dd.com.au Tue Jan 29 01:27:14 2002 From: scottp at dd.com.au (Scott Penrose) Date: Wed Aug 4 00:02:30 2004 Subject: Linux Users Victoria Programmers SIG meeting - Web Application Programming with Perl Message-ID: <9DD496AA-1489-11D6-ADFD-003065B58CF8@dd.com.au> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 - -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Begin forwarded message: > From: Graeme Cross > Date: Mon Jan 28, 2002 08:42:52 Australia/Melbourne > To: LUV Announcements , LUV Programmers SIG > > Subject: REMINDER: Programmers SIG meeting > Reply-To: gcross@netspace.net.au > > The first LUV Programmers SIG meeting for 2002 is on this Tuesday, > January 29. > > The topic will be "Benchmarking Overview - how to write benchmarks and > what you can learn from them" by Russell Coker. > The planned talks for upcoming Programmers SIG meetings are: > > Feb 26: "Web Application Programming with Perl", David Dick > > More SIG information can be found at http://programmers.luv.asn.au/ > > -- > Graeme Cross > - > To unsubscribe send 'unsubscribe luv-announce' to majordomo@luv.asn.au Scott - - --- Scott Penrose Open source and Linux Developer http://linux.dd.com.au/ scottp@dd.com.au - -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE8Vk56DCFCcmAm26YRAkZ0AKCLoNIUeKrxD8mRVEWLGgjmQiQKFwCgph6U +kdq8olltHdGJ2CpTcRtgoc= =FUfL - -----END PGP SIGNATURE----- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE8Vk7XDCFCcmAm26YRAmO0AJ4yHfgVRRJ9CCso9CsA//zYL0aMwwCfZIiX BNDq9btwHbAZ972u2DChUZI= =YVDv -----END PGP SIGNATURE----- From scottp at dd.com.au Wed Jan 30 23:12:41 2002 From: scottp at dd.com.au (Scott Penrose) Date: Wed Aug 4 00:02:30 2004 Subject: utf8 and regular expressions. Message-ID: <26ACD85A-1609-11D6-B826-003065B58CF8@dd.com.au> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Since Perl Monks is down (well partially) I though I might post this here (melbourne-pm@pm.org) Here is a cute bit of code that has caused us hours of problems... #!/usr/bin/perl -w $test = $ARGV[0] || "abc%abc123"; print "Testing on $test\n"; use utf8; if ($test =~ /%([\dA-Fa-f]{2})/) { print "Found - $1\n"; } no utf8; if ($test =~ /%([\dA-Fa-f]{2})/) { print "Found - $1\n"; } The output of the above is.... Testing on abc%abc123 Found - abc123 Found - ab Using perl 5.6.0 or perl 5.6.1 (I tried both). The problem, if you have not spotted it is that we have asked for {2} characters but get more if in utf8 mode. "{n} Match exactly n times" - man perlre We also tried {2,2} "{n,m} Match at least n but not more than m times" - man perlre Using (use) utf8 matches all things in the character class, no mater how long the string. This makes decoding a URL - HELL ! I don't think I am doing anything wrong, but maybe someone can point out a problem with the above? Otherwise, it is a UTF8 Bug in perl re engine. Does anyone have perl 5.7 installed they could test it on? Scott - --- Scott Penrose Open source and Linux Developer http://linux.dd.com.au/ scottp@dd.com.au -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE8WNJODCFCcmAm26YRAm5qAJ44PXprwN6jID3GtKixlENp//VqqQCeILnM su4MTqPzhL56scRdNBHCBuA= =DsBt -----END PGP SIGNATURE----- From brendan at clueful.com.au Wed Jan 30 23:32:54 2002 From: brendan at clueful.com.au (Brendan Quinn) Date: Wed Aug 4 00:02:30 2004 Subject: utf8 and regular expressions. References: <26ACD85A-1609-11D6-B826-003065B58CF8@dd.com.au> Message-ID: <3C58D706.5030109@clueful.com.au> Just tried it on revision 5.0 version 7 subversion 2 patch 12378 (which is quite old, mine is dated October some time) and got Testing on abc%abc123 Found - ab Found - ab which is the output you expected right? So it is a bug in 5.6 I spose. Brendan. Scott Penrose wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Since Perl Monks is down (well partially) I though I might post this > here (melbourne-pm@pm.org) > > Here is a cute bit of code that has caused us hours of problems... > > #!/usr/bin/perl -w > > $test = $ARGV[0] || "abc%abc123"; > > print "Testing on $test\n"; > > use utf8; > if ($test =~ /%([\dA-Fa-f]{2})/) { > print "Found - $1\n"; > } > > no utf8; > if ($test =~ /%([\dA-Fa-f]{2})/) { > print "Found - $1\n"; > } > > The output of the above is.... > > Testing on abc%abc123 > Found - abc123 > Found - ab > > Using perl 5.6.0 or perl 5.6.1 (I tried both). > > The problem, if you have not spotted it is that we have asked for {2} > characters but get more if in utf8 mode. > > "{n} Match exactly n times" - man perlre > We also tried {2,2} > "{n,m} Match at least n but not more than m times" - man perlre > > Using (use) utf8 matches all things in the character class, no mater how > long the string. > This makes decoding a URL - HELL ! > > I don't think I am doing anything wrong, but maybe someone can point out > a problem with the above? > > Otherwise, it is a UTF8 Bug in perl re engine. > Does anyone have perl 5.7 installed they could test it on? > > Scott > - --- > Scott Penrose > Open source and Linux Developer > http://linux.dd.com.au/ > scottp@dd.com.au > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.0.6 (Darwin) > Comment: For info see http://www.gnupg.org > > iD8DBQE8WNJODCFCcmAm26YRAm5qAJ44PXprwN6jID3GtKixlENp//VqqQCeILnM > su4MTqPzhL56scRdNBHCBuA= > =DsBt > -----END PGP SIGNATURE----- > > > -- Brendan Quinn brendan@clueful.com.au Clueful Consulting Pty Ltd Phone +61 4 0076 0077 GPO Box 2747EE within Australia: 0400 760 077 Melbourne, Australia http://www.clueful.com.au/brendan/ From scottp at dd.com.au Wed Jan 30 23:52:00 2002 From: scottp at dd.com.au (Scott Penrose) Date: Wed Aug 4 00:02:30 2004 Subject: utf8 and regular expressions. In-Reply-To: <3C58D706.5030109@clueful.com.au> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, January 31, 2002, at 04:32 , Brendan Quinn wrote: > Just tried it on > revision 5.0 version 7 subversion 2 patch 12378 > (which is quite old, mine is dated October some time) > > and got > > Testing on abc%abc123 > Found - ab > Found - ab > > which is the output you expected right? > > So it is a bug in 5.6 I spose. > > Brendan. > Yes, well thats good news anyway. BTW. How are you finding version 5.7? Scott -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE8WNuEDCFCcmAm26YRAk31AKCC2yORnlMSLJJuj655c4PQxKaXeACfVdAF /P0yfNFmAt0fpNc2Yqz0mt4= =h9GK -----END PGP SIGNATURE----- From agray at netconnect.com.au Thu Jan 31 01:09:08 2002 From: agray at netconnect.com.au (Andrew Gray) Date: Wed Aug 4 00:02:30 2004 Subject: md5 hashing References: Message-ID: <017d01c1aa26$2d4377c0$f135190a@netconnect.net.au> What I want to do, is remotely control some of the functions on a server. To this end, I can do it using sockets and loading a client program and that all works OK, but I think to be secure I need to encrypt the message I am passing between the servers (call me paranoid, but I dont really trust telstra's network that much ....) >From how I understand it, MD5 encryption lets you hash a message with a given key, and then using the same key, unencrypt the message at the other end. Is this right? or is it a one way encryption like crypt()? Having read the synopsis from www.cpan.org I can see how to hash the message given a key string, but nowhere can I see how to unencrypt at the other end of the transmission. OR are there any other two way encryption modules around that I could use simply. regards Andrew Gray Systems Administrator, NetConnect Communications sysadmin@netconnect.com.au From brendan at clueful.com.au Thu Jan 31 00:05:07 2002 From: brendan at clueful.com.au (Brendan Quinn) Date: Wed Aug 4 00:02:30 2004 Subject: utf8 and regular expressions. References: Message-ID: <3C58DE93.1050904@clueful.com.au> > Yes, well thats good news anyway. BTW. How are you finding version 5.7? > > Scott Can't really say, I just installed it when I was playing around with Apache 2.0 / modperl 2.0, and I haven't used it for much else. Perl 6 sounds exciting, I'm looking forward to Damian's next exegesis so I can see all the cool things we can now do with bracketless expressions... however I'm a little concerned about the "right curly bracket on a line of its own has special meaning" thing that Larry mentioned in the latest Apocalypse. To me it sounds pretty confusing and counter to the Perl attitude of "write it (and lay it out) any way you want"... Brendan. -- Brendan Quinn brendan@clueful.com.au Clueful Consulting Pty Ltd Phone +61 4 0076 0077 GPO Box 2747EE within Australia: 0400 760 077 Melbourne, Australia http://www.clueful.com.au/brendan/ From brendan at clueful.com.au Thu Jan 31 00:22:19 2002 From: brendan at clueful.com.au (Brendan Quinn) Date: Wed Aug 4 00:02:30 2004 Subject: md5 hashing References: <017d01c1aa26$2d4377c0$f135190a@netconnect.net.au> Message-ID: <3C58E29B.3010408@clueful.com.au> Nope, "hashing" by definition is a one-way thing, exactly like crypt(3). The idea is that any string will hash to something strange, and that the spread of possibilities is fairly even (ie it's unlikely that two strings will hash to the same string). It's only useful for one-way encryption such as storing passwords, and validity checking / signing algorithms. MD5 and SHA are the most common hashing algorithms (crypt uses an algotirhm based on DES according to my man page on Linux). For two way encryption where you can securely transmit the key between hosts (securely meaning not over a network), look at DES, RC4/RC5/RC6, or Blowfish. They're all on CPAN via http://www.perl.com/CPAN-local/modules/by-category/14_Security_and_Encryption/Crypt/ If you need to securely transfer keys as well, you should use a public key / certificate based encryption mechanism such as PGP or SSL. They both have modules available on CPAN. In fact SSL has all the network communication stuff built in, so you should simply be able to open an HTTPS connection between your sites and forget about the hard stuff. You could even install ssh (SSL-based remote shell) and do it over shell scripts or the command line. Hope this helps, I really should go do some work now. Brendan. PS for a great introduction to the topic, check out Bruce Schneier's "Applied Cryptography" book. Andrew Gray wrote: > What I want to do, is remotely control some of the functions on a server. To > this end, I can do it using sockets and loading a client program and that > all works OK, but I think to be secure I need to encrypt the message I am > passing between the servers (call me paranoid, but I dont really trust > telstra's network that much ....) > >>From how I understand it, MD5 encryption lets you hash a message with a > given key, and then using the same key, unencrypt the message at the other > end. Is this right? or is it a one way encryption like crypt()? > > Having read the synopsis from www.cpan.org I can see how to hash the message > given a key string, but nowhere can I see how to unencrypt at the other end > of the transmission. > > OR are there any other two way encryption modules around that I could use > simply. > > regards > > Andrew Gray > Systems Administrator, NetConnect Communications > sysadmin@netconnect.com.au -- Brendan Quinn brendan@clueful.com.au Clueful Consulting Pty Ltd Phone +61 4 0076 0077 GPO Box 2747EE within Australia: 0400 760 077 Melbourne, Australia http://www.clueful.com.au/brendan/ From scottp at dd.com.au Thu Jan 31 00:29:36 2002 From: scottp at dd.com.au (Scott Penrose) Date: Wed Aug 4 00:02:30 2004 Subject: md5 hashing In-Reply-To: <017d01c1aa26$2d4377c0$f135190a@netconnect.net.au> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, January 31, 2002, at 06:09 , Andrew Gray wrote: > What I want to do, is remotely control some of the functions on a > server. To > this end, I can do it using sockets and loading a client program and > that > all works OK, but I think to be secure I need to encrypt the message I > am > passing between the servers (call me paranoid, but I dont really trust > telstra's network that much ....) > >> From how I understand it, MD5 encryption lets you hash a message with a > given key, and then using the same key, unencrypt the message at the > other > end. Is this right? or is it a one way encryption like crypt()? > > Having read the synopsis from www.cpan.org I can see how to hash the > message > given a key string, but nowhere can I see how to unencrypt at the other > end > of the transmission. > > OR are there any other two way encryption modules around that I could > use > simply. Personally I prefer to do it using SSL, that way the encoding is standard and well understood. However that can be a lot of work, so in some cases what I have done is to use SSH port forwarding. So what you do is on your client side (where your perl script runs) connect (sockets) to localhost, some port number you choose. SSH mean time has been setup (using RSA keys etc) by the system admin - separately controlled from your perl code. on connecting to localhost:someport it forward it to remotehost:localport. You also need to make sure that your server is setup with the daemon (the server script) so that it only accepts connections from localhost (bind to localhost only) - and I also recommend restricting that port even more with ip tables. Why this approach. 1. My perl code does not have to know anything about security or encrypting 2. I can test the code without any encryption. 3. I am not going to make a crypto mistake - SSH is well proven technology and checked for security holes all the time. 4. When updates to how security is done are made you don't have to update your then legacy perl code. One point though - this does not protect your server or client machine from prying eyes. However having encryption end to end does not really solve that either because you are going to have the streams unencrypted in memory anyway. Scott - --- Scott Penrose Open source and Linux Developer http://linux.dd.com.au/ scottp@dd.com.au -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE8WORUDCFCcmAm26YRAvxVAKCbl+SV2WfLS73krw1lZpDQKCetjQCeMDJA F9eM54KdCZpeuaas9EkvSog= =OfaC -----END PGP SIGNATURE----- From trafficproducts at trafficwow.net Thu Jan 31 10:57:34 2002 From: trafficproducts at trafficwow.net (trafficproducts@trafficwow.net) Date: Wed Aug 4 00:02:30 2004 Subject: Best Source of Internet Traffic and Search Engine Placements Message-ID: <20020131165856.18266982AA@mail3.panix.com> An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/melbourne-pm/attachments/20020131/9f9aa2ba/attachment.htm From andy at halogix.com Tue Jan 1 11:36:01 2002 From: andy at halogix.com (Andrew Wansink) Date: Wed Aug 4 00:03:17 2004 Subject: weird CGI-bin problem In-Reply-To: <200402280041.i1S0fhT14667@paddy.wahroonga.com> References: <200402280041.i1S0fhT14667@paddy.wahroonga.com> Message-ID: <20020101173601.GA2519@blue.halogix.com> Yes there is, perhaps you should attach your apache config (assuming you are using apache.) Often the default configuration is that scripts in /cgi-bin/ are executed, check that the execute bit is set on your script. andy On Sat, Feb 28, 2004 at 11:41:43AM +1100, jimd@paddy.wahroonga.com wrote: > Hi, > > I'm working on A.pl which has a form in it whose href is B.pl > > I need to change this form to call A.pl so the client can enter some more stuff > > however, when I change the href B.pl to A.pl (and make no other change) > the result is that A.pl is downloaded rather than being executed. > If I change href back to B.pl, normal behaviour resumes. > > I'm bewildered by this. Is there something special in CGI which causes > downloading rather than execution? Help, please. > > Jim Donovan >