# from Shlomi Fish # on Tuesday 05 August 2008 02:03: > Namely, I want a GUI tool to edit the tags and > categories of the CPAN distribution. So I need it to provide them as > input to Build.PL, while not analysing and modifying Build.PL itself > (which is close to impossible), and while being able to do sanity > checks on the tags+categories before it is released (so the distro's > publisher won't be screwed up)
A) Those are two things: 1. Edit tags. 2. Check before publishing. B) Neither really requires the META.in.yml scheme. If you're hoping for something for yourself, then it is perhaps okay to change "the way things are done" all at once. But if you want it to be easy for others to use with their existing code, you will probably have to make it "just work" with whatever data you find there. 1. Editing a certain bit of hash in clean Perl is not that hard -- plus, your use-case is defined as "there is a user at the console", so you can ask/tell them what to do if the parsing fails (bonus: it is also probably their fault that the code is not easily parsable.) 2. Checking tags before publishing should be examining the generated META.yml anyway. So, assuming that your parser only handles a really simple case of '->new(', just output some sentinels around the data you get to eval/smash and always look for those first in a first pass -- if your parse fails you just ask the user to please add the sentinels for you and try again. # begin auto-edited data {{{ # }}} end auto-edited data So, go forth and write your program and trust that you can deal with the ugly bits by just calling them ugly. Aside: I happen to think that it would be a great and beautiful thing to have the entire module creation process driven by something declarative -- like ant, but without falling into their trap of doing *everything* so horridly wrong. >> I've probably had 2-3 episodes of hacking together some >> shell and perl translations to my Build.PL files (of which there are >> 60+ in my checkouts dir atm.) > >WDYM by "Shell and Perl translations"? for $(ls */Build.PL); do perl -i -pe 's/blahblahblah/thbbt/g'; done ... but usually with more complicated perl bits, some intermediate steps, as well as a pile of checks and svn commands before and after. Always with one weird edge case that ends up getting edited by hand. Maybe there is a word for that. --Eric -- I arise in the morning torn between a desire to improve the world and a desire to enjoy the world. This makes it hard to plan the day. --E.B. White --------------------------------------------------- http://scratchcomputing.com ---------------------------------------------------