in reply to Templates for Perl Programs and Perl Modules

Nice and useful idea, but it doesn't run under ActiveState Perl 5.6.1 build 633 (Windows NT). It reports the following error:

Uncaught exception from user code: POSIX::cuserid not implemented on this architecture at ./perl_template.pl line 11.
Thought you might want to know this, -gjb-

Replies are listed 'Best First'.
Windows Fix for Templates for Perl Programs and Perl Modules
by toma (Vicar) on Jan 21, 2003 at 16:47 UTC
    I'll fix this today when I get access to a Windows box. Meanwhile, if you want to try the program, you can just hardcode the value of $author by changing:
    my $userid= POSIX::cuserid(); my $author = (getpwnam($userid))[6];
    to
    my $author = "Your Name Here";

    The trick for getting the 'real name' of a user on unix uses the user id with cuserid() and the corresponding entry in /etc/passwd with getpwnam(). It will be interesting to figure out how to get this information from a Windows box.

    Thanks!

    It should work perfectly the first time! - toma