Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the App-p CPAN distribution.

Report information
The Basics
Id: 79648
Status: open
Priority: 0/
Queue: App-p

People
Owner: Nobody in particular
Requestors: joerg.meltzer [...] tngtech.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Integrate Data::DPath to App::p
p is a cool tool to extract and transform data with minimum typing effort. What is missing is a way to filter data. I suggest to add Data::DPath support in p Here is an example. p ' dd ((xl r "/etc/xml/xml-core.xml") ~~ dpath "//catalog" )' And a patch to make it happen. --- /usr/bin/p 2012-09-14 16:34:41.296875000 +0200 +++ /usr/local/bin/p 2012-09-14 16:50:17.125000000 +0200 @@ -10,6 +10,7 @@ exec 'perl', '-Mwarnings', + '-MData::DPath=dpath', '-MClass::Autouse=:superloader', '-MData::Dump', '-MFile::Slurp', @@ -77,6 +78,7 @@ p 'dd ExtUtils::Installed->new->modules' # list all installed modules p ' dd xl r "/etc/xml/xml-core.xml"' # print dump of hash converted xml p 'p xd xl r "/etc/xml/xml-core.xml"' # print xml converted from hash + p 'dd [{foo=>1},0,2] ~~ dpath "//foo"' # print Data::DPath extract //foo p 'p get "http://icanhazip.com"' # print contents of url =head1 AUTHOR
On Fri Sep 14 10:56:04 2012, codeacrobat wrote: Show quoted text
> p is a cool tool to extract and transform data with minimum typing > effort. What is missing is a way to filter data. > I suggest to add Data::DPath support in p > > Here is an example. > p ' dd ((xl r "/etc/xml/xml-core.xml") ~~ dpath "//catalog" )' > > And a patch to make it happen. > > --- /usr/bin/p 2012-09-14 16:34:41.296875000 +0200 > +++ /usr/local/bin/p 2012-09-14 16:50:17.125000000 +0200 > @@ -10,6 +10,7 @@ > exec > 'perl', > '-Mwarnings', > + '-MData::DPath=dpath', > '-MClass::Autouse=:superloader', > '-MData::Dump', > '-MFile::Slurp', > @@ -77,6 +78,7 @@ > p 'dd ExtUtils::Installed->new->modules' # list all installed
modules Show quoted text
> p ' dd xl r "/etc/xml/xml-core.xml"' # print dump of hash > converted xml > p 'p xd xl r "/etc/xml/xml-core.xml"' # print xml converted
from Show quoted text
> hash > + p 'dd [{foo=>1},0,2] ~~ dpath "//foo"' # print Data::DPath > extract //foo > p 'p get "http://icanhazip.com"' # print contents of url > > =head1 AUTHOR >
Thanks! Any chance you could create a ticket (or pull request) for this in github https://github.com/ironcamel/App-p ? -Naveed