From michael at web.oakley.com Mon Jan 6 16:30:16 2003 From: michael at web.oakley.com (Michael Wood) Date: Wed Aug 4 00:04:56 2004 Subject: OC-PM: Just a reminder.. Message-ID: <004701c2b5d3$2fe726c0$162b14ac@web.oit.ooweb.oakley.com> Greetings, Just a quick reminder to let you know about our meeting tomorrow night covering XML::EasySlice. There'll be pizza n' stuff (and coffee of course ;). If you need help with directions, let me know. You can always refer to the website http://oc.pm.org for the address. We look forward to seeing you there! -Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/oc-pm/attachments/20030106/f9be1a8a/attachment.htm From michael at web.oakley.com Wed Jan 8 16:10:43 2003 From: michael at web.oakley.com (Michael Wood) Date: Wed Aug 4 00:04:56 2004 Subject: OC-PM: OC-PM meeting followup Message-ID: <001101c2b762$c9dd5980$162b14ac@web.oit.ooweb.oakley.com> Greetings, Thanks to all who attended last night's meeting. We hope you all enjoyed yourselves as much as we did. As for those who did not make it last night, Mark and Ryan did a terrific job going over all things XML::EasySlice. We got to see how XML::EasySlice works, how you would use it in real life situations and we got a "behind the scenes" look at to what kind of thoughts and philosophies went into XML::EasySlice during its conception. Great job everyone! Next months topic of conversation is still up for grabs, but for the time being it looks like we just may go around the table and relate our favorite data munging techniques (for those who wish to participate, of course ;) http://oc.pm.org will be updated to reflect on possible future topics...so in the meantime, kick around an idea or two you'd like to see presented in future OC-PM meetings. Until next time, -Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/oc-pm/attachments/20030108/0f7c58eb/attachment.htm From dgwilson at sonomasystems.net Thu Jan 9 16:57:37 2003 From: dgwilson at sonomasystems.net (Wilson, Douglas) Date: Wed Aug 4 00:04:56 2004 Subject: OC-PM: EasySlice and Source Filters? Message-ID: It wasn't really brought up how namespaces were handled with the EasySlice module, and since source filters were also mentioned, so for the fun of it, I came up with this source filter to allow something like '$object->foo:bar' and have 'foo:bar' be the method name. First is the demo script, then the module: #!/usr/local/bin/perl package Useless::Package; use strict; use warnings; use vars qw($AUTOLOAD); # Print the method name and arguments # and just return the 'object' sub AUTOLOAD { my $self = shift; $AUTOLOAD =~ /^(.*?)::(.*)/ or die "Error autoloading $AUTOLOAD"; print "$1->$2(@_)\n"; $self; } package main; use strict; use warnings; use MethodFilter; Useless::Package->foo:orders("a".."c") ->baz:order("b".."d")->foo:bar(1..3); ################################### package MethodFilter; # # Use methods with a single colon # (":") character in them # as bare words. # Author: Douglas Wilson # # E.g. Package->foo:bar; # creates lexical variable $_foo__bar, # sets it to 'foo:bar', and substitutes the variable name # into the method call # # Known issues: # 1) $condtion ? $obj->method:function(); # (just put white space around the ":" to fix it) # 2) single quoted strings containing, e.g., '->word:word' # (break up the string: '->' . 'word:word') # 3) Line break after method operator '->' # (break the line before the '->') # use strict; use warnings; use Filter::Util::Call; sub filter { my ($self) = @_; my ($status); if ( ( $status = filter_read() ) > 0 ) { s/(?<=->)((\w+):(\w+)) (?{$self->{methods}->{$1} = "\$_${2}__${3}"}) /\$_${2}__${3}/gx; $self->{buffer} .= $_; $_ = ''; } elsif (%$self) { # EOF $_ = 'my (' . join ( ",", values %{ $self->{methods} } ) . ")=qw(@{[keys %{$self->{methods}}]});"; $_ .= $self->{buffer}; $status = 1; %$self = (); } else { $_ = $self->{buffer}; } $status; } sub import { filter_add( { methods => {}, buffer => '' } ); } 1; From dgwilson at sonomasystems.net Fri Jan 10 11:41:31 2003 From: dgwilson at sonomasystems.net (Wilson, Douglas) Date: Wed Aug 4 00:04:56 2004 Subject: OC-PM: EasySlice and Source Filters? Message-ID: I thought of a big improvement to my last source filter, so now I don't have to buffer any source, and it could now probably even be done with Filter::Simple, though I haven't yet installed or looked at that module... Hope somebody enjoys this... package MethodFilter; # # Use methods with a single colon # (":") character in them # as bare words. # Author: Douglas Wilson # # E.g. Package->foo:bar; # creates package variable $MethodFilter::_foo_bar, # sets it to 'foo:bar', and substitutes the variable name # into the method call # # Known issues: # 1) $condtion ? $obj->method:function(); # (just put white space around the ":" to fix it) # 2) single quoted strings containing, e.g., '->word:word' # (break up the string: '->' . 'word:word') # 3) Line break after method operator '->' # (break the line before the '->') # use strict; use warnings; use Filter::Util::Call; use vars qw($tmp); sub import { filter_add( sub { my ($status); s/ (?<=->)((\w+):(\w+)) (?{ no strict 'refs'; $tmp = __PACKAGE__ . "::$_{2}_${3}"; $$tmp = $1; }) /\$$tmp/gx if ($status = filter_read()) > 0; $status; } ); } 1; From dgwilson at sonomasystems.net Fri Jan 10 11:52:10 2003 From: dgwilson at sonomasystems.net (Wilson, Douglas) Date: Wed Aug 4 00:04:56 2004 Subject: OC-PM: EasySlice and Source Filters? Message-ID: Typo in that last one... One should never edit after cutting and pasting... :-) package MethodFilter; # # Use methods with a single colon # (":") character in them # as bare words. # Author: Douglas Wilson # # E.g. Package->foo:bar; # creates package variable $MethodFilter::_foo_bar, # sets it to 'foo:bar', and substitutes the variable name # into the method call # # Known issues: # 1) $condtion ? $obj->method:function(); # (just put white space around the ":" to fix it) # 2) single quoted strings containing, e.g., '->word:word' # (break up the string: '->' . 'word:word') # 3) Line break after method operator '->' # (break the line before the '->') # use strict; use warnings; use Filter::Util::Call; use vars qw($tmp); sub import { filter_add( sub { my ($status); s/ (?<=->)((\w+):(\w+)) (?{ no strict 'refs'; $tmp = __PACKAGE__ . "::_${2}_${3}"; $$tmp = $1; }) /\$$tmp/gx if ($status = filter_read()) > 0; $status; } ); } 1; From michael at web.oakley.com Fri Jan 10 22:14:28 2003 From: michael at web.oakley.com (Michael Wood) Date: Wed Aug 4 00:04:56 2004 Subject: OC-PM: website heads up.. Message-ID: <002801c2b927$ef109660$162b14ac@web.oit.ooweb.oakley.com> Greetings, http://oc.pm.org hasn't been updated due to a bit of an issue loggin in to the server...rest assured, once this issue clears, the site'll be updated ASAP... thanks for your patience.. -Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/oc-pm/attachments/20030110/8257b53a/attachment.htm From kip at web.oakley.com Mon Jan 13 11:44:45 2003 From: kip at web.oakley.com (Kip Hampton) Date: Wed Aug 4 00:04:56 2004 Subject: OC-PM: EasySlice and Source Filters? References: Message-ID: <3E22FB0D.6080307@web.oakley.com> Wilson, Douglas wrote: > It wasn't really brought up how namespaces were handled > with the EasySlice module, and since source filters were also > mentioned, so for the fun of it, I came up with this source filter > to allow something like '$object->foo:bar' and have 'foo:bar' be the method > name. Rockin'!!!! A word of caution to anyone attempting to integrate Douglas' fine work into EasySlice, please do make it a fatal error if the prefix used in the method shortcut is not bound to a URI. IMO, $node->foo:bar() should cause the script to croak if the prefix 'foo' is not bound to a URI (either by the user, or within the scope of the current node in the existing document).. Pendantic? Perhaps. But by the rules of XML, a namespace prefix *must* be bound to a URI and we don't want to make it too easy to produce not-well-formed XML that a subsequent parse will choke on. Thoughts? -kip From dgwilson at sonomasystems.net Mon Jan 13 12:02:27 2003 From: dgwilson at sonomasystems.net (Wilson, Douglas) Date: Wed Aug 4 00:04:56 2004 Subject: OC-PM: EasySlice and Source Filters? Message-ID: I posted the code on use.perl.org, and already I have my first suggested change...I guess I didn't need to use the '(?{})' thing in the substitution, and could have just used a '/e' modifier instead, and incorporated the code into the RHS of the substitution :-) -Doug From dgwilson at sonomasystems.net Mon Jan 13 15:25:00 2003 From: dgwilson at sonomasystems.net (Wilson, Douglas) Date: Wed Aug 4 00:04:56 2004 Subject: OC-PM: EasySlice and Source Filters? Message-ID: On Monday, January 13, 2003 9:45 AM, Kip Hampton [SMTP:kip@web.oakley.com] wrote: > > A word of caution to anyone attempting to integrate Douglas' fine work > into EasySlice, please do make it a fatal error if the prefix used in > the method shortcut is not bound to a URI. Oh yeah, and the ((\w+):(\w+)) part could be more refined to better reflect correct XML semantics also...which I'm not intimately familiar with, so I won't attempt it :-) -Doug From michael at web.oakley.com Tue Jan 28 15:38:38 2003 From: michael at web.oakley.com (Michael Wood) Date: Wed Aug 4 00:04:56 2004 Subject: OC-PM: meeting next week.. Message-ID: <00b001c2c715$9e8ee240$162b14ac@web.oit.ooweb.oakley.com> Greetings, Just a heads up regarding the next monger meeting scheduled for Tuesday, February 4th. So far, it looks like we're all going to go over our favorite data munging techniques as discussed during our last meeting. Everyone is free to participate, as we'll go around to anyone who wishes to impart any tid-bits of munging knowledge. A lot less presentational and a bit more free-for-all. For those of you who wish to up your involvement in the group, this will be a stellar chance. As for the website, we still haven't been able to shell into oc-pm's account for site updates, so we're currently awaiting response from the administrators... At any rate we look forward to seeing you next Tuesday ;) -Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/oc-pm/attachments/20030128/08975548/attachment.htm