[21989] in Perl-Users-Digest
Perl-Users Digest, Issue: 4211 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 3 18:05:42 2002
Date: Tue, 3 Dec 2002 15:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 3 Dec 2002 Volume: 10 Number: 4211
Today's topics:
Re: a rather inefficient algorithm <bmetcalf@nortelnetworks.com>
Re: A regex 'whoa' <bart.lateur@pandora.be>
Re: Code segfaults on 5.8 but works on 5.6 <rgarciasuarez@free.fr>
Re: Code segfaults on 5.8 but works on 5.6 (Walter Roberson)
Re: Code segfaults on 5.8 but works on 5.6 <mgjv@tradingpost.com.au>
Re: Future of Perl as an application server language? <pkent77tea@yahoo.com.tea>
Re: how to get it quoted? btam01@ccsf.edu
Re: how to get it quoted? (Walter Roberson)
Re: how to get it quoted? <du_bing@hotmail.com>
how to: perl shell script to programaticaly submit a ht <decioquintas@sic.pt>
Re: hyphens in CGI parameters <pkent77tea@yahoo.com.tea>
Re: Kicking off commands on a remote machine <pkent77tea@yahoo.com.tea>
Re: mysql <bart.lateur@pandora.be>
netadmin and users <Bart.Geurs@pandora.be>
Re: netadmin and users (Walter Roberson)
Re: Perl Packages question (Tad McClellan)
Re: strange glob error (Scott Stark)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 Dec 2002 22:00:03 GMT
From: Brandon Metcalf <bmetcalf@nortelnetworks.com>
Subject: Re: a rather inefficient algorithm
Message-Id: <slrnauqa31.2fe.bmetcalf@cash.rhiamet.com>
djact@flactem.com writes:
|| I recently needed to pause for a certain amount of time. The
|| pertainent code I used is below. There has to be a better way to do
|| this. Ideas?
||
|| #!/usr/bin/perl -w
|| $finished=0; # define toggle var
|| $time1 = time; # set the start time
|| while ($finished==0) { # loop until found
|| $time2 = time; # set the current time
|| if ($time2-$time1 > 5) # if 5 seconds have passed...
|| { $finished=1; } # flip the toggle.
|| }
sleep()
Brandon
--
Why do some people always see beautiful skies and grass and lovely
flowers and incredible human beings, while others are hard-pressed
to find anything or any place that is beautiful?
--Leo Buscaglia
------------------------------
Date: Tue, 03 Dec 2002 22:30:38 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: A regex 'whoa'
Message-Id: <ttbquuoephbjevaeniq2g52k9lpk6i5pa8@4ax.com>
William Alexander Segraves wrote:
>Clarification:
>>Bart's substitution would render the regex inop,
>
>i.e., incorrect behavior,
Not quite... In my experience, people (i.e. me) tend to make their
regexes too strict. In such a case, it'll fail where you don't intend it
to fail. Relaxing the requirements a bit will always succeed in the same
way for those it succeeded for before, but OTOH, a more strict may fail
to match and then it'll only fail. Why? It doesn't say. Perhaps it
encountered a dot in a field where you only expected digits. Or perhaps
it's the tab. It doesn't say why. You have to figure it out, in a
difficult way. A strict regex is no help.
--
Bart.
------------------------------
Date: 03 Dec 2002 21:03:24 GMT
From: Rafael Garcia-Suarez <rgarciasuarez@free.fr>
Subject: Re: Code segfaults on 5.8 but works on 5.6
Message-Id: <slrnauq75r.fra.rgarciasuarez@rafael.example.com>
Wilbur Goltermann wrote in comp.lang.perl.misc :
> The following snippet of code regularly blows up with a segfault
> on perl 5.8, but works perfectly on perl 5.6.1:
>
> ***faulty snippet***
> #!/usr/bin/perl
> open TEXT, "TestSong.txt" || die "Unable to open lyrics text file";
> #Add the rest of the lines of the text file
> print "We seem to be opening the file\n";
>
> LYRIC:while ( $line = <TEXT> ) {
> #show the line before segfault occurs
> print "1: $line";
>
> #capitalize the first letter of each linethis ; line causes a segfault
> $line =~ s/^(\s*)(\w*)/$1\u$2/;
>
> #and show again, should we successfully; execute the offending line
> print "2: $line";
> }
Can you include what "perl -v" says ? I can't reproduce your problem.
You may want to use the perlbug utility to report this bug.
Does this shorter code segfault also :
$_ = ""; s/^(\s*)(\w*)/$1\u$2/;
> The whole thing works perfectly under 5.6.1, and even does the
> intended job. It appears that something is wrong with Perl
> 5.8; it doesn't matter what you feed an interpreter - if it
> is bug-free, it shouldn't seg fault under any circumstances.
Agreed.
------------------------------
Date: 3 Dec 2002 22:01:10 GMT
From: roberson@ibd.nrc.ca (Walter Roberson)
Subject: Re: Code segfaults on 5.8 but works on 5.6
Message-Id: <asj9j6$hg7$1@canopus.cc.umanitoba.ca>
In article <m25H9.14131$pN3.1341@sccrnsc03>,
Wilbur Goltermann <goltermann@attbi.com> wrote:
:The following snippet of code regularly blows up with a segfault
:on perl 5.8, but works perfectly on perl 5.6.1:
: #capitalize the first letter of each linethis ; line causes a segfault
: $line =~ s/^(\s*)(\w*)/$1\u$2/;
To nit-pick: that doesn't capitalize the first letter of each line,
that uppercases the first "word" character (alphanumeric plus "_")
that is immediately adjacent to the first whitespace. Consider
what happens if:
A) the first non-whitespace character is numeric;
B) the first non-whitespace character is underscore;
C) the first non-whitespace character is something else, such as a
hyphen or a parens
-- like this, or like
(c) 1982 Inquiring Minds Music
... or like this
D) the first non-whitespace character is accented or otherwise not
a member of the 52 English alphabetic characters. (You don't have
"use locale" in effect.)
Also, you have perl working a bit harder than is needed:
E) You never -do- anything with the characters after the first in the word.
So you can instead use $line =~ s/^(\s*)(\w)/$1\u$2/;
Note that the rest of the word is no longer captured (or changed)
F) If you are going to ignore the numeric/underscore issue then you
can simplify further to $line =~ s/^(\s*)(.)/$1\u$2/;
G) There are also approaches that could be taken using index(),
substr() and uc() that avoid pattern-match overhead.
Another tidbit: although it doesn't matter in this case, watch out for
having two * patterns in a row: if you have something else afterwards
in the pattern and it isn't present in the target string,
you can end up "backing up" the pattern match as it tries various
combinations of sizes of each * pattern under the assumption that it
has been too greedy and that that is why the next item isn't matching.
--
If a troll and a half can hook a reader and a half in a posting and a half,
how many readers can six trolls hook in six postings?
------------------------------
Date: Tue, 03 Dec 2002 22:22:06 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Code segfaults on 5.8 but works on 5.6
Message-Id: <slrnauqbns.5qc.mgjv@verbruggen.comdyn.com.au>
On Tue, 03 Dec 2002 16:34:26 GMT,
Wilbur Goltermann <goltermann@attbi.com> wrote:
> The following snippet of code regularly blows up with a segfault
> on perl 5.8, but works perfectly on perl 5.6.1:
What is your platform?
A segfault in perl (unless external libraries are loaded, maybe
through the use of a use statement) indicates either a corrupt
installation of perl, or a bug in perl for your particular platform.
If you're on a very common platform, the second possibility is
unlikely. If you're on a less common platform, the second possibility
is more likely. If you used non-default options when compiling perl,
that could also have triggered something.
In any case, it will be strongly dependent on your platform, and when
reporting segfaults like these, you should always include the output
of perl -V.
I'd report this with the perlbug utility (make sure to use the one
that belongs to your 5.8.0 installation), so that the p5p can have a
look at it, and see whether it can be reproduced. It is unlikely that
anyone here can help.
When you report the bug, try to include a selfcontained program that
displays the problem.
> ***faulty snippet***
> #!/usr/bin/perl
> open TEXT, "TestSong.txt" || die "Unable to open lyrics text file";
> #Add the rest of the lines of the text file
> print "We seem to be opening the file\n";
>
> LYRIC:while ( $line = <TEXT> ) {
> #show the line before segfault occurs
> print "1: $line";
>
> #capitalize the first letter of each linethis ; line causes a segfault
> $line =~ s/^(\s*)(\w*)/$1\u$2/;
>
> #and show again, should we successfully; execute the offending line
> print "2: $line";
> }
>
> ***end of faulty snippet****
When you report the bug, do it with something like:
#!/usr/bin/perl
$line = "Some line that causes the segfault";
$line =~ s/^(\s*)(\w*)/$1\u$2/;
Or even
#!/usr/bin/perl
$_ = "Some line that causes the segfault";
s/^(\s*)(\w*)/$1\u$2/;
If none of those segfault, try this:
#!/usr/bin/perl
while (<DATA>)
{
s/^(\s*)(\w*)/$1\u$2/;
}
__DATA__
Some line that causes the segfault
and keep adding until the segfault appears for the first time. It is
very well possible that the segfault doesn't appear until you try to
print something. Information like that is useful.
> Just to be sure we end up testing the same thing, here is the
> context of the file I used bor my test case, here it is:
We can't test the same thing, because we do not know how you compiled
your perl, and what platform you're on. The output of perl -V is
essential information. But you'd be wise to not post it here, use
perlbug to report it.
> Here's a version of the snippet which does not blow up.
>
> ***working snippet***
> #!/usr/bin/perl
> open TEXT, "TestSong.txt" || die "Unable to open lyrics text file";
> #Add the rest of the lines of the text file
> print "We seem to be opening the file\n";
>
> LYRIC:while ( $line = <TEXT> ) {
> #show the line before segfault occurs
> print "1: $line";
>
> #capitalize the first letter of each line
> #process the line only if non-blank
> if ( $line =! m/^$/ ) {
> $line =~ s/^(\s*)(\w*)/$1\u$2/;
> }
Looks like it "blows up" on empty lines then. Try just something like:
"\n" =~ s/^(\s*)(\w*)/$1\u$2/;
or
"" =~ s/^(\s*)(\w*)/$1\u$2/;
or one of those with an assignment to $line. When debugging, or
investigating bugs, it is important to try to determine exactly where
the problem is. Your example has a bit too much other stuff around the
problem areas to be certain about what could be the cause.
Martien
--
|
Martien Verbruggen | +++ Out of Cheese Error +++ Reinstall
Trading Post Australia | Universe and Reboot +++
|
------------------------------
Date: Tue, 03 Dec 2002 21:34:07 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Future of Perl as an application server language?
Message-Id: <pkent77tea-31181F.21340303122002@news-text.blueyonder.co.uk>
In article <3226c4d3.0212030947.556f7ed1@posting.google.com>,
simonf@simonf.com (Simon) wrote:
^^^^^^
Not the simonf from my very own office, I guess.
> I have recently went to the Software Development Conference/Expo in
> Boston and was faced with the fact that Java seems to be the language
> of choice for serious web applications.
Not where I'm from, it isn't. Having 2 friends who used to organize
conferences[1] I do think that the agenda and bias of any conference can
be significantly skewed. A major factor is just how much the organizer
cares, or how tired they are. Not that all conferences are, but always
take a pinch of salt with you.
> I am developing intranet applications in Perl, borrowing and writing
> code that slowly becomes an application server framework. I am sure
> lots of people do the same thing in Perl. However, I think the lack of
> standards is killing us.
Not where I'm from. To be fair, the phrases you use are not
well-defined[2] to me... I'd be interested in some concrete examples of
what you're doing and what problems you face.
I would love to hazard a guess that the problems you're finding as
systems grow and need to integrate are problems that would occur in any
programming language. They're problems at a high level of abstraction,
the language doesn't matter.
> However, Java folks don't reinvent
> database access modules, Model-View-Controller patterns or
> configuration file locations - this is pretty much settled, and they
> keep moving forward.
*snigger* _bad_ java programmers will put configuration files in stupid
places. Good ones won't. Repeat for every programming language under the
sun. A file location is a file location, a concept independent of any
programming language. Please don't imagine that using language A rather
than B will make people magically put files in the right place (I say
files to contrast with items inside, say, a .jar file)
There's only one database interface that you generally need, the perl
DBI. AFAIK some weird databases did, or do, have other modules, like
Sybase or Informix, but that could be ages ago, or down to fundamental
technical differences. Only a perl programmer with a lot of free time
would reimplement the Oracle interface, for example. So I would disagree
with your inplication that people keep writing DB modules.
I have no idea what MVC patterns are, though. If there are 14
implementations on CPAN we can probably construe that as excess coverage
of the problem domain :-)
> Do you know that coarse-grained session beans give you better
> performance than any kind of entity beans, even with caching? This is
<snip>
Well I'll snip all this as it deals with software engineering concepts
not specific to any programming language. The jargon may well be
specific to a certain language, but that's like saying:
"Python doesn't have hashes! It's crap! And perl doesn't have
associative arrays, so it's also crap! And C++ doesn't have dictionaries
so it's also crap!"
Analogy: you can easily[3] implement a hash in C, even though one isn't
built into the language definition. It's the concept of a hash that's
the important thing, not the language you implement it in. Ditto for
other high-level abstract concepts, all the way from lists up to
sessions.
> I am proud of using Perl, the "duct tape of the Internet" (tm). But
> how many real-world companies will start new projects with nothing but
> duct tape?
We Do! Except we use a programming language, not adhesive tape. It tends
to run through the tape heads better.
P
[1] Not computer-related ones, I should say
[2] We think of "application servers" as the actual boxes in the rack
that people run stuff on, for example
[3] Quite
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Tue, 3 Dec 2002 12:51:22 -0800
From: btam01@ccsf.edu
Subject: Re: how to get it quoted?
Message-Id: <Pine.HPX.4.44.0212031248550.18091-100000@hills.ccsf.cc.ca.us>
On 3 Dec 2002, Walter Roberson wrote:
> :open(MAIL,"|mailx -s 'for test' c24b18d4bb4afdf052330678af9a601d+sent
> :mail\@neo.tamu.edu") does not work.
open(MAIL,"| mailx -s 'for test' c24b18d4bb4afdf052330678af9a601d+sent
mail\@neo.tamu.edu") does not work.
This may or may not be related, but my version of Perl requires a space
after the pipe.
-Bill
------------------------------
Date: 3 Dec 2002 21:23:35 GMT
From: roberson@ibd.nrc.ca (Walter Roberson)
Subject: Re: how to get it quoted?
Message-Id: <asj7cn$ggu$1@canopus.cc.umanitoba.ca>
In article <Pine.HPX.4.44.0212031248550.18091-100000@hills.ccsf.cc.ca.us>,
<btam01@ccsf.edu> wrote:
:open(MAIL,"| mailx -s 'for test' c24b18d4bb4afdf052330678af9a601d+sent
:mail\@neo.tamu.edu") does not work.
:This may or may not be related, but my version of Perl requires a space
:after the pipe.
What version of perl is that? The documentation in perlfunc
for open() says,
The filename passed to open will have leading and trailing
whitespace deleted, and the normal redirection characters
honored.
I don't have a perl4 man page handy; my -memory- is that similar
wording was in there.
--
"Meme" is self-referential; memes exist if and only if the "meme" meme
exists. "Meme" is thus logically a meta-meme; but until the existance
of meta-memes is more widely recognized, "meta-meme" is not a meme.
-- A Child's Garden Of Memes
------------------------------
Date: Tue, 03 Dec 2002 16:09:46 -0600
From: user <du_bing@hotmail.com>
To: Walter Roberson <roberson@ibd.nrc.ca>
Subject: Re: how to get it quoted?
Message-Id: <3DED2BAA.31559954@hotmail.com>
Thanks for the response, Walter. I tried your suggestion (open(MAIL,"|mailx -s 'for test'
'"c24b18d4bb4afdf052330678af9a601d+sent mail"\@neo.tamu.edu'")). Instead of 'User unknown', it
returned the following errors:
==========
Bareword found where operator expected at ./z.pl line 5, near ""|mailx -s 'for t
est' '"c24b18d4bb4afdf052330678af9a601d"
(Missing operator before c24b18d4bb4afdf052330678af9a601d?)
syntax error at ./z.pl line 5, near ""|mailx -s 'for test' '"c24b18d4bb4afdf0523
c24b18d4bb4afdf0523"
Execution of ./z.pl aborted due to compilation errors.
zsh: exit 255 ./z.pl
===========
Bing
Walter Roberson wrote:
> In article <3DEBE50E.FCC655E7@hotmail.com>, user <du_bing@hotmail.com> wrote:
> :However, we have many users whose folder names have space, e.g. 'sent
> :mail'. In this case, changing 'sent-mail' to 'sent mail' will break the
> :above script and result in '9389edec9f36467e34cfb759e0c4359c+sent...
> :User unknown'. Apparently, 'c24b18d4bb4afdf052330678af9a601d+sent
> :mail@neo.tamu.edu' is treated by mailx as two separate email addresses,
> :one is c24b18d4bb4afdf052330678af9a601d+sent and the other is
> :mail@neo.tamu.edu.
>
> :So the question is how should I get mail delivered to folders with space
> :in name?
>
> :open(MAIL,"|mailx -s 'for test' c24b18d4bb4afdf052330678af9a601d+sent
> :mail\@neo.tamu.edu") does not work.
>
> This isn't really a perl question. This is an RFC822 question.
> According to RFC822, space can only occur in a local-part if the
> local-part is quoted. See RFC822 "D. ALPHABETICAL LISTING OF SYNTAX RULES"
> at your favorite RFC server such as http://www.faqs.org
>
> The task of your perl code would thus be to deliver to mailx
> a destination address such as
> "c24b18d4bb4afdf052330678af9a601d+sent mail"@neo.tamu.edu
> *complete with the double-quotes*. You will have to take into account
> that the command will be executed through a shell so you have to account
> for normal shell quoting. Try this:
>
> open(MAIL,"|mailx -s 'for test' '"c24b18d4bb4afdf052330678af9a601d+sent mail"\@neo.tamu.edu'")
> --
> "The human genome is powerless in the face of chocolate."
> -- Dr. Adam Drewnowski
------------------------------
Date: Tue, 3 Dec 2002 22:43:03 -0800
From: "Décio Quintas" <decioquintas@sic.pt>
Subject: how to: perl shell script to programaticaly submit a html form?
Message-Id: <asjc4v$pj8$1@news.oninet.pt>
Hi there!
Long time since last posted here!
I've got this problem... searched the web but can't seem to find an answer:
Imagine this.... I've got an "engine" that generates an xml file... that
file needs to be uploaded to another location on the web... problem:
I must code a script (and cron job it every 10 or 15 minutes) that
programaticaly creates a form (like in "html" form :) and "submits" it to
said location! There's no browser or apache intervention... not quite sure
if I'm explaing the problem the right way.... damn! must.... sleep...
Is it possible?
Please feel free to answer to decioquintasNOSPA_M@sic.pt if you find more
convenient....just leave the "NOSPA_M" stuff out!
Thanks!
Décio Quintas - Perl Geek since 2000
------------------------------
Date: Tue, 03 Dec 2002 21:52:00 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: hyphens in CGI parameters
Message-Id: <pkent77tea-3584B7.21515703122002@news-text.blueyonder.co.uk>
In article <7fdbcb63.0212030624.5d05a188@posting.google.com>,
btobin@columbus.rr.com (Bruce Tobin) wrote:
> The following code, which differs from the preceding only in that the
> form parameter used has a hyphen, does not work:
^^^^^^^^^^^^^
It's sometimes good to include the error message that was generated if
it's not clear how a thing must be failing. Look in the server error
logs, for example.
> Is there any way to use hyphenated parameter names successfully with
> CGI.pm?
Of course. AFAIK you can use any characters in the key names, just as
you can in the values. They work fine for me, both as file uploads and
normal stringy key/value pairs... code at the end:
for this url
http://10.1.1.10:3004/cgi-bin/piersk/cgit.pl?geddy=HIYA;geddy-lee=HERE
I got:
Value of the 'geddy' parameter is HIYA
Value of the 'geddy-lee' parameter is HERE
No filehandle
And submitting a little form to it:
Value of the 'geddy' parameter is HIYA
Value of the 'geddy-lee' parameter is HERE
Got a filehandle...
*** <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
*** "http://www.w3.org/TR/2000/REC-x...
*** <html xmlns="http://www.w3.org/1999/xhtml">
*** <head>
...
HTH
P
__CODE__
#!/usr/local/bin/perl -w
use strict;
use CGI;
my $c = new CGI;
print $c->header('text/plain');
print "Value of the 'geddy' parameter is " . $c->param('geddy') . "\n";
print "Value of the 'geddy-lee' parameter is " . $c->param('geddy-lee')
. "\n";
my $hfh = $c->upload('upload-thing');
if ($hfh) {
print "Got a filehandle...\n";
while (<$hfh>) { print "*** $_"; }
} else {
print "No filehandle\n";
}
__END__
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Tue, 03 Dec 2002 21:57:43 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Kicking off commands on a remote machine
Message-Id: <pkent77tea-C4E658.21574203122002@news-text.blueyonder.co.uk>
In article <asi25t$qtu5h$1@ID-68370.news.dfncis.de>,
"Rob" <robconvery@totalise.co.uk> wrote:
> Currently I have a program which runs on a single machine. I now want this
> perl app to kick off a command on a remote machine. Which module would I use
> for doing this and does anyone have any pointer to any good online guides?
> Below is a summary of what I am looking to do.
>
> Have the main perl program running on machine 1.
> I have a perl app waiting/listening on machine 2
> The main program sends a smessage to machine 2 to run "some_command.exe"
> app on machine 2 gets message and then runs command.
Does the listening application _have_ to be a perl program? Or don't you
care, just so long as you can talk to it with a perl program from
machine 1?
You can easily write a little listening server for almost any operating
system using the examples at http://modperl.com:9000/perl_networking/
(full source code). That server could then respond to incoming requests
by system(), fork() and exec() or whatever is appropriate on your system.
If the listener doesn't have to be perl (all you want is to send
messages to it from your local perl program) then there's more choice,
which depends on your OS, your security requirements, performance
requirements, etc.
P
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Tue, 03 Dec 2002 22:26:28 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: mysql
Message-Id: <bsbquuk9npfj1bsfjbuvg1v6fgekp4o7a4@4ax.com>
Jeff Zucker wrote:
>Bart Lateur wrote:
>
>> ^darkage wrote:
>>
>>
>>>>$mysql->query(qq!
>>>> INSERT INTO logs (field1, field2, field3, field4, field5, field6) VALUES
>>>> (@fields)
>>>>!);
>>>>
>>
>>>Is this a reliable method?
>>>
>>
>> Most definitely not. It'll work for numbers
>
>
>OT: Really? MySQL accepts a values list with spaces separating the
>values instead of commas as required by the SQL standard?
You can always set $" to ",", and then you *will* get comma's.
--
Bart.
------------------------------
Date: Tue, 03 Dec 2002 20:51:44 GMT
From: "regus" <Bart.Geurs@pandora.be>
Subject: netadmin and users
Message-Id: <AP8H9.33653$Ti2.5811@afrodite.telenet-ops.be>
Hi,
I'm a beginner in perl.
I'm writing my first script. I want to have a list of users and the size of
their homedirctory. So I use 'NetAdmin'.
I can get a list of users, but how can i get the size of the homedirectory.
Or at least the name of the homedirectory ?
Bart
------------------------------
Date: 3 Dec 2002 21:30:10 GMT
From: roberson@ibd.nrc.ca (Walter Roberson)
Subject: Re: netadmin and users
Message-Id: <asj7p2$gkk$1@canopus.cc.umanitoba.ca>
In article <AP8H9.33653$Ti2.5811@afrodite.telenet-ops.be>,
regus <Bart.Geurs@pandora.be> wrote:
:I'm a beginner in perl.
:I'm writing my first script. I want to have a list of users and the size of
:their homedirctory. So I use 'NetAdmin'.
:I can get a list of users, but how can i get the size of the homedirectory.
:Or at least the name of the homedirectory ?
http://aspn.activestate.com/ASPN/Reference/Products/ActivePerl/site/lib/Win32/NetAdmin.html
That'll at least get you through to the home directory name
(UserGetAttributes); I do not know if there is an easy way in
Windows to get a directory size, or if you will have to add up
the file sizes yourself.
By the way, in your next post, please make it clearer as to which
operating system you are using. To those who do not happen to work with
the same operating system you use, "NetAdmin" could easily have been a
script they hadn't run across before, or perhaps a commercial package for an
operating system such as AIX.
--
So you found your solution
What will be your last contribution?
-- Supertramp (Fool's Overture)
------------------------------
Date: Tue, 3 Dec 2002 16:07:18 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl Packages question
Message-Id: <slrnauqaom.23c.tadmc@magna.augustmail.com>
Kasp <kasp@epatra.com> wrote:
> I am quite new to Perl and still am grasping the basics.
There have been lots and lots of people in your same situation
before, and they've gotten through it allright. Keep at it...
> I have seen
> many code use packages like IO::File and Mail::Mailer etc etc.
Those are "modules".
"packages" are one of the Perl features used to implement "modules".
All modules use packages, but not all uses of packages are in modules.
Some modules are included as part of the perl distribution, so
you should already have IO::File, for instance.
You can type:
perldoc perllocal
on the machine where perl is installed to see what modules
are already there.
> The question I had:-
It seems a common enough question. Perhaps the same question has
occurred to some of the aforementioned lots and lots of people?
Common questions are collected together, along with their answers,
in documents called Frequently Asked Questions.
You should check to see if your question is in the FAQ before posting.
> 1. How and from where can I get Perl Packages like Mail::Mailer etc.
Now that you know the correct search term, you can see if there
are any FAQs that mention that term:
perldoc -q module
"What modules and extensions are available for Perl?
What is CPAN? What does CPAN/src/... mean?"
> From CPAN?
Go to: http://search.cpan.org/
and type in the name of the module.
Notice that Mail::Mailer is part of the MailTools bundle.
> But where exactly?
http://search.cpan.org/author/MARKOV/MailTools-1.52/
click where it says "download".
> 2. How do I install these packages and start using them?
"How do I install a module from CPAN?"
> A small
> example would be greatly appreciated.
This example is in the FAQ's answer:
Unpack the source into a temporary area.
perl Makefile.PL
make
make test
make install
That's it!
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 3 Dec 2002 14:55:30 -0800
From: sstark@us.ibm.com (Scott Stark)
Subject: Re: strange glob error
Message-Id: <ce94ec71.0212031455.21a80e6e@posting.google.com>
"John W. Krahn" <krahnj@acm.org> wrote in message news:<3DE537A6.253C7691@acm.org>...
> > checking library/dbdk/dapi....
> > internal error: glob failed at ./fh.pl line 32, <_GEN_0> chunk 224.
>
> Which OS is this running on? What is the Perl version number?
AIX gwareview 3 4
This is perl, version 5.005_03 built for aix
thanks,
Scott
------------------------------
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.
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 4211
***************************************