[24551] in Perl-Users-Digest
Perl-Users Digest, Issue: 6729 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 25 11:05:44 2004
Date: Fri, 25 Jun 2004 08:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 25 Jun 2004 Volume: 10 Number: 6729
Today's topics:
Cron-like module <Shamrock@psych.uw.edu.pl>
Re: Cron-like module <tadmc@augustmail.com>
Re: Cron-like module <mritty@gmail.com>
Re: Cron-like module <Shamrock@psych.uw.edu.pl>
Re: error logs... <ebohlman@omsdev.com>
Re: error logs... nobull@mail.com
Net::FTP problems getting files from Windows FTP server (D. Buck)
Re: Net::FTP problems getting files from Windows FTP se <kalinaubears@iinet.net.au>
password change <Patrick@nospam.nl>
Re: password change <thepoet_nospam@arcor.de>
Regexp for ls -l listing <david@tvis.co.uk>
Re: Regexp for ls -l listing <bik.mido@tiscalinet.it>
Re: Regexp, Strings and spaces (J. Romano)
Splitting a file (Gianni)
Textual inclusion of files into a script. <this.is@invalid>
Re: Trim Multiple Dirs to Max Total Space Used - by Dat <heiby_u@falkor.chi.il.us>
Re: Trim Multiple Dirs to Max Total Space Used - by Dat <bik.mido@tiscalinet.it>
Re: Trying to write my first Regex's <daedalus@videotron.ca>
Re: Using Perl to create user accounts on Windows 2003 (Daniel Berger)
Re: Using Perl to create user accounts on Windows 2003 <ThomasKratz@REMOVEwebCAPS.de>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 25 Jun 2004 10:57:44 +0000 (UTC)
From: Sebastian =?iso-8859-2?Q?Tymk=F3w?= <Shamrock@psych.uw.edu.pl>
Subject: Cron-like module
Message-Id: <slrncdo1en.8s4.Shamrock@engram.psych.uw.edu.pl>
Hi,
I'm looking for some perl module which will
work like cron. I want to daemonize my script and
run some command periodicly( one at A time and the
other at B time)
--
Shamrock
------------------------------
Date: Fri, 25 Jun 2004 07:22:01 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Cron-like module
Message-Id: <slrncdo679.alt.tadmc@magna.augustmail.com>
Sebastian Tymków <Shamrock@psych.uw.edu.pl> wrote:
> I'm looking for some perl module
http://search.cpan.org
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 25 Jun 2004 08:28:42 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: Cron-like module
Message-Id: <20040625082717.L23512@dishwasher.cs.rpi.edu>
On Fri, 25 Jun 2004, Sebastian [iso-8859-2] Tymk=F3w wrote:
> I'm looking for some perl module which will
> work like cron. I want to daemonize my script and
> run some command periodicly( one at A time and the
> other at B time)
When you say you're 'looking', are you actually looking, or are you just
asking the world to look for you?
Where have you looked so far, I'm curious?
The place to look for perl modules is CPAN - visit http://search.cpan.org
A search for 'cron' returns a heck of a lot of responses. Have you seen
them yet?
Paul Lalli
------------------------------
Date: Fri, 25 Jun 2004 13:32:39 +0000 (UTC)
From: Sebastian =?iso-8859-2?Q?Tymk=F3w?= <Shamrock@psych.uw.edu.pl>
Subject: Re: Cron-like module
Message-Id: <slrncdoagb.2u9.Shamrock@engram.psych.uw.edu.pl>
W artykule <20040625082717.L23512@dishwasher.cs.rpi.edu> Paul Lalli napisał(a):
> On Fri, 25 Jun 2004, Sebastian [iso-8859-2] Tymk?w wrote:
>
>> I'm looking for some perl module which will
>> work like cron. I want to daemonize my script and
>> run some command periodicly( one at A time and the
>> other at B time)
>
> When you say you're 'looking', are you actually looking, or are you just
> asking the world to look for you?
>
> Where have you looked so far, I'm curious?
>
> The place to look for perl modules is CPAN - visit http://search.cpan.org
>
> A search for 'cron' returns a heck of a lot of responses. Have you seen
> them yet?
Ok, my mistake. I'm curious what do you recommend. I know that I should use
http://search.cpan.org but I'm curious if anybody use something similiar.
--
Shamrock
------------------------------
Date: 25 Jun 2004 11:25:51 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: error logs...
Message-Id: <Xns9513421EE1957ebohlmanomsdevcom@130.133.1.4>
"John ©" <johnjcarbone@nospam.hotmail.com> wrote in
news:rxKCc.4476$L8.3152@nwrdny02.gnilink.net:
> I had already received 'snide' comments from a guy in the
> comp.lang.perl
> group ... I was supposed to realize that that newsgroup was defunct.
> That there were FAQ's, that there were guidelines. That because I was
> a newbie I was lazy. He even got on my case for typing PERL instead of
> Perl, among other things... and that was the first time I had ever
> posted.
Usenet newsgroups (and for that matter, Usenet itself) have characteristics
that meet many of the anthropological criteria for cultures. When visiting
a foreign culture, it is normally considered necessary to make at least
some effort to familiarize oneself with it. For example, an American who
visits England and is surprised, or worse, indignant to find out that
people drive on the left side of the road hasn't put in that effort. There
is a stereotype that says that most Americans behave that way (we mostly
don't but the squeaky wheel gets the grease) and in fact it has a name: the
"ugly American." You're showing some signs of it.
------------------------------
Date: 25 Jun 2004 05:52:17 -0700
From: nobull@mail.com
Subject: Re: error logs...
Message-Id: <4dafc536.0406250452.18bbc62d@posting.google.com>
"John ©" <johnjcarbone@nospam.hotmail.com> wrote in message news:<04GCc.4775$A9.1422@nwrdny01.gnilink.net>...
> >Read the FAQ.... oh wait, I'm not allowed to be snide... okay then, read
> >this:
>
> >http://www.perldoc.com/perl5.8.4/pod/perlfaq9.html#My-CGI-script-runs-from-
> the-command-line-but-not-the->browser.--(500-Server-Error)
> The comments were aimed at people like this one guy who was like "You're a
> newbie, you're lazy,
That's "like" in the sense that if you rearrange my words you can make
up that sentence.
What I actually said was that experience has shown us that people who
use the word "newbie" in their _subject_ lines usually turn out to be
people who are also being lazy. This is true. I didn't make it true,
I just observed it to be true so there's no point you getting upset at
me about it.
I advised you, therefore, that you should avoid using the word
'newbie' in your subject lines if you didn't want people to start
reading your posts with a negative predisposition.
> ...go read the FAQ.
Yes, I advised you to go read the FAQ. You think this was not
helpfull advice? Actually, you should have been given the advice
"Before you post a question, look for a FAQ" by whomever gave you
Usenet access. If they didn't give you this advice then you should
complain to them and noone else.
> You should know not to post this way, and to post that way."
Yes, appart from not checking the FAQ, you did some other things that
are also considered rude in the environment of a technical Usenet
group. I pointed these out to you so that you could avoid them in
future. You think this was not helpfull advice?
> Just a bunch of rudeness
When you stumble into a new cultural environment and start interacting
without standing on the sidelines for a moment to observe the local
social customs this is rude (and not just in cyberspace). When
someone points out that you've just broken the local customs this is
not, in itself, rude it is an attempt to help. When you are the
1000th person, the person trying to help you is likely to be terse and
have a somewhat exasperated tone. Try to realise that you are the
1000th person and that the tersity and exasparation are consequences
of this fact and you should not interpret them as "being rude". If
you insist on regarding them as "being rude" then you should also
remember that you were rude first.
> without any substance.
I actually offered to do a detailed line-by-line criteque of your
script which, had it actually been your script, would probably have
helped your Perl programming a lot. This was a very substancial
offer.
But, as I suspected, the script in question was not one you'd wrote
but one you'd picked up somewhere. Like I said, a critique of such a
script would not have helped you.
> No links to where things are, just total unhelpfulness.
The whole point about a FAQ is that you consult it first before you
ask a question. If "where's the FAQ" is a legitimate question the
this defeats the point of there being a FAQ. FAQs have to be easy to
find.
> If he's that upset, then just don't respond to me.
Just because I didn't spoon-feed you didn't mean I was upset. I
treated you like an adult who'd made a social gaff a would probably
want to avoid repeating it. The "just don't respond" approach doesn't
work. Not only would you not be helped but also it would mean that
people who did take the time the lurk on the sidelines in order to
figure out what was accepted behaviour would think that what you did
was OK.
------------------------------
Date: 25 Jun 2004 05:18:23 -0700
From: triumpht5@yahoo.com (D. Buck)
Subject: Net::FTP problems getting files from Windows FTP server, but not Linux FTP Server.
Message-Id: <f433d5cf.0406250418.4dd344e8@posting.google.com>
I have a perl script (I didn't write) running on HP-UX that gets .zip
files from a Linux ftp server. It downloads the files and unzips
them. Every thing works fine. My problem is if I try to use the same
script on the same HP-UX box but try to get the (same) files from a
Windows ftp server. The files download fine, but when it tries to
unzip them, I get the following:
--------------
error [20040623064641.zip]: missing 273 bytes in zipfile
(attempting to process anyway)
error [20040623064641.zip]: attempt to seek before beginning of
zipfile
(please check that you have transferred or created the zipfile in
the
appropriate BINARY mode and that you have compiled UnZip properly)
(attempting to re-compensate)
/test/test20040623064641/0292409005.TIF bad CRC e1458190 (should be
71c1779c)
file #2: bad zipfile offset (local header sig): 57546
(attempting to re-compensate)
file #2: bad zipfile offset (local header sig): 57546
file #3: bad zipfile offset (local header sig): 119940
file #4: bad zipfile offset (local header sig): 170821
.
.
.
--------------
and so on....
It is looking like it isn't successfully seting the mode to binary.
Here is a part of the script that handles this:
--------------
my ($binaryflag) = 1;
if ($binaryflag)
{
if ($ftp->type("binary"))
{
title_logger("DEBUG","non zero return from type");
}else
{
title_logger("DEBUG","zero return from type");
}
}
--------------
The output of the title_logger sub routine is: DEBUG : zero return
from type
Any ideas why it isn't getting set to binary? Any thoughts on how to
ensure it is set to binary?
Thanks for any help you can give me.
T.
p8oust7eh+
------------------------------
Date: Fri, 25 Jun 2004 23:05:24 +1000
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: Net::FTP problems getting files from Windows FTP server, but not Linux FTP Server.
Message-Id: <40dc244c$0$24771$5a62ac22@per-qv1-newsreader-01.iinet.net.au>
D. Buck wrote:
> I have a perl script (I didn't write) running on HP-UX that gets .zip
> files from a Linux ftp server. It downloads the files and unzips
> them. Every thing works fine. My problem is if I try to use the same
> script on the same HP-UX box but try to get the (same) files from a
> Windows ftp server. The files download fine, but when it tries to
> unzip them, I get the following:
> --------------
> error [20040623064641.zip]: missing 273 bytes in zipfile
> (attempting to process anyway)
> error [20040623064641.zip]: attempt to seek before beginning of
> zipfile
> (please check that you have transferred or created the zipfile in
> the
> appropriate BINARY mode and that you have compiled UnZip properly)
> (attempting to re-compensate)
> /test/test20040623064641/0292409005.TIF bad CRC e1458190 (should be
> 71c1779c)
> file #2: bad zipfile offset (local header sig): 57546
> (attempting to re-compensate)
> file #2: bad zipfile offset (local header sig): 57546
> file #3: bad zipfile offset (local header sig): 119940
> file #4: bad zipfile offset (local header sig): 170821
> .
> .
> .
> --------------
> and so on....
>
> It is looking like it isn't successfully seting the mode to binary.
> Here is a part of the script that handles this:
> --------------
> my ($binaryflag) = 1;
>
> if ($binaryflag)
> {
> if ($ftp->type("binary"))
> {
> title_logger("DEBUG","non zero return from type");
> }else
> {
> title_logger("DEBUG","zero return from type");
> }
> }
> --------------
>
> The output of the title_logger sub routine is: DEBUG : zero return
> from type
>
> Any ideas why it isn't getting set to binary? Any thoughts on how to
> ensure it is set to binary?
>
> Thanks for any help you can give me.
To specify binary mode I use:
$ftp->binary();
This works fine for me for transferring files from my Windows FTP server
to my Linux box.
Hope the solution is _that_ simple :-)
Cheers,
Rob
--
To reply by email u have to take out the u in kalinaubears.
------------------------------
Date: Fri, 25 Jun 2004 15:17:58 +0200
From: Patrick <Patrick@nospam.nl>
Subject: password change
Message-Id: <ea9od0pfgkok2ba5kj6brqd29dtfpnoe7h@4ax.com>
Hi,
On unix system is it possibble to change the password of a user from a
var?
like:
system("passwd $user");
print("$password\n");
print("$password\n");
But this doesnt work. Passwd is waiting for a input.
It's hpux so --stdin doesnt work also.
Reg. Patrick
------------------------------
Date: Fri, 25 Jun 2004 15:33:35 +0200
From: Christian Winter <thepoet_nospam@arcor.de>
Subject: Re: password change
Message-Id: <40dc29b0$0$25278$9b4e6d93@newsread2.arcor-online.net>
Patrick schrieb:
> On unix system is it possibble to change the password of a user from a
> var?
>
> like:
>
> system("passwd $user");
> print("$password\n");
> print("$password\n");
>
> But this doesnt work. Passwd is waiting for a input.
This can't work at all. First, system() waits for the command
to finish before perl goes on with the code. Second, if you want
to print to STDIN of an external program, you have to open it
in pipe mode, like
open( PASSWD, "| /usr/bin/passwd $user" ) or die $!;
print PASSWD "$password\n";
...
close PASSWD;
But it is like (don't know how the tools on hpux behave) that
passwd doesn't accept its input from a pipe. Then you might
want to have a look at the Expect module (perldoc Expect).
HTH
-Christian
------------------------------
Date: Fri, 25 Jun 2004 13:35:45 +0100
From: zzapper <david@tvis.co.uk>
Subject: Regexp for ls -l listing
Message-Id: <ga6od0topqqf6rur1o0hbcvvr034oblk58@4ax.com>
Hi Y'All
Any one got a cute Regexp for parsing a ls -l listing
I thought of this
$_=qq|-rwxrwxrwx+ 1 davidr None 186 Mar 3 16:36 Application.cfm|;
@res2=split /\s+/;
print "\nsize = $res2[4] : \n";
zzapper (vim, cygwin, wiki & zsh)
--
vim -c ":%s.^.CyrnfrTfcbafbeROenzSZbbyranne.|:%s/[R-T]/ /Ig|:normal ggVGg?"
http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips
------------------------------
Date: Fri, 25 Jun 2004 16:50:38 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Regexp for ls -l listing
Message-Id: <ioeod0hk93f4q483g4akeqb1h56elvrf8h@4ax.com>
On Fri, 25 Jun 2004 13:35:45 +0100, zzapper <david@tvis.co.uk> wrote:
>Any one got a cute Regexp for parsing a ls -l listing
>
>I thought of this
>
>$_=qq|-rwxrwxrwx+ 1 davidr None 186 Mar 3 16:36 Application.cfm|;
Well, the question is: do you *really* need it? I mean, it may well be
that you've been given the output of ls -l and you *have* to parse it.
But isn't it, by any chance, that you're trying to use an external ls
-l whereas you'd better resort to stat() instead?!? (Possibly in the
form of simple -s)
>@res2=split /\s+/;
This is just as
@res2=split;
>print "\nsize = $res2[4] : \n";
Fine, but no need to create an intermediate variable:
print "\nsize = ", (split)[4], " : \n";
# ^^ ^^
Also, as a side note, do you *really* want those two \n's?
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: 25 Jun 2004 05:33:41 -0700
From: jl_post@hotmail.com (J. Romano)
Subject: Re: Regexp, Strings and spaces
Message-Id: <b893f5d4.0406250433.7d0e68d1@posting.google.com>
nospam@tomcat.ca.tc (Florent Carli) wrote in message news:<6d12cccb.0406240335.e7fceed@posting.google.com>...
>
> I think my specifications were bad.
I'm sorry, but did you even try out my code? It does exactly what
you want. I even tested it.
> The "line" can be as long as it wants with so many fields.
> It can be field1="test" field2=test2 field3="test 3"
> field4="testagain"
> and the next line could be
> field1="test 4" field2="test 5" field3=test_6 field4="test n°7"
It does exactly that. I even created a short script for you to run
to show you that it works. Here, try this:
#!/usr/bin/perl -w
use strict;
my @res; # results will be stored here
# Process the input lines (from the DATA section):
while (<DATA>)
{
while ( m/="([^"]*)"|=(\w*)/g )
{
push @res, $1 if defined $1;
push @res, $2 if defined $2;
}
}
# Print out the @res array to show the results:
foreach (my $i = 0; $i < @res; $i++)
{
print "\$res[$i] = \"$res[$i]\"\n";
}
__DATA__
# These are sample input lines:
field1="test" field2=test2 field3="test 3" field4="testagain"
field1="test 4" field2="test 5" field3=test_6 field4="test n°7"
field1=""
__END__
> What I need was to get value of field2 for any type of field2 I can
> get : "value with space", "valuewithoutspace", valuewithoutspace, or
> even empty or "".
> Any all cases, the value alone (without quotes) must go into $1 and $1
> only.
No, I think you are mistaken. The value alone (without quotes)
must go into the @res array, and not necessarily into $1. The match
will either temporarily be in $1 or $2, but regardless of which it
goes into, it WILL be placed into the @res array, which is what you
want.
> For now, the only regexp able to do this I have found is :
> field2=["]?((?<=["])[^"]*(?=["])|(?<!["])\S*(?!["]))
> But like I said, the software I use to parse is using a version of
> perl that does not support lookbehinds ...
Don't use look-behinds. They are not needed for your task. And
please test the code I gave you before saying that it doesn't do what
you want.
-- Jean-Luc
------------------------------
Date: 25 Jun 2004 05:39:02 -0700
From: pincopallo_it@yahoo.it (Gianni)
Subject: Splitting a file
Message-Id: <3c03ef0c.0406250439.535f6897@posting.google.com>
I have a file done like this
|
|
cat
dog
monkey
troll
|
|
silver
gold
|
|
rome
london
praha
|
| etc.............
how can I create a new file after the || ??
Thanks
Gianni
------------------------------
Date: Fri, 25 Jun 2004 16:31:08 +0200
From: ddtl <this.is@invalid>
Subject: Textual inclusion of files into a script.
Message-Id: <mmdod0tf19107j46af96dot9ls3sso6qmb@4ax.com>
Hello,
Is it possible to textually include external files into a perl script,
the way C/C++'s 'include FILE' does? I don't want to use
do/eval/use/require for that purpose, because using those imposes
additional requirements. For example, in order to use 'eval', additional
code to open and read the files is required, and private ('my') variables
from the 'eval'ed files are not accessible.
I just want to be able to split the original file into smaller
pieces and have them assembled back automatically by the compiler,
so that the semantics would be identical in both cases.
ddtl.
------------------------------
Date: Fri, 25 Jun 2004 12:32:10 GMT
From: Ron Heiby <heiby_u@falkor.chi.il.us>
Subject: Re: Trim Multiple Dirs to Max Total Space Used - by Date
Message-Id: <9o6od0p37sbnpt9hsuoakvv0hmgsfaq7pv@4ax.com>
Michele Dondi <bik.mido@tiscalinet.it> wrote:
Thanks! I'll be looking at this today. One thing is for sure, I'm learning some new (to
me) things about using Perl!
--
Ron.
------------------------------
Date: Fri, 25 Jun 2004 16:50:39 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Trim Multiple Dirs to Max Total Space Used - by Date
Message-Id: <47eod0tmon5eg989jci3mk6j6qgbgdmhf3@4ax.com>
On Fri, 25 Jun 2004 12:32:10 GMT, Ron Heiby <heiby_u@falkor.chi.il.us>
wrote:
>Michele Dondi <bik.mido@tiscalinet.it> wrote:
>Thanks! I'll be looking at this today. One thing is for sure, I'm learning some new (to
>me) things about using Perl!
Well, since I wrote the script in the first place, you may (modify it
suitably and) try it on a sample directory: please tell me if there's
anything wrong with it and ask for clarification...
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: Fri, 25 Jun 2004 08:42:14 -0400
From: "Daedalus" <daedalus@videotron.ca>
Subject: Re: Trying to write my first Regex's
Message-Id: <C2VCc.27749$uY3.628382@wagner.videotron.net>
> > Now my filter needs to allow digits and the # sign as well as letters
and
> > periods and spaces etc. Is there a way to better write these filters so
that
> > I can "define" what I consider allowable instead of filtering out what
is
> > bad? $name is allowed to have for instance /digits/letters/number
> > sign/period/spaces/ but does not HAVE to contain them, any other
charater
> > would be detected as bad.
> >
> > My end goal will be creating a web form that will be secsure by not
allowing
> > bad stuff.
>
>
> An admirable goal. Be sure to very carefully think through what you
> permit, as making a bad decision in your untainting regexp can leave
> security holes. Just the fact that Perl considers the data to be
> untainted does not mean it is secure -- that is up to your regexp. Perl
> helps you a lot by letting you know it is certain that you did pass the
> data through an untaining regexp.
>
It might be a good idea to make a more precise regexp when permitting
special caracter, specifying where it can be used in the string rather than
just permit it within a class.
DAE
------------------------------
Date: 25 Jun 2004 06:40:59 -0700
From: djberg96@hotmail.com (Daniel Berger)
Subject: Re: Using Perl to create user accounts on Windows 2003
Message-Id: <6e613a32.0406250540.6cace2dc@posting.google.com>
Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de> wrote in message news:<40d94a58$0$14527$bb690d87@news.main-rheiner.de>...
> Maynard wrote:
> > Hello all,
> >
> > I have Windows 2003 FTP servers that I store content on for external
> > users to pick up on a schedule. Unfortunately I have about 300 of
> > such users, and multiple servers. The time and energy to create these
> > user accounts is obviously a factor, especially if I have to rebuild a
> > box and have it up and running quickly.
> >
> > So, I went looking for Perl scripts / modules that could do this, but
> > all I came up with was some old (for NT4) ones that used
> > Win32::Lanman. I'm not creating domain (Active Directory) accounts,
> > just local ones on the box. I have the users in a comma-delimited
> > file, and really just need a shove in the right direction.
> >
> > Any suggestions would be most appreciated.
>
> What's wrong with Win32::Lanman? AFAIK it should work under W2k+3.
> Alternatively use Win32::OLE to do it via the WMI interface.
>
> Thomas
Can you provide a link for Win32::Lanman? It's not on CPAN, and I
couldn't seem to find it on roth.net. Is it part of a larger package
that I'm missing? Google had lots of references to it, but no place
to actually download it.
As for WMI, I don't think you can create user accounts with it. You
can only list them. Please correct me if I'm wrong.
Regards,
Dan
------------------------------
Date: Fri, 25 Jun 2004 16:38:21 +0200
From: Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de>
Subject: Re: Using Perl to create user accounts on Windows 2003
Message-Id: <40dc38de$0$14516$bb690d87@news.main-rheiner.de>
Daniel Berger wrote:
> Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de> wrote in message news:<40d94a58$0$14527$bb690d87@news.main-rheiner.de>...
>
>>Maynard wrote:
>>
>>>Hello all,
>>>
>>>I have Windows 2003 FTP servers that I store content on for external
>>>users to pick up on a schedule. Unfortunately I have about 300 of
>>>such users, and multiple servers. The time and energy to create these
>>>user accounts is obviously a factor, especially if I have to rebuild a
>>>box and have it up and running quickly.
>>>
>>>So, I went looking for Perl scripts / modules that could do this, but
>>>all I came up with was some old (for NT4) ones that used
>>>Win32::Lanman. I'm not creating domain (Active Directory) accounts,
>>>just local ones on the box. I have the users in a comma-delimited
>>>file, and really just need a shove in the right direction.
>>>
>>>Any suggestions would be most appreciated.
>>
>>What's wrong with Win32::Lanman? AFAIK it should work under W2k+3.
>>Alternatively use Win32::OLE to do it via the WMI interface.
>>
>>Thomas
>
>
> Can you provide a link for Win32::Lanman? It's not on CPAN, and I
> couldn't seem to find it on roth.net. Is it part of a larger package
> that I'm missing? Google had lots of references to it, but no place
> to actually download it.
It's on CPAN, but doesn't follow the usual naming conventions und I think
this prevents search.cpan.org from finding it. Look in:
http://cpan.org/modules/by-authors/id/J/JH/JHELBERG/
or
http://cpan.org/modules/by-module/Win32/
the filename is 'lanman.1.0.10.0.zip'
It includes the source without supporting the standard procedure ( perl
makefile.pl, make, make test, make install), but I could compile it easily
with MSV6. There are even compiled versions with a ppd file included.
>
> As for WMI, I don't think you can create user accounts with it. You
> can only list them. Please correct me if I'm wrong.
You are right, I suppose. You can do it with ADSI though. Look at
http://www.microsoft.com/technet/community/scriptcenter/user/default.mspx
The VB syntax is easily translatable to Perl and Win32::OLE.
Thomas
--
open STDIN,"<&DATA";$=+=14;$%=50;while($_=(seek( #J~.> a>n~>>e~.......>r.
STDIN,$:*$=+$,+$%,0),getc)){/\./&&last;/\w| /&&( #.u.t.^..oP..r.>h>a~.e..
print,$_=$~);/~/&&++$:;/\^/&&--$:;/>/&&++$,;/</ #.>s^~h<t< ..~. ...c.^..
&&--$,;$:%=4;$,%=23;$~=$_;++$i==1?++$,:_;}__END__#....>>e>r^..>l^...>k^..
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 6729
***************************************