Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Perl SourceCode and Update System

by Ace128 (Hermit)
on Aug 17, 2006 at 08:14 UTC ( [id://567850]=perlquestion: print w/replies, xml ) Need Help??

Ace128 has asked for the wisdom of the Perl Monks concerning the following question:

Hey enlightened monks!

As always, I try to explore about something before I start doing it from scratch myself to avoid "reinventing the wheel". I have checked cpan abit for modules that could help me out but I couldnt find anything that does exaclty that I wanna do (guess there is nothing out yet).

Basicly, I wanted to create an easy update system that deals with perl code (scripts). Kinda like Subversion, but not as complicated, and not dealing with parts of code, but more of full functions (although yes, this depends on how the user adding works with this, but its assumed not parts are added but fully functional functions :) ).

The idea is that this "repository" (probably a mysql db) has perl "plugins" that will be updated now and then. Ofcource, users are supposed to be able of adding stuff later aswell, but that's a later problem. A Plugin may look like this:
package mp3Plugin; use MP3::Tag; use File::Basename; use strict; use warnings; ... .. # @Description: Blablabla # @Version 0.8 sub DO_SOMETHING_WHATEVER { my $self = shift; ... } # @Description: Blablabla # @Requires mp3Plugin.DO_SOMETHING_WHATEVER Version 0.8 # @Version 0.8 sub DO_SOMETHING_ELSE_WHATEVER { my $self = shift; ... } return "mp3Plugin"; __END__
Now, since I'm trying to put myself in the users seat, as the update is supposed to be quite flawless for the user. I just do some other perl tool to do the update itself. But, I was also hoping to make it possible for users to even pick surtain functions, and "add" them to current version of same plugin. That is, say someone just want a particular function (or browse what there exists), that should be possible. Natrually, if something is required that is mentioned and "imported" aswell. Here it would be nice with a trusty merger module. :) And since I'm dealing with full functions, I don't really need to do much diffs of parts of code. More replaceing functions... What could be the best module for this?
So far I just did this simple basic script that takes perl code and extracts all subs (name, content, and comment above)
while ($text =~ /(#+(?:.|\s)+?)sub +([\w\s]+) +\{((.|\s)+)/) { ... } # + :)
but I guess I would prefer a module for this.
As a sidenote, I was also looking for some way to maybe extend POD or something as I wanna be able of adding what functions require surtain things (like other functions or even other scripts). And to be able of easly and dynamicly create documentation of all this information. (Check the examplecode with @ infront inside the comments)

Hope it's all clear what I'm trying to do here... :)

Ideas? Suggestions?

Thanks,
Ace

Replies are listed 'Best First'.
Re: Perl SourceCode and Update System
by cdarke (Prior) on Aug 17, 2006 at 11:53 UTC
    If I understand you correctly then you should be writing perl modules rather than scripts. If these are written to a reasonable standard they can be reused across projects, exporting subroutine names if necessary, or using OO techniques. The installation should handle dependancies.
    The repository can just be a file directory, a bit like your own mini-CPAN.
Re: Perl SourceCode and Update System
by Anonymous Monk on Aug 17, 2006 at 10:31 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://567850]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-20 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found