Hooray! I now have a PAUSE ID and will soon be a CPAN author (if all testing goes well).
The first module Iââ¬â¢m putting up is a Win32 IIS admin module. When I worked in Student Activities at Texas A&M University, I maintained the servers that supported the student organization web accounts. The servers were Windows 2000 & 2003 (IIS 5 & IIS 6, respectively). The ââ¬Ëoldââ¬â¢ way of creating new organization accounts was manual and involved a lot of clicking and typing. I developed a script that would do most of the work for me. I had a little bit of trouble finding information about how to create ââ¬Ësitesââ¬â¢ and ââ¬Ëvirtual sitesââ¬â¢ in IIS with Perl. I was finally able to use Win32::OLE
to do what I needed.
Someone already uploaded a Win32::IIS::Admin
module to the CPAN, but it uses cscript (I have no experience with it). Iââ¬â¢m trying to think of a different namespace for mine, and I thought about Win32::IIS::Server
. Would that make enough sense for someone? Hereââ¬â¢s a sample of how to use it:
use Win32::IIS::Server; ... my $server = Win32::IIS::Server->new( name => 'www.myserver.com' ); # create new site my $siteIndex = $server->createSite( site => $site, # test1.myserver.com name => $name, # Test folder => $folder, # e:\test1\www ); # create new ftp account $server->createFTP( name => $name, # Test folder => $folder, # e:\test1\www ); #create new virtual site $server->createVirtual( name => $name, # test folder => $folder, # e:\test_virtual\www );
Feel free to offer any thoughts about a different namespace. Iââ¬â¢m sure Iââ¬â¢ll have some kinks to work out to actually getting the module on the CPAN. Iââ¬â¢ve only written modules for myself or work (which had no testing, not much portability, and was a crap shoot on documentation), so getting the module ready for the CPAN will be a new (and thorough) experience. Iââ¬â¢ve started incorporating testing into most of my new code, so hopefully Iââ¬â¢ll get this right.
Re:Ah, that's you...
jfluhmann on 2006-08-23T18:54:36
Thanks. I'll probably go with
::Setup then. My hope is to also allow the changing of current configurations on a site or virtual site, but I'm not yet familiar enough with all possible configuration options. I'll be doing a little more research and work on it before I upload. Thanks!
Re:Method naming
Alias on 2006-08-14T06:44:39
But I'll add I disagree with "do it as a script".
Most scripts should ideally just be a wrapper around some module that does the real work. Thing of the script as more of a console interface to some functionality.
It should handle launching and command line params and output, but do the work in the module.
And the module should never assume console environment,.Re:Method naming
jfluhmann on 2006-08-23T18:57:53
Thanks for the encouragement of going with a module rather than a script. I was tossing the idea back and forth in my head for a while. I'll definitely go with doing it as a module now.
Re:Method naming
jfluhmann on 2006-08-23T19:00:04
Thanks. I'll make sure and go for the "Perlish" method style.
I'll more than likely go with
::Setup now instead of ::Server. I want to allow the module to change current configurations, but I'm not familiar enough with all of the configuration options that are available. I'll do some more research on that part. Re:Method naming
Aristotle on 2006-08-24T12:53:00
Check perlstyle. It’s not gospel, and there’s also Perl Best Practices (which you can’t read online), but it should give you a feel for what Perl code culturally looks like. You are free to deviate from that, of course, but make sure you have reason to. Also, the more visible the deviation (and method names are about as visible as you can get), the better the reason should be.
Re:Method naming
jfluhmann on 2006-08-24T13:43:04
Thanks for the link! I convinced my department to buy a copy of PBP about a month or so ago. I haven't gotten too far in it yet, but I've been reading through it off and on. I appreciate your help!
Re:Method naming
Aristotle on 2006-08-24T23:38:07
Just to be sure, in case you don’t know the site I linked – perldoc.perl.org is an online version of the docs that come with Perl. You can read the same thing by running
perldoc perlstyle
on your machine. See alsoperldoc perltoc
.(To be honest, though, these days I use the site much more than the local docs. Browser interfaces with real links are so much nicer, and the pervasively linked, syntax highlighted code snippets on the site are lightyears beyond
perldoc
on a console. Just noting that this isn’t just some site, but is a browsable version of the official Perl reference documentation.)