in reply to Re^3: Operator overloading with returning lists?
in thread Operator overloading with returning lists?
In @resultlist are all elements of $data which match the path '/AAA/BBB/*/CCC'. Due to its "matching nature" this could imho look more naturally when expressed with an overloaded '~~' (and maybe some prototype "dpath($)"), like this:$data = ...# some Perl data structure @resultlist = dpath('/AAA/BBB/*/CCC')->match($data);
$data = ...# some Perl data structure @resultlist = $data ~~ dpath '/AAA/BBB/*/CCC';
That's what I want to do.
The dpath() function returns an object of a class to which I hoped to bind the overloading.
Thanks,
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Operator overloading with returning lists?
by ikegami (Patriarch) on Dec 02, 2008 at 14:34 UTC | |
by renormalist (Sexton) on Dec 04, 2008 at 20:15 UTC |