[Pdx-pm] module recommendation: regex over data structure

Josh Heumann pdx.pm at joshheumann.com
Fri Jun 14 23:06:54 PDT 2013


Data::Dumper is truly interesting, and might be worth it if it's as elegant
a solution as it sounds like it might be, since there won't be any blessed
objects to worry about.

Data::Visitor::Callback is an idea that merits a little work; the docs
aren't the clearest, but this might work.

Using YAML/JSON isn't a bad idea, but I'm worried about the performance hit.

I'll try these in order and report back.

J


On Fri, Jun 14, 2013 at 7:31 PM, benh <ben.hengst at gmail.com> wrote:

> Another idea that I just though of would be to serialize to something
> like YAML or JSON and then regex and then expand again. Though I am
> not sure about the performance issues, would need testing.
>
> On Fri, Jun 14, 2013 at 6:08 PM,  <joshua at keroes.com> wrote:
> > https://metacpan.org/module/Data::Visitor::Callback perhaps?
> >
> > On Jun 14, 2013, at 15:28, Josh Heumann <pdx.pm at joshheumann.com> wrote:
> >
> > Hey folks,
> >
> > I'm sure this is just me having a lapse of memory, but can anyone
> recommend
> > a module for running a regular expression over a large and
> > arbitrarily-nested data structure?
> > Ideally something like this:
> > # %data_structure is a hash containing hashrefs, arrayrefs, strings, but
> no
> > objects.%data_structure =~ s/foo/bar/g;
> > ...would replace foo with bar in all strings at all levels.
> > J
> >
> > _______________________________________________
> > Pdx-pm-list mailing list
> > Pdx-pm-list at pm.org
> > http://mail.pm.org/mailman/listinfo/pdx-pm-list
> >
> >
> > _______________________________________________
> > Pdx-pm-list mailing list
> > Pdx-pm-list at pm.org
> > http://mail.pm.org/mailman/listinfo/pdx-pm-list
>
>
>
> --
> benh~
>
> http://about.notbenh.info
>
> Stability is not a Regression.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/pdx-pm-list/attachments/20130614/604f92b7/attachment-0001.html>


More information about the Pdx-pm-list mailing list