From me at heyjay.com Wed Dec 2 17:38:00 2009 From: me at heyjay.com (Jay Strauss) Date: Wed, 2 Dec 2009 19:38:00 -0600 Subject: [Chicago-talk] Array Slices - of columns Message-ID: <39eaccc10912021738v192000b9s84cc09d739d111c2@mail.gmail.com> Hi All, hope you had a nice thanksgiving. If I have a 10x10 array of arrays like: [40 8 79 8 73 71 77 35 12 67] [4 79 10 90 45 17 30 29 65 86] [56 86 5 34 23 79 17 83 24 85] [58 85 46 53 15 31 34 4 14 15] [68 15 97 21 81 95 71 82 26 90] [59 70 11 82 39 25 36 84 88 13] [66 6 85 1 84 17 27 58 60 94] [34 10 38 90 32 0 56 14 23 70] [71 23 5 97 4 71 27 20 11 87] [5 8 23 30 97 16 10 93 16 67] Is there any notation I can use to get "column 1", i.e. $a[0][0], $a[1][0], $a[2][0]... without looping over the whole structure I need to find the max value in each column I know how to do it in a loop, but I thought maybe there was some neato way in a slice. Thanks Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From pcmantz at gmail.com Wed Dec 2 18:27:27 2009 From: pcmantz at gmail.com (Paul Mantz) Date: Wed, 2 Dec 2009 20:27:27 -0600 Subject: [Chicago-talk] Array Slices - of columns In-Reply-To: <39eaccc10912021738v192000b9s84cc09d739d111c2@mail.gmail.com> References: <39eaccc10912021738v192000b9s84cc09d739d111c2@mail.gmail.com> Message-ID: <42f28fe0912021827u5c52352fic8569ef8112a7de8@mail.gmail.com> On Wed, Dec 2, 2009 at 7:38 PM, Jay Strauss wrote: > Hi All, hope you had a nice thanksgiving. > > If I have a 10x10 array of arrays like: > > [40 8 79 8 73 71 77 35 12 67] > [4 79 10 90 45 17 30 29 65 86] > [56 86 5 34 23 79 17 83 24 85] > [58 85 46 53 15 31 34 4 14 15] > [68 15 97 21 81 95 71 82 26 90] > [59 70 11 82 39 25 36 84 88 13] > [66 6 85 1 84 17 27 58 60 94] > [34 10 38 90 32 0 56 14 23 70] > [71 23 5 97 4 71 27 20 11 87] > [5 8 23 30 97 16 10 93 16 67] > > Is there any notation I can use to get "column 1", i.e. $a[0][0], $a[1][0], > $a[2][0]... without looping over the whole structure > > I need to find the max value in each column > > I know how to do it in a loop, but I thought maybe there was some neato way > in a slice. > > Thanks > Jay > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > I don't know how you'd go about doing it with slices, but I like using map for things like this. map { $_->[$col] } @grid; will pretty much give you what you're looking for. -- Paul Mantz http://www.mcpantz.org BackupPC - Network Backup with De-Duplication http://www.backuppc.com Zmanda - Open source backup and recovery http://www.zmanda.com/ From lembark at wrkhors.com Thu Dec 3 06:54:20 2009 From: lembark at wrkhors.com (Steven Lembark) Date: Thu, 3 Dec 2009 09:54:20 -0500 Subject: [Chicago-talk] Array Slices - of columns In-Reply-To: <42f28fe0912021827u5c52352fic8569ef8112a7de8@mail.gmail.com> References: <39eaccc10912021738v192000b9s84cc09d739d111c2@mail.gmail.com> <42f28fe0912021827u5c52352fic8569ef8112a7de8@mail.gmail.com> Message-ID: <20091203095420.11e750a0lembark@wrkhors.com@wrkhors.com> > If I have a 10x10 array of arrays like: > > [40 8 79 8 73 71 77 35 12 67] > [4 79 10 90 45 17 30 29 65 86] > [56 86 5 34 23 79 17 83 24 85] > [58 85 46 53 15 31 34 4 14 15] > [68 15 97 21 81 95 71 82 26 90] > [59 70 11 82 39 25 36 84 88 13] > [66 6 85 1 84 17 27 58 60 94] > [34 10 38 90 32 0 56 14 23 70] > [71 23 5 97 4 71 27 20 11 87] > [5 8 23 30 97 16 10 93 16 67] > > Is there any notation I can use to get "column 1", i.e. $a[0][0], $a[1][0], > $a[2][0]... without looping over the whole structure > > I need to find the max value in each column > > I know how to do it in a loop, but I thought maybe there was some neato way > in a slice. Not really: "slices" are sequential within the array. Since you have a collection of separate arrays a slice does not apply. If you have to do this regularly, an alternative is storing the data in a single list and taking every Nth item: @big_array[ 0, 10, 20, 30, ... ] will take the first item out of a 10x10 array, @big_array [ 0 .. 9 ] will take the first row. This is more-or-less the way that languages with multi-dimensinal arrays handle the issue, but is a pain to manage yourself by hand if the language doesn't deal with stride issues for you. It also requires that you pre-size the array, which isn't always easy or effecient. If you regularly have to slice the data, it may be effective to store it in a hash: $data{ $x, $y } = $value; This also helps in cases where you regularly have sparse data. You can "slice" the data by factoring out the interesting keys: grep { /$x ; .*/x } keys %data; will grab a given x value, grep { /.* $; $y/x } keys %data; will grab a given y value. That or you can buffer the keys onto arrays when they are first used and then just use: my @col_valz = max @data{ @{ $col_keyz[$col] } }; or my @row_valz = max @data{ @{ $row_keyz[$row] } }; For a moderately small matrix or somewhat sparse matrix that is frequently sliced this actually works pretty well -- at the expense of setting up the column and row key arrays once. Otherwise, as usual, map is your friend :-) -- Steven Lembark 85-09 90th St. Workhorse Computing Woodhaven, NY, 11421 lembark at wrkhors.com +1 888 359 3508 From me at heyjay.com Thu Dec 3 13:17:43 2009 From: me at heyjay.com (Jay Strauss) Date: Thu, 3 Dec 2009 15:17:43 -0600 Subject: [Chicago-talk] Array Slices - of columns In-Reply-To: <42f28fe0912021827u5c52352fic8569ef8112a7de8@mail.gmail.com> References: <39eaccc10912021738v192000b9s84cc09d739d111c2@mail.gmail.com> <42f28fe0912021827u5c52352fic8569ef8112a7de8@mail.gmail.com> Message-ID: <39eaccc10912031317v30bef3d9hd7a0ae3b2753fc2a@mail.gmail.com> Hi Paul, yeah that's how I've been doing it (roughly). It works fine, I just thought there might be some nifty syntax. Thanks Jay On Wed, Dec 2, 2009 at 8:27 PM, Paul Mantz wrote: > On Wed, Dec 2, 2009 at 7:38 PM, Jay Strauss wrote: > > Hi All, hope you had a nice thanksgiving. > > > > If I have a 10x10 array of arrays like: > > > > [40 8 79 8 73 71 77 35 12 67] > > [4 79 10 90 45 17 30 29 65 86] > > [56 86 5 34 23 79 17 83 24 85] > > [58 85 46 53 15 31 34 4 14 15] > > [68 15 97 21 81 95 71 82 26 90] > > [59 70 11 82 39 25 36 84 88 13] > > [66 6 85 1 84 17 27 58 60 94] > > [34 10 38 90 32 0 56 14 23 70] > > [71 23 5 97 4 71 27 20 11 87] > > [5 8 23 30 97 16 10 93 16 67] > > > > Is there any notation I can use to get "column 1", i.e. $a[0][0], > $a[1][0], > > $a[2][0]... without looping over the whole structure > > > > I need to find the max value in each column > > > > I know how to do it in a loop, but I thought maybe there was some neato > way > > in a slice. > > > > Thanks > > Jay > > > > _______________________________________________ > > Chicago-talk mailing list > > Chicago-talk at pm.org > > http://mail.pm.org/mailman/listinfo/chicago-talk > > > > I don't know how you'd go about doing it with slices, but I like using > map for things like this. > > map { $_->[$col] } @grid; > > will pretty much give you what you're looking for. > > -- > Paul Mantz > http://www.mcpantz.org > BackupPC - Network Backup with De-Duplication http://www.backuppc.com > Zmanda - Open source backup and recovery http://www.zmanda.com/ > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at heyjay.com Thu Dec 3 13:24:24 2009 From: me at heyjay.com (Jay Strauss) Date: Thu, 3 Dec 2009 15:24:24 -0600 Subject: [Chicago-talk] Array Slices - of columns In-Reply-To: <-5594786726430837712@unknownmsgid> References: <39eaccc10912021738v192000b9s84cc09d739d111c2@mail.gmail.com> <42f28fe0912021827u5c52352fic8569ef8112a7de8@mail.gmail.com> <-5594786726430837712@unknownmsgid> Message-ID: <39eaccc10912031324p5f534efcg33c69bd5b3107e3a@mail.gmail.com> Thanks Steve. Long time no hear from you. Jay On Thu, Dec 3, 2009 at 8:54 AM, Steven Lembark wrote: > > > If I have a 10x10 array of arrays like: > > > > [40 8 79 8 73 71 77 35 12 67] > > [4 79 10 90 45 17 30 29 65 86] > > [56 86 5 34 23 79 17 83 24 85] > > [58 85 46 53 15 31 34 4 14 15] > > [68 15 97 21 81 95 71 82 26 90] > > [59 70 11 82 39 25 36 84 88 13] > > [66 6 85 1 84 17 27 58 60 94] > > [34 10 38 90 32 0 56 14 23 70] > > [71 23 5 97 4 71 27 20 11 87] > > [5 8 23 30 97 16 10 93 16 67] > > > > Is there any notation I can use to get "column 1", i.e. $a[0][0], > $a[1][0], > > $a[2][0]... without looping over the whole structure > > > > I need to find the max value in each column > > > > I know how to do it in a loop, but I thought maybe there was some neato > way > > in a slice. > > Not really: "slices" are sequential within the > array. Since you have a collection of separate > arrays a slice does not apply. > > If you have to do this regularly, an alternative > is storing the data in a single list and taking > every Nth item: > > @big_array[ 0, 10, 20, 30, ... ] > > will take the first item out of a 10x10 array, > > @big_array [ 0 .. 9 ] > > will take the first row. > > This is more-or-less the way that languages with > multi-dimensinal arrays handle the issue, but is > a pain to manage yourself by hand if the language > doesn't deal with stride issues for you. > > It also requires that you pre-size the array, which > isn't always easy or effecient. > > If you regularly have to slice the data, it may > be effective to store it in a hash: > > $data{ $x, $y } = $value; > > This also helps in cases where you regularly have > sparse data. You can "slice" the data by factoring > out the interesting keys: > > grep { /$x ; .*/x } keys %data; > > will grab a given x value, > > grep { /.* $; $y/x } keys %data; > > will grab a given y value. > > That or you can buffer the keys onto arrays when > they are first used and then just use: > > > my @col_valz = max @data{ @{ $col_keyz[$col] } }; > > or > > my @row_valz = max @data{ @{ $row_keyz[$row] } }; > > For a moderately small matrix or somewhat sparse > matrix that is frequently sliced this actually > works pretty well -- at the expense of setting up > the column and row key arrays once. > > Otherwise, as usual, map is your friend :-) > > -- > Steven Lembark 85-09 90th St. > Workhorse Computing Woodhaven, NY, 11421 > lembark at wrkhors.com +1 888 359 3508 > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshua.mcadams at gmail.com Thu Dec 10 21:03:28 2009 From: joshua.mcadams at gmail.com (Joshua) Date: Thu, 10 Dec 2009 23:03:28 -0600 Subject: [Chicago-talk] Frozen Perl Message-ID: <49d805d70912102103n5b02e95cn628d57bf12639e95@mail.gmail.com> If you've been on the fence about going to Frozen Perl, this might help motivate you. Megabus is giving free rides for tons of trips, including trips between Chicago and Minneapolis. http://www.chicagoreader.com/TheBlog/archives/2009/12/09/free-megabus-trips-from-january-6-to-march-30 I rode Megabus there last year. It wasn't a luxury trip, but it did the job and also dropped me off right in front of the University that Frozen Perl was held at. From fasteliteprogrammer at gmail.com Sat Dec 12 06:43:38 2009 From: fasteliteprogrammer at gmail.com (craig) Date: Sat, 12 Dec 2009 08:43:38 -0600 Subject: [Chicago-talk] perl module question Message-ID: <4B23AC1A.8080303@gmail.com> How do i submit your module in ubuntu for perl? From shlomif at iglu.org.il Sat Dec 12 07:25:39 2009 From: shlomif at iglu.org.il (Shlomi Fish) Date: Sat, 12 Dec 2009 17:25:39 +0200 Subject: [Chicago-talk] perl module question In-Reply-To: <4B23AC1A.8080303@gmail.com> References: <4B23AC1A.8080303@gmail.com> Message-ID: <200912121725.39838.shlomif@iglu.org.il> Hi! On Saturday 12 Dec 2009 16:43:38 craig wrote: > How do i submit your module in ubuntu for perl? > You should first package it as a standard Perl distribution using module- starter: http://search.cpan.org/dist/Module-Starter/ After it is ready and passes all tests, you should register for a PAUSE account: http://pause.perl.org/pause/query Then you can upload it to the CPAN, and then use a tool like dh-make-perl ( http://www.debian-administration.org/articles/78 ) or cpan2dist (see: http://search.cpan.org/dist/CPANPLUS-Dist-Deb/ ) to prepare a package out of it, and you can prepare a repository from it. If you want it to be part of Ubuntu Linux, then you should submit a request for inclusion with Debian: http://wiki.debian.org/Teams/DebianPerlGroup Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ Optimising Code for Speed - http://shlom.in/optimise Bzr is slower than Subversion in combination with Sourceforge. ( By: http://dazjorz.com/ ) From me at heyjay.com Wed Dec 16 12:44:08 2009 From: me at heyjay.com (Jay Strauss) Date: Wed, 16 Dec 2009 14:44:08 -0600 Subject: [Chicago-talk] Portable Script and library Message-ID: <39eaccc10912161244y59652670g47a55d66c01c5686@mail.gmail.com> Hi, I need to build a script, to be able to bring with me from customer to customer site. I can count on running upon a recent version of Perl (version will change from customer to customer). I can not install new CPAN modules at their site. (generally I'm on a heavily firewalled production box with no external http/ftp/ip access). I will be running upon M$ primarily. While at the customer I'll need to be able to make changes to the script as needed (and as I find needed new features or bugs). I have need for some modules on CPAN like date I'd like to be able to build my script using some CPAN modules I'd like to use some CPAN modules like datatime, class::insideout, config::general (and maybe some others) in my script. Is there a way to have some portable library (with all the modules) plus my script, I can tote with me to the customer? I looked at PAR/pp (outside of not being able to get it to compile on M$ strawberry perl), it looks like the customer would need PAR installed, or I'd have to build a self-contained exe. I can't have an exe, since I might need to edit the source onsite, and I can't depend on having PAR at the customer. Any suggestions? Thanks Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From shawn.c.carroll at gmail.com Wed Dec 16 12:48:22 2009 From: shawn.c.carroll at gmail.com (Shawn Carroll) Date: Wed, 16 Dec 2009 14:48:22 -0600 Subject: [Chicago-talk] Portable Script and library In-Reply-To: <39eaccc10912161244y59652670g47a55d66c01c5686@mail.gmail.com> References: <39eaccc10912161244y59652670g47a55d66c01c5686@mail.gmail.com> Message-ID: Are you able to use a USB key? It should be possible to install Strawberry Perl on the USB device and work from there. shawn.c.carroll at gmail.com Perl Programmer Soccer Referee On Wed, Dec 16, 2009 at 14:44, Jay Strauss wrote: > Hi, > > I need to build a script, to be able to bring with me from customer to > customer site.? I can count on running upon a recent version of Perl > (version will change from customer to customer).? I can not install new CPAN > modules at their site.? (generally I'm on a heavily firewalled production > box with no external http/ftp/ip access). ? I will be running upon M$ > primarily. > > While at the customer I'll need to be able to make changes to the script as > needed (and as I find needed new features or bugs). > > I have need for some modules on CPAN like date > > > I'd like to be able to build my script using some CPAN modules > > I'd like to use some CPAN modules like datatime, class::insideout, > config::general (and maybe some others) in my script. > > Is there a way to have some portable library (with all the modules) plus my > script, I can tote with me to the customer??? I looked at PAR/pp (outside of > not being able to get it to compile on M$ strawberry perl), it looks like > the customer would need PAR installed, or I'd have to build a self-contained > exe.? I can't have an exe, since I might need to edit the source onsite, and > I can't depend on having PAR at the customer. > > Any suggestions? > > > Thanks > Jay > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > From me at heyjay.com Wed Dec 16 13:06:02 2009 From: me at heyjay.com (Jay Strauss) Date: Wed, 16 Dec 2009 15:06:02 -0600 Subject: [Chicago-talk] Portable Script and library In-Reply-To: References: <39eaccc10912161244y59652670g47a55d66c01c5686@mail.gmail.com> Message-ID: <39eaccc10912161306h39c00b98l12785bfc383e5fcf@mail.gmail.com> I typically don't have physical access to the machine. (generally it's a vpn). When I need to put something on the box, I usually have to use some intermediate box, then copy the files to a shared drive or some such. On Wed, Dec 16, 2009 at 2:48 PM, Shawn Carroll wrote: > Are you able to use a USB key? It should be possible to install > Strawberry Perl on the USB device and work from there. > > > shawn.c.carroll at gmail.com > Perl Programmer > Soccer Referee > > > > On Wed, Dec 16, 2009 at 14:44, Jay Strauss wrote: > > Hi, > > > > I need to build a script, to be able to bring with me from customer to > > customer site. I can count on running upon a recent version of Perl > > (version will change from customer to customer). I can not install new > CPAN > > modules at their site. (generally I'm on a heavily firewalled production > > box with no external http/ftp/ip access). I will be running upon M$ > > primarily. > > > > While at the customer I'll need to be able to make changes to the script > as > > needed (and as I find needed new features or bugs). > > > > I have need for some modules on CPAN like date > > > > > > I'd like to be able to build my script using some CPAN modules > > > > I'd like to use some CPAN modules like datatime, class::insideout, > > config::general (and maybe some others) in my script. > > > > Is there a way to have some portable library (with all the modules) plus > my > > script, I can tote with me to the customer? I looked at PAR/pp (outside > of > > not being able to get it to compile on M$ strawberry perl), it looks like > > the customer would need PAR installed, or I'd have to build a > self-contained > > exe. I can't have an exe, since I might need to edit the source onsite, > and > > I can't depend on having PAR at the customer. > > > > Any suggestions? > > > > > > Thanks > > Jay > > > > _______________________________________________ > > Chicago-talk mailing list > > Chicago-talk at pm.org > > http://mail.pm.org/mailman/listinfo/chicago-talk > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lembark at wrkhors.com Wed Dec 16 13:27:48 2009 From: lembark at wrkhors.com (Steven Lembark) Date: Wed, 16 Dec 2009 16:27:48 -0500 Subject: [Chicago-talk] Portable Script and library In-Reply-To: <39eaccc10912161244y59652670g47a55d66c01c5686@mail.gmail.com> References: <39eaccc10912161244y59652670g47a55d66c01c5686@mail.gmail.com> Message-ID: <20091216162748.0757aecblembark@wrkhors.com@wrkhors.com> On Wed, 16 Dec 2009 14:44:08 -0600 Jay Strauss wrote: > Hi, > > I need to build a script, to be able to bring with me from customer to > customer site. I can count on running upon a recent version of Perl > (version will change from customer to customer). I can not install new CPAN > modules at their site. (generally I'm on a heavily firewalled production > box with no external http/ftp/ip access). I will be running upon M$ > primarily. > > While at the customer I'll need to be able to make changes to the script as > needed (and as I find needed new features or bugs). > > I have need for some modules on CPAN like date You can run the thing with /path/to/perl your-program which avoids issues in #! paths (no guarantee they will have Perl in the same place you do. At that point you can create a local directory with: ./bin/ ./lib/ ./t/ directories in it. Put anything you need to take with you -- including your own modules -- under ./lib. At that point you can start your code with: use 5.008; use strict; use FindBin qw( $Bin ); use lib "$Bin/../lib'; to include the local library directory: cd /blah/blah; /path/to/perl ./bin/frobnicate 'whatever'; will set $Bin to "/blah/blah/bin" and leave you using "/blah/blah/bin/../lib" for your modules. Anything you need to take with you can be in the lib directory. Add the same thing to your ./t files and you can sanity check the thing with "prove" before trying to run the remaining code. -- Steven Lembark 85-09 90th St. Workhorse Computing Woodhaven, NY, 11421 lembark at wrkhors.com +1 888 359 3508 From me at heyjay.com Wed Dec 16 19:10:47 2009 From: me at heyjay.com (Jay Strauss) Date: Wed, 16 Dec 2009 21:10:47 -0600 Subject: [Chicago-talk] Portable Script and library In-Reply-To: <-1673541196233555444@unknownmsgid> References: <39eaccc10912161244y59652670g47a55d66c01c5686@mail.gmail.com> <-1673541196233555444@unknownmsgid> Message-ID: <39eaccc10912161910o285af34fk844e43c1286f67fe@mail.gmail.com> thanks Steve, that seems to work perfect On Wed, Dec 16, 2009 at 3:27 PM, Steven Lembark wrote: > On Wed, 16 Dec 2009 14:44:08 -0600 > Jay Strauss wrote: > > > Hi, > > > > I need to build a script, to be able to bring with me from customer to > > customer site. I can count on running upon a recent version of Perl > > (version will change from customer to customer). I can not install new > CPAN > > modules at their site. (generally I'm on a heavily firewalled production > > box with no external http/ftp/ip access). I will be running upon M$ > > primarily. > > > > While at the customer I'll need to be able to make changes to the script > as > > needed (and as I find needed new features or bugs). > > > > I have need for some modules on CPAN like date > > > You can run the thing with > > /path/to/perl your-program > > which avoids issues in #! paths (no guarantee they will > have Perl in the same place you do. > > At that point you can create a local directory with: > > ./bin/ > ./lib/ > ./t/ > > directories in it. Put anything you need to take with > you -- including your own modules -- under ./lib. At > that point you can start your code with: > > use 5.008; > use strict; > use FindBin qw( $Bin ); > use lib "$Bin/../lib'; > > to include the local library directory: > > cd /blah/blah; > /path/to/perl ./bin/frobnicate 'whatever'; > > will set $Bin to "/blah/blah/bin" and leave you > using "/blah/blah/bin/../lib" for your modules. > > Anything you need to take with you can be in > the lib directory. > > Add the same thing to your ./t files and you can > sanity check the thing with "prove" before trying > to run the remaining code. > > -- > Steven Lembark 85-09 90th St. > Workhorse Computing Woodhaven, NY, 11421 > lembark at wrkhors.com +1 888 359 3508 > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lembark at wrkhors.com Thu Dec 17 07:37:34 2009 From: lembark at wrkhors.com (Steven Lembark) Date: Thu, 17 Dec 2009 10:37:34 -0500 Subject: [Chicago-talk] Portable Script and library In-Reply-To: <39eaccc10912161910o285af34fk844e43c1286f67fe@mail.gmail.com> References: <39eaccc10912161244y59652670g47a55d66c01c5686@mail.gmail.com> <-1673541196233555444@unknownmsgid> <39eaccc10912161910o285af34fk844e43c1286f67fe@mail.gmail.com> Message-ID: <20091217103734.6fcdb022lembark@wrkhors.com@wrkhors.com> On Wed, 16 Dec 2009 21:10:47 -0600 Jay Strauss wrote: > thanks Steve, that seems to work perfect Glad it helped. To simplify setting this up on your in-house systems you can also use FindBin::libs (which saves you from all the setup issues, it just finds the ./lib directory for itself and uses it automatically). -- Steven Lembark 85-09 90th St. Workhorse Computing Woodhaven, NY, 11421 lembark at wrkhors.com +1 888 359 3508 From sean at blanton.com Fri Dec 18 07:48:40 2009 From: sean at blanton.com (Sean Blanton) Date: Fri, 18 Dec 2009 09:48:40 -0600 Subject: [Chicago-talk] How to get rid of Moose warnings? Message-ID: I'm getting the following warnings, which I'd like to get rid of... Subroutine throw_error redefined at C:/Perl/site/lib/moose.pm line 39. Subroutine extends redefined at C:/Perl/site/lib/moose.pm line 45. Subroutine with redefined at C:/Perl/site/lib/moose.pm line 56. Subroutine has redefined at C:/Perl/site/lib/moose.pm line 60. Subroutine before redefined at C:/Perl/site/lib/moose.pm line 72. Subroutine after redefined at C:/Perl/site/lib/moose.pm line 76. Subroutine around redefined at C:/Perl/site/lib/moose.pm line 80. Subroutine super redefined at C:/Perl/site/lib/moose.pm line 88. Subroutine override redefined at C:/Perl/site/lib/moose.pm line 95. Subroutine inner redefined at C:/Perl/site/lib/moose.pm line 101. Subroutine augment redefined at C:/Perl/site/lib/moose.pm line 115. Subroutine init_meta redefined at C:/Perl/site/lib/moose.pm line 132. Subroutine _get_caller redefined at C:/Perl/site/lib/moose.pm line 228. I'm using plain vanilla Moose and diligently using 'no moose;' at the end of each of my 8 classes. Any ideas? Regards, Sean -------------- next part -------------- An HTML attachment was scrubbed... URL: From merlyn at stonehenge.com Fri Dec 18 07:51:19 2009 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Fri, 18 Dec 2009 07:51:19 -0800 Subject: [Chicago-talk] How to get rid of Moose warnings? In-Reply-To: (Sean Blanton's message of "Fri, 18 Dec 2009 09:48:40 -0600") References: Message-ID: <86aaxgz3ew.fsf@blue.stonehenge.com> >>>>> "Sean" == Sean Blanton writes: Sean> I'm getting the following warnings, which I'd like to get rid of... Sean> Subroutine throw_error redefined at C:/Perl/site/lib/moose.pm line 39. Sean> Subroutine extends redefined at C:/Perl/site/lib/moose.pm line 45. Sean> Subroutine with redefined at C:/Perl/site/lib/moose.pm line 56. Sean> Subroutine has redefined at C:/Perl/site/lib/moose.pm line 60. Sean> Subroutine before redefined at C:/Perl/site/lib/moose.pm line 72. Sean> Subroutine after redefined at C:/Perl/site/lib/moose.pm line 76. Sean> Subroutine around redefined at C:/Perl/site/lib/moose.pm line 80. Sean> Subroutine super redefined at C:/Perl/site/lib/moose.pm line 88. Sean> Subroutine override redefined at C:/Perl/site/lib/moose.pm line 95. Sean> Subroutine inner redefined at C:/Perl/site/lib/moose.pm line 101. Sean> Subroutine augment redefined at C:/Perl/site/lib/moose.pm line 115. Sean> Subroutine init_meta redefined at C:/Perl/site/lib/moose.pm line 132. Sean> Subroutine _get_caller redefined at C:/Perl/site/lib/moose.pm line 228. Sean> I'm using plain vanilla Moose and diligently using 'no moose;' at the end of Sean> each of my 8 classes. You appear to be on windows. You *are* being careful to say: "use Moose" and not "use moose" correct? The latter kinda works, but will break things later. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion From sean at blanton.com Fri Dec 18 08:08:23 2009 From: sean at blanton.com (Sean Blanton) Date: Fri, 18 Dec 2009 10:08:23 -0600 Subject: [Chicago-talk] How to get rid of Moose warnings? In-Reply-To: <86aaxgz3ew.fsf@blue.stonehenge.com> References: <86aaxgz3ew.fsf@blue.stonehenge.com> Message-ID: I had 'use Moose' but then 'no moose'...Changed it to 'no Moose' and that got rid of the warnings. Thanks! On Fri, Dec 18, 2009 at 9:51 AM, Randal L. Schwartz wrote: > >>>>> "Sean" == Sean Blanton writes: > > Sean> I'm getting the following warnings, which I'd like to get rid of... > Sean> Subroutine throw_error redefined at C:/Perl/site/lib/moose.pm line > 39. > Sean> Subroutine extends redefined at C:/Perl/site/lib/moose.pm line 45. > Sean> Subroutine with redefined at C:/Perl/site/lib/moose.pm line 56. > Sean> Subroutine has redefined at C:/Perl/site/lib/moose.pm line 60. > Sean> Subroutine before redefined at C:/Perl/site/lib/moose.pm line 72. > Sean> Subroutine after redefined at C:/Perl/site/lib/moose.pm line 76. > Sean> Subroutine around redefined at C:/Perl/site/lib/moose.pm line 80. > Sean> Subroutine super redefined at C:/Perl/site/lib/moose.pm line 88. > Sean> Subroutine override redefined at C:/Perl/site/lib/moose.pm line 95. > Sean> Subroutine inner redefined at C:/Perl/site/lib/moose.pm line 101. > Sean> Subroutine augment redefined at C:/Perl/site/lib/moose.pm line 115. > Sean> Subroutine init_meta redefined at C:/Perl/site/lib/moose.pm line > 132. > Sean> Subroutine _get_caller redefined at C:/Perl/site/lib/moose.pm line > 228. > > Sean> I'm using plain vanilla Moose and diligently using 'no moose;' at the > end of > Sean> each of my 8 classes. > > You appear to be on windows. > > You *are* being careful to say: > > "use Moose" > > and not > > "use moose" > > correct? The latter kinda works, but will break things later. > > -- > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 > > Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. > See http://methodsandmessages.vox.com/ for Smalltalk and Seaside > discussion > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lembark at wrkhors.com Wed Dec 30 06:54:03 2009 From: lembark at wrkhors.com (Steven Lembark) Date: Wed, 30 Dec 2009 09:54:03 -0500 Subject: [Chicago-talk] Testing, testing... Message-ID: <20091230095403.6b290d1flembark@wrkhors.com@wrkhors.com> From joshua.mcadams at gmail.com Wed Dec 30 06:54:37 2009 From: joshua.mcadams at gmail.com (Joshua) Date: Wed, 30 Dec 2009 08:54:37 -0600 Subject: [Chicago-talk] Testing, testing... In-Reply-To: <6697273996399497252@unknownmsgid> References: <6697273996399497252@unknownmsgid> Message-ID: <49d805d70912300654u28dcdb06jc63a5e692cf0d6aa@mail.gmail.com> 123 On Wed, Dec 30, 2009 at 8:54 AM, Steven Lembark wrote: > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > From richard at rushlogistics.com Wed Dec 30 07:29:08 2009 From: richard at rushlogistics.com (richard at rushlogistics.com) Date: Wed, 30 Dec 2009 15:29:08 +0000 Subject: [Chicago-talk] Testing, testing... Message-ID: <1263302962-1262186999-cardhu_decombobulator_blackberry.rim.net-1960127320-@bda618.bisx.prod.on.blackberry> My messages hacnouncing back? ------Original Message------ From: Steven Lembark Sender: chicago-talk-bounces+richard=rushlogistics.com at pm.org To: Chicago.pm chatter ReplyTo: Chicago.pm chatter Sent: Dec 30, 2009 8:54 AM Subject: [Chicago-talk] Testing, testing... _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk Sent via my BlackBerry. Ignore all the typos. From bdoty at eqtc.com Wed Dec 30 07:48:54 2009 From: bdoty at eqtc.com (Brad Doty) Date: Wed, 30 Dec 2009 09:48:54 -0600 Subject: [Chicago-talk] I'm back Message-ID: <1262188134.5889.35.camel@bdoty01> So what's going on in the world of Perl and Chicago PM lately? From richard at rushlogistics.com Wed Dec 30 09:58:44 2009 From: richard at rushlogistics.com (Richard Reina) Date: Wed, 30 Dec 2009 12:58:44 -0500 (EST) Subject: [Chicago-talk] regular expression help Message-ID: <20091230175844.956B03CB8@courageux.xo.com> I am trying to write a program that goes through emails in a thunderbird Inbox finds the email address of any emails that have bounced back ( contained in failure notifications ) and creates a summary report of bad email addresses. The program is merely an adaptation of other perl code I have that searches through files looking for regular expressions. However, I am getting confused on how to skip through this file. What I am intending in the code below is that once the string "could not be delivered" is found that the program then begins to search for the next email address listed, hence the search string "\@" and to let me know what that email is. However, I'm getting confused with the iteration of the while loop and I am not getting anywhere. Can anyone advise on where I've gone wrong? Perhaps there's a better way of doing this? Any help would be greatly appreciated. Thanks, Richard #!/usr/bin/perl # short script to check a for email errors use strict; use warnings; use File::Spec; use Carp; # set the directory that you want to search my $dir ='c:\Users\rushlog\AppData\Roaming\Thunderbird\Profiles\wcorkhfi.default\Mail\Local Folders'; my @files_in_dir; my $files_in_dir; opendir(DIR, $dir) or die "Can't open directory: $!\n"; # line 19 while (my $file = readdir(DIR)) { # use a regular expression to ignore file beginning with a period next if ($file =~ m/^\./); push(@files_in_dir, $file); } close(DIR); my $i = 0; my $string = 'your message could not be delivered'; foreach $files_in_dir (@files_in_dir) { if ($files_in_dir eq 'Inbox.msf') { #this is the one we need to search in my $file_name = File::Spec->join($dir, $files_in_dir); open(LOG, '<', $file_name) or croak "Unable to open $file_name: $!"; my $j; # line counter while() { $j++; # line 51 test for string. Put the string between the b and the \b if (/\b$string\b/i) { $i++; print "Apparent undelivered email " . $string . " FOUND in line " . $j . " of " . $files_in_dir . "\n"; print " " . $_; # look for the email address that comes after my $bad_email = '\@'; if (/\b$bad_email\b/i) { # this line contains the next email address print "This line contains the next email address " . $_; chomp (my $xx = ); next; } else { # next line does not contain an email address print "The next line did NOT contain an email address\n" . $_ . "\n"; chomp (my $yy = ); next; } } } # end of while close(LOG); } # end of if } From Andy_Bach at wiwb.uscourts.gov Wed Dec 30 10:52:40 2009 From: Andy_Bach at wiwb.uscourts.gov (Andy_Bach at wiwb.uscourts.gov) Date: Wed, 30 Dec 2009 12:52:40 -0600 Subject: [Chicago-talk] regular expression help In-Reply-To: <20091230175844.956B03CB8@courageux.xo.com> References: <20091230175844.956B03CB8@courageux.xo.com> Message-ID: Hey, Not sure what your .msf file should look like but I mocked up a file like: your message could not be delivered : andy at wiwb'; and get: Apparent undelivered email your message could not be delivered FOUND in line 1 of Inbox.msf your message could not be delivered : andy at wiwb'; This line contains the next email address your message could not be delivered : andy at wiwb'; so *if* your .msf format is like that, then is should work. You're doing a lot of extra work though - for one, if you know the name of the file, you don't need to do the opendir/readir stuff (unless you're planning to look for other files). The: # look for the email address that comes after my $bad_email = '\@'; if (/\b$bad_email\b/i) { appears you've pared things down (you don't need the backslash inside single quotes) as /@/ should match anywhere /\b@\b/ would, I believe. This would normally be where you capture the info: # look for the email address that comes after my $bad_email = '@'; if (/(\S+$bad_email\S+)/i) { gets all the non-whitespace chars on either side of the '@' into $1. a ---------------------- Andy Bach Systems Mangler Internet: andy_bach at wiwb.uscourts.gov Voice: (608) 261-5738; Cell: (608) 658-1890 The bureaucracy is expanding to meet the needs of an expanding bureaucracy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshua.mcadams at gmail.com Wed Dec 30 20:37:39 2009 From: joshua.mcadams at gmail.com (Joshua) Date: Wed, 30 Dec 2009 22:37:39 -0600 Subject: [Chicago-talk] I'm back In-Reply-To: <1262188134.5889.35.camel@bdoty01> References: <1262188134.5889.35.camel@bdoty01> Message-ID: <49d805d70912302037n3702e3co73e786e4fdb00e4e@mail.gmail.com> I think the lack of response confirms that not much (probably due to the holidays) should be the answer :) How about a January meeting? I'm up for it. Anyone have an interesting topic of discussion for a tech meeting. If not, we might just do a nice bar meetup. On Wed, Dec 30, 2009 at 9:48 AM, Brad Doty wrote: > So what's going on in the world of Perl and Chicago PM lately? > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > From shlomif at iglu.org.il Wed Dec 30 21:32:22 2009 From: shlomif at iglu.org.il (Shlomi Fish) Date: Thu, 31 Dec 2009 07:32:22 +0200 Subject: [Chicago-talk] I'm back In-Reply-To: <1262188134.5889.35.camel@bdoty01> References: <1262188134.5889.35.camel@bdoty01> Message-ID: <200912310732.22307.shlomif@iglu.org.il> Hi Brad! On Wednesday 30 Dec 2009 17:48:54 Brad Doty wrote: > So what's going on in the world of Perl and Chicago PM lately? > Well, here are a few things new in the Perl world, not particularly related to Chicago.pm: 1. The *.perl.org web-sites have a new look and feel: * http://www.perl.org/ * http://learn.perl.org/ * http://lists.perl.org/ * http://qa.perl.org/ Etc. See: http://log.perl.org/2009/11/a-new-look-for-perlorg.html 2. Devel-NTYProf v3 is out: http://blog.timbunce.org/2009/12/24/nytprof-v3-worth-the-wait/ 3. The Padre Perl IDE development team has been making a lot of progress on their IDE: http://blogs.padre.perlide.org/ 4. There have been many Perl-related Advent Calendars this year: http://perlbuzz.com/2009/12/advent-calendars-galore.html The Perl 6 Advent Calendar was featured on Slashdot: http://developers.slashdot.org/story/09/12/06/196202/ ------------------ These are the news items off the top of my head. Hopefully other people can add more. Regards, Shlomi Fish > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ Freecell Solver - http://fc-solve.berlios.de/ Bzr is slower than Subversion in combination with Sourceforge. ( By: http://dazjorz.com/ ) From sean at blanton.com Thu Dec 31 05:13:01 2009 From: sean at blanton.com (Sean Blanton) Date: Thu, 31 Dec 2009 07:13:01 -0600 Subject: [Chicago-talk] I'm back In-Reply-To: <200912310732.22307.shlomif@iglu.org.il> References: <1262188134.5889.35.camel@bdoty01> <200912310732.22307.shlomif@iglu.org.il> Message-ID: Probably no more free beer/refreshments or hosting from Openmake for meetings. :( I'm at a new company. On Wed, Dec 30, 2009 at 11:32 PM, Shlomi Fish wrote: > Hi Brad! > > On Wednesday 30 Dec 2009 17:48:54 Brad Doty wrote: > > So what's going on in the world of Perl and Chicago PM lately? > > > > Well, here are a few things new in the Perl world, not particularly related > to > Chicago.pm: > > 1. The *.perl.org web-sites have a new look and feel: > > * http://www.perl.org/ > > * http://learn.perl.org/ > > * http://lists.perl.org/ > > * http://qa.perl.org/ > > Etc. > > See: > > http://log.perl.org/2009/11/a-new-look-for-perlorg.html > > 2. Devel-NTYProf v3 is out: > > http://blog.timbunce.org/2009/12/24/nytprof-v3-worth-the-wait/ > > 3. The Padre Perl IDE development team has been making a lot of progress on > their IDE: > > http://blogs.padre.perlide.org/ > > 4. There have been many Perl-related Advent Calendars this year: > > http://perlbuzz.com/2009/12/advent-calendars-galore.html > > The Perl 6 Advent Calendar was featured on Slashdot: > > http://developers.slashdot.org/story/09/12/06/196202/ > > ------------------ > > These are the news items off the top of my head. Hopefully other people can > add more. > > Regards, > > Shlomi Fish > > > _______________________________________________ > > Chicago-talk mailing list > > Chicago-talk at pm.org > > http://mail.pm.org/mailman/listinfo/chicago-talk > > > > -- > ----------------------------------------------------------------- > Shlomi Fish http://www.shlomifish.org/ > Freecell Solver - http://fc-solve.berlios.de/ > > Bzr is slower than Subversion in combination with Sourceforge. > ( By: http://dazjorz.com/ ) > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeremy at marzhillstudios.com Thu Dec 31 12:37:13 2009 From: jeremy at marzhillstudios.com (Jeremy Wall) Date: Thu, 31 Dec 2009 14:37:13 -0600 Subject: [Chicago-talk] I'm back In-Reply-To: <69d143cd0912311235n2f5360e7l9f88bb3a841db41a@mail.gmail.com> References: <1262188134.5889.35.camel@bdoty01> <200912310732.22307.shlomif@iglu.org.il> <69d143cd0912311235n2f5360e7l9f88bb3a841db41a@mail.gmail.com> Message-ID: <69d143cd0912311237v282c9d48t3af9c5eedc9c26cf@mail.gmail.com> I've been playing with rakudo perl6 lately. I could put together some sort of talk for that if folks are interested? On Dec 31, 2009 7:13 AM, "Sean Blanton" wrote: Probably no more free beer/refreshments or hosting from Openmake for meetings. :( I'm at a new company. On Wed, Dec 30, 2009 at 11:32 PM, Shlomi Fish wrote: > > Hi Brad! > > On Wed... _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: