Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jfluhmann (6902)

jfluhmann
  reversethis-{moc.liamg} {ta} {nnamhulf}
http://sanangelo.pm.org/
AOL IM: campfluhmann (Add Buddy, Send Message)
Yahoo! ID: jfluhmann (Add User, Send Message)
Public Calendar: Subscribe, Download

I work for Angelo State University as somewhat of a Windows server administrator. I am the founding member of the San Angelo Perl Mongers. I'm fairly new to the Perl Community at large.

I can be found on irc in #yapc, #news, and #win32. I'm trying to help out with the win32.perl.org project. I've recently acquired a PAUSE ID and might have a module or two on the CPAN (by the time you read this). http://search.cpan.org/~jfluhmann/ [cpan.org]

I am also one of the organizers for YAPC::NA 2007.
http://www.yapc.org/America [yapc.org]

Journal of jfluhmann (6902)

Friday August 11, 2006
03:59 PM

CPAN Authorship

[ #30606 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I think I must have overheard you talking about it on Perlmonks.

    My first question is: why a module? From your description in plain English, it looks like it's basically the functionality for a script. Anyway.

    Second: I don't like the name. IIS is a webserver. Naming it Win32::IIS::Server is saying roughly the same thing twice.

    I propose Win32::IIS::Setup, as it is apparently devised to set up sites on IIS. "Config" might at first sight appear to mean the same thing, but then, I'd expect it to be able to chang
    • 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!

  • I'd note that you should probably be using Perl style method naming.

    ->create_site instead of ->createSite

    I used to have a similar disease, and it wasn't until about a year after I was releasing things regularly that I ended up wishing I'd done things the Perl way in the first place :(

    So use a "Perlish" method style. Trust me, you'll regret it if you don't later.

    Oh, and I also like Win32::IIS::Setup better than ::Server as well.
    • 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,.
      • 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.

    • 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.

      • Check perlstyle [perl.org]. 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.

        • 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!

          • Just to be sure, in case you don’t know the site I linked – perldoc.perl.org [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 also perldoc 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