From jay.hannah at iinteractive.com Mon Sep 19 13:28:10 2011 From: jay.hannah at iinteractive.com (Jay Hannah) Date: Mon, 19 Sep 2011 15:28:10 -0500 Subject: [Omaha.pm] Perl5 OO docs Message-ID: A good read: http://blog.urth.org/2011/09/my-new-oo-docs-for-the-perl-core-have-been-merged.html Survey: How are YOU doing OO in Perl5? [ ] OO? Why bother? [ ] Moose [ ] I rolled my own AUTOLOAD stuff [ ] Other (please elaborate! :) ? Thanks, Jay Hannah Senior Developer / Consultant http://www.iinteractive.com Email: jay.hannah at iinteractive.com AOL IM: deafferret Mobile: 1.402.598.7782 Fax: 1.402.691.9496 From tedkat at gmail.com Mon Sep 19 13:55:40 2011 From: tedkat at gmail.com (Theodore Katseres) Date: Mon, 19 Sep 2011 15:55:40 -0500 Subject: [Omaha.pm] Perl5 OO docs In-Reply-To: References: Message-ID: On Mon, Sep 19, 2011 at 3:28 PM, Jay Hannah wrote: > A good read: > > > http://blog.urth.org/2011/09/my-new-oo-docs-for-the-perl-core-have-been-merged.html > > Survey: How are YOU doing OO in Perl5? > [ ] OO? Why bother? [2] Moose ( been my default for a while now ) [ ] I rolled my own AUTOLOAD stuff [ 1] Other ( Mo for most things :) -- Ted Katseres ||=O=|| -------------- next part -------------- An HTML attachment was scrubbed... URL: From sterling at hanenkamp.com Tue Sep 20 18:03:19 2011 From: sterling at hanenkamp.com (Sterling Hanenkamp) Date: Tue, 20 Sep 2011 20:03:19 -0500 Subject: [Omaha.pm] Perl5 OO docs In-Reply-To: References: Message-ID: <33BB9533-1581-40CD-9D83-CEBD730745FC@hanenkamp.com> On Sep 19, 2011, at 3:28 PM, Jay Hannah wrote: > Survey: How are YOU doing OO in Perl5? > > [ ] OO? Why bother? > [x] Moose > [ ] I rolled my own AUTOLOAD stuff > [ ] Other (please elaborate! :) Is there anything else? ;) From jay.hannah at iinteractive.com Wed Sep 21 09:28:13 2011 From: jay.hannah at iinteractive.com (Jay Hannah) Date: Wed, 21 Sep 2011 11:28:13 -0500 Subject: [Omaha.pm] careerbuilder.com says... Message-ID: <23849C8A-0229-4A0B-BE87-E8B7DDB1BF65@iinteractive.com> http://twitter.com/#!/RyanStille Wow, CareerBuilder says there are 113 open #ColdFusion positions in #Omaha. And 22 Perl. Hmm. j From wertnick at gmail.com Wed Sep 21 09:42:10 2011 From: wertnick at gmail.com (Nick Wertzberger) Date: Wed, 21 Sep 2011 11:42:10 -0500 Subject: [Omaha.pm] careerbuilder.com says... In-Reply-To: <23849C8A-0229-4A0B-BE87-E8B7DDB1BF65@iinteractive.com> References: <23849C8A-0229-4A0B-BE87-E8B7DDB1BF65@iinteractive.com> Message-ID: Yep... On Wed, Sep 21, 2011 at 11:28 AM, Jay Hannah wrote: > http://twitter.com/#!/RyanStille > Wow, CareerBuilder says there are 113 open #ColdFusion positions in #Omaha. > > And 22 Perl. Hmm. > > j > > > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sterling at hanenkamp.com Wed Sep 21 10:09:32 2011 From: sterling at hanenkamp.com (Sterling Hanenkamp) Date: Wed, 21 Sep 2011 12:09:32 -0500 Subject: [Omaha.pm] careerbuilder.com says... In-Reply-To: References: <23849C8A-0229-4A0B-BE87-E8B7DDB1BF65@iinteractive.com> Message-ID: Right, but that's like saying you have 113 openings for fast food restaurant burger flippers versus 22 openings for 3- and 4-star chefs. 2011/9/21 Nick Wertzberger > Yep... > > > On Wed, Sep 21, 2011 at 11:28 AM, Jay Hannah wrote: > >> http://twitter.com/#!/RyanStille >> Wow, CareerBuilder says there are 113 open #ColdFusion positions in >> #Omaha. >> >> And 22 Perl. Hmm. >> >> j >> >> >> >> _______________________________________________ >> Omaha-pm mailing list >> Omaha-pm at pm.org >> http://mail.pm.org/mailman/listinfo/omaha-pm >> > > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > -- Andrew Sterling Hanenkamp sterling at hanenkamp.com 785.370.4454 -------------- next part -------------- An HTML attachment was scrubbed... URL: From topher-pm at zyp.org Wed Sep 21 10:15:17 2011 From: topher-pm at zyp.org (Christopher Cashell) Date: Wed, 21 Sep 2011 12:15:17 -0500 Subject: [Omaha.pm] careerbuilder.com says... In-Reply-To: References: <23849C8A-0229-4A0B-BE87-E8B7DDB1BF65@iinteractive.com> Message-ID: 2011/9/21 Sterling Hanenkamp : > Right, but that's like saying you have 113 openings for fast food restaurant > burger flippers versus 22 openings for 3- and 4-star chefs. Well said, Sir. > -- > Andrew Sterling Hanenkamp > sterling at hanenkamp.com -- Christopher From jay at jays.net Fri Sep 23 09:38:33 2011 From: jay at jays.net (Jay Hannah) Date: Fri, 23 Sep 2011 11:38:33 -0500 Subject: [Omaha.pm] This is the best thing ever Message-ID: <7D6DE28D-3B12-4A44-BC13-9820869AD40E@jays.net> LOL! I have NO IDEA what this does. :) j https://gist.github.com/1237698 use 5.14.1; my $str = q {This is the best thing ever.}; my $re = qr{(.i.) .+? (.e.)}; $str =~ $re; for (1 .. $#-) { my $substr = substr $str, $-[ $_ ], $+[ $_ ] - $-[ $_ ]; printf "match %s (from %2s to %2s): %s\n", $_, $-[ $_ ], $+[ $_ ], $substr; } From jay at jays.net Tue Sep 27 11:56:35 2011 From: jay at jays.net (Jay Hannah) Date: Tue, 27 Sep 2011 13:56:35 -0500 Subject: [Omaha.pm] Fwd: Perl Poll: What would you like to read about? References: Message-ID: <8102E716-3336-4115-98D8-057A76E013C7@jays.net> From: Gabor Szabo Date: September 26, 2011 1:21:00 AM CDT > Hi, > > I have set up a new web site for running polls, to allow people in the > Perl community figure out what others in the community think. > I plan to run one very quick poll every month. > > This time I'd like to know what would you like to read about in the > Perl blogs. For the full article visit: > > http://szabgab.com/blog/2011/09/perl-poll-what-would-you-like-to-read-about.html > > To go directly to the poll visit http://perlpolls.com/perl-news From topher-pm at zyp.org Tue Sep 27 13:57:23 2011 From: topher-pm at zyp.org (Christopher Cashell) Date: Tue, 27 Sep 2011 15:57:23 -0500 Subject: [Omaha.pm] Perl5 OO docs In-Reply-To: References: Message-ID: On Mon, Sep 19, 2011 at 3:28 PM, Jay Hannah wrote: > Survey: How are YOU doing OO in Perl5? > > ? [X] OO? Why bother? > ? [X] Moose > ? [ ] I rolled my own AUTOLOAD stuff > ? [ ] Other (please elaborate! :) Mine is a combination of the two because most of the Perl I write for work is fairly short (usually in the range of 50-300 lines per script). Moose doesn't necessarily fit for a lot of that. For anything of greater significance, I use it, though. > Jay Hannah -- Christopher From dan at linder.org Thu Sep 29 13:53:02 2011 From: dan at linder.org (Dan Linder) Date: Thu, 29 Sep 2011 15:53:02 -0500 Subject: [Omaha.pm] A regex "best fit" finder? Message-ID: I have a list of server names that I want to create a regex match against. It could be done by hand, but the list changes (adds, removes) on a weekly basis. Does anyone know of a program that can take a list of matches and create a regular expression that will match them? Example: OMAWWW001 OMAWWW002 OMADNS001 ORDWWW001 ORDWWW002 ORDWWW003 ORDDNS001 ORDDNS002 I guess the "shortest" match would be /O.......[123]/ but it's kinda 'loose'. I *think* what I'd like is something like this: /O[MR][AD][WD][WN][WS]00[123]/ (But a smarter regex tool might find something tighter...) What I *don't* want is: /OMAWWW001|OMAWWW002|...|ORDDNS002/ I don't have enough space in my tool for a 10K long string! :) Any thoughts? Thanks, DanL -- ***************** ************* *********** ******* ***** *** ** "Quis custodiet ipsos custodes?" (Who can watch the watchmen?) -- from the Satires of Juvenal "I do not fear computers, I fear the lack of them." -- Isaac Asimov (Author) ** *** ***** ******* *********** ************* ***************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From sterling at hanenkamp.com Thu Sep 29 14:07:25 2011 From: sterling at hanenkamp.com (Sterling Hanenkamp) Date: Thu, 29 Sep 2011 16:07:25 -0500 Subject: [Omaha.pm] A regex "best fit" finder? In-Reply-To: References: Message-ID: Nothing like that comes to mind. If it has to be something that is in the predefined match, most of your examples wouldn't do that. If it's just to be a heuristic to help you throw out something, it would depend on the heuristic. Personally, I'd probably use a tied hash or maybe MongoDB or something similar, fill that with the list and then hit the database for a verification. The database "hash table" could be reloaded every week. This is old school, but it works quite well for this simple task: # Common Code use DB_File; tie %valid, 'DB_File', 'valid_things.db', O_RDWR|O_CREAT, 0644, $DB_HASH; # Load the latest (assuming the input is one valid string per line) %valid = (); while (<>) { chomp; $valid{$_}++ } # Check for valid strings if ($valid{ $unvalidated_input }) { print "YES!\n" } else { print "NO!\n" } 2011/9/29 Dan Linder > I have a list of server names that I want to create a regex match against. > It could be done by hand, but the list changes (adds, removes) on a weekly > basis. > > Does anyone know of a program that can take a list of matches and create a > regular expression that will match them? > > Example: > OMAWWW001 > OMAWWW002 > OMADNS001 > ORDWWW001 > ORDWWW002 > ORDWWW003 > ORDDNS001 > ORDDNS002 > > I guess the "shortest" match would be /O.......[123]/ but it's kinda > 'loose'. > > I *think* what I'd like is something like this: > /O[MR][AD][WD][WN][WS]00[123]/ > (But a smarter regex tool might find something tighter...) > > What I *don't* want is: /OMAWWW001|OMAWWW002|...|ORDDNS002/ > I don't have enough space in my tool for a 10K long string! :) > > Any thoughts? > > Thanks, > DanL > > -- > ***************** ************* *********** ******* ***** *** ** > "Quis custodiet ipsos custodes?" > (Who can watch the watchmen?) > -- from the Satires of Juvenal > "I do not fear computers, I fear the lack of them." > -- Isaac Asimov (Author) > ** *** ***** ******* *********** ************* ***************** > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > -- Andrew Sterling Hanenkamp sterling at hanenkamp.com 785.370.4454 -------------- next part -------------- An HTML attachment was scrubbed... URL: From topher-pm at zyp.org Thu Sep 29 14:15:05 2011 From: topher-pm at zyp.org (Christopher Cashell) Date: Thu, 29 Sep 2011 16:15:05 -0500 Subject: [Omaha.pm] A regex "best fit" finder? In-Reply-To: References: Message-ID: 2011/9/29 Dan Linder : > Example: > OMAWWW001 > OMAWWW002 > OMADNS001 > ORDWWW001 > ORDWWW002 > ORDWWW003 > ORDDNS001 > ORDDNS002 > Any thoughts? I've dealt with a similar thing at work. It can be incredibly tricky, depending on the names in question, how variable they are, and whether you just want to match them roughly, or if you want to match them to validate them. For example, from the data listed, they appear to be all of the form: 3 letter site/city code, followed by 3 letter function/machine code, followed by a 3 digit number. If you just wanted to catch anything that matches that format, you could possibly do something like: /\w{3}\w{3}\d{3}/ Depending on the number of site/city codes and the number of function/machine codes, you could do something like (Note: start of line/field anchor added to improve performance with alternations; depending on how much data you're processing, it may not matter or be applicable): /^(OMA|ORD)(WWW|DNS)\d{3}/ This would allow you to validate that not only does the 3 letter, 3 letter, 3 digit form matches, but that it validates to expected site and function codes. This also has the advantage that it works with codes that aren't exactly 3 letters (i.e. if you want to use SMTP for a mail server). If you've got a decent number of entries, you might want to reformat it with /x for increased readability: /^ (OMA|ORD|DEN|SEA|LAX) (WWW|DNS|SMTP|IRC|DB) \d{3} /x Without knowing more about the current names, as well as potential future names, that's probably the best I can think of. > Thanks, > DanL -- Christopher From dan at linder.org Thu Sep 29 14:23:01 2011 From: dan at linder.org (Dan Linder) Date: Thu, 29 Sep 2011 16:23:01 -0500 Subject: [Omaha.pm] A regex "best fit" finder? In-Reply-To: References: Message-ID: Yeah, my simple list was very simple compared to the actual list of files. I envision the final solution would be a number of match strings strung together with "|"... Thanks, I'll keep looking. Dan On Thu, Sep 29, 2011 at 16:15, Christopher Cashell wrote: > 2011/9/29 Dan Linder : > > Example: > > OMAWWW001 > > OMAWWW002 > > OMADNS001 > > ORDWWW001 > > ORDWWW002 > > ORDWWW003 > > ORDDNS001 > > ORDDNS002 > > Any thoughts? > > I've dealt with a similar thing at work. It can be incredibly tricky, > depending on the names in question, how variable they are, and whether > you just want to match them roughly, or if you want to match them to > validate them. > > For example, from the data listed, they appear to be all of the form: > 3 letter site/city code, followed by 3 letter function/machine code, > followed by a 3 digit number. If you just wanted to catch anything > that matches that format, you could possibly do something like: > > /\w{3}\w{3}\d{3}/ > > Depending on the number of site/city codes and the number of > function/machine codes, you could do something like (Note: start of > line/field anchor added to improve performance with alternations; > depending on how much data you're processing, it may not matter or be > applicable): > > /^(OMA|ORD)(WWW|DNS)\d{3}/ > > This would allow you to validate that not only does the 3 letter, 3 > letter, 3 digit form matches, but that it validates to expected site > and function codes. This also has the advantage that it works with > codes that aren't exactly 3 letters (i.e. if you want to use SMTP for > a mail server). > > If you've got a decent number of entries, you might want to reformat > it with /x for increased readability: > > /^ (OMA|ORD|DEN|SEA|LAX) > (WWW|DNS|SMTP|IRC|DB) > \d{3} /x > > Without knowing more about the current names, as well as potential > future names, that's probably the best I can think of. > > > Thanks, > > DanL > > -- > Christopher > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > -- ***************** ************* *********** ******* ***** *** ** "Quis custodiet ipsos custodes?" (Who can watch the watchmen?) -- from the Satires of Juvenal "I do not fear computers, I fear the lack of them." -- Isaac Asimov (Author) ** *** ***** ******* *********** ************* ***************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From topher-pm at zyp.org Thu Sep 29 16:03:11 2011 From: topher-pm at zyp.org (Christopher Cashell) Date: Thu, 29 Sep 2011 18:03:11 -0500 Subject: [Omaha.pm] A regex "best fit" finder? In-Reply-To: References: Message-ID: 2011/9/29 Dan Linder : > Yeah, my simple list was very simple compared to the actual list of files. > ?I envision the final solution would be a number of match strings strung > together with "|"... Do you have a complete list of hostnames that you want to match against? If your list is that big, but you do have the full list, you could use Regexp::Trie (or the slightly slower, but potentially more flexible Regexp::Assemble). Both are available from CPAN. Using one of those, you can read in the list of items from an external names file, and programmatically add them to your regex. Basically, you'd do something like: ---------------------------------------------------------------------- use Regexp::Trie; open my ($regex_fh), '<', './hostnames' or die "Couldn't open file"; my $rt = Regexp::Trie->new; while (<$regex_fh>) { chomp; $rt->add($_); } my $super_regex = $rt->regexp; while (<>) { chomp; say if /$super_regex/; } ---------------------------------------------------------------------- > Thanks, I'll keep looking. > Dan -- Christopher