[13829] in Perl-Users-Digest
Perl-Users Digest, Issue: 1239 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 31 21:05:22 1999
Date: Sun, 31 Oct 1999 18:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941421908-v9-i1239@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 31 Oct 1999 Volume: 9 Number: 1239
Today's topics:
Re: *HTML Component timing (Kragen Sitaker)
Another 'or'? was [perl double-split] <ltl@rgsun40.viasystems.com>
Re: Another 'or'? was [perl double-split] (Ilya Zakharevich)
Re: Can this be made faster? <gellyfish@gellyfish.com>
Re: Can this be made faster? <qumsieh@sympatico.ca>
Check disk space script <NS-Hanny@Technologist.Com>
Re: Check disk space script (Martien Verbruggen)
Re: comparing text with words <qumsieh@sympatico.ca>
GuestBook thing in CGI <FS@FS.FS>
Re: HELP: A slight update... <jfrisby@NOSPAM.megapathdsl.net>
HELP: One down, new [problem though... :) <jfrisby@NOSPAM.megapathdsl.net>
HELP: Perl 5.005_03 wont build on Win32 w/ Cygwin 20.1! <jfrisby@NOSPAM.megapathdsl.net>
Re: I just want to separate a string!!! (Brett W. McCoy)
Re: I just want to separate a string!!! (Brett W. McCoy)
Re: ip address (Martien Verbruggen)
Re: It is always like this here? (Martien Verbruggen)
Re: Need Help! <gellyfish@gellyfish.com>
Perl and Novell Netware <239554@aol.you.must.be.joking.com>
Re: perl double-split <kbandes@home.com>
Re: perl double-split <ltl@rgsun40.viasystems.com>
Setuid Problem <cmoewes@pobox.com>
Re: Setuid Problem (Martien Verbruggen)
Re: to Alan Flavell (Martien Verbruggen)
Re: upload progress <gellyfish@gellyfish.com>
Re: What's an elegant way to populate an array with met (Kragen Sitaker)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 31 Oct 1999 23:24:35 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: *HTML Component timing
Message-Id: <Tc4T3.15080$23.808258@typ11.nn.bcandid.com>
In article <19991029174634.01158.00000139@ng-ch1.aol.com>,
TedDaniell <teddaniell@aol.comIh8spam> wrote:
>I've been looking for a tool that will parse an HTML page,
On clpm we can tell you how to build the tool, but not where to find
it. This is a place for help writing Perl, not a place to find
prewritten code in Perl.
> and return the
>download times for certain components (images and frames mainly). It seems
>that most of the HTML parser articles are in the Perl, so i was wondering if
>anyone knows of such programs that will accomplish this.
You can probably build it without too much trouble with HTML::LinkExtor
and LWP. (And calling time() a few times.) Happy hacking!
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Thu Oct 28 1999
12 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 31 Oct 1999 23:59:44 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: Another 'or'? was [perl double-split]
Message-Id: <7vil5g$9lr$1@rguxd.viasystems.com>
In comp.lang.perl.misc Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
:> my $values = <> ?? die "'Name' line without matched 'values' line.\n";
----------------------^^
Is your newsreader broken or is there soon to be yet another way
to spell "or"?
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: 1 Nov 1999 01:06:59 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Another 'or'? was [perl double-split]
Message-Id: <7vip3j$muf$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to lt lindley
<lee.lindley@bigfoot.com>],
who wrote in article <7vil5g$9lr$1@rguxd.viasystems.com>:
> :> my $values = <> ?? die "'Name' line without matched 'values' line.\n";
>
> ----------------------^^
>
> Is your newsreader broken or is there soon to be yet another way
> to spell "or"?
Probably not for 5.6. Sarathy is not too eager to put it in. But
eventually it will be. The need is obvious. (Not in this particular
case, though, as another guy with the same last name did show in
another post.)
Ilya
------------------------------
Date: 31 Oct 1999 23:00:10 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Can this be made faster?
Message-Id: <7vihlq$2u1$1@gellyfish.btinternet.com>
On Sun, 31 Oct 1999 14:01:57 -0800 PB wrote:
> study $file;
study doesnt do what you think it does - you arent doing any pattern
matches on the string contained in $file.
Of course study like you want it work there would be excellent if it
could be made to finish before the heat death of the universe sets in ..
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 31 Oct 1999 23:27:42 GMT
From: Ala Qumsieh <qumsieh@sympatico.ca>
Subject: Re: Can this be made faster?
Message-Id: <381CD0D5.7B879432@sympatico.ca>
PB wrote:
> Is there a way to make it faster?
>
> --------------------------------------------------------
>
> foreach $file (@files) {
> open (FILE, "$file") || die "Cannot open $file: $!";
> study $file;
> while (@line = <FILE>) {
> foreach $line (@line){
> if ($line =~ /\s$string\s/oi) {$count++;}
> }
> }
> close (FILE);
> }
>
> --------------------------------------------------------
Your main problem is that you read the every file completely into
memory (the array @line), and then you iterate through the elements
of @line. This makes two iterations; one of which is unnecessary.
I believe the following should be faster, but I didn't benchmark:
my $count = 0;
for my $file (@files) {
open F, $file or die $!;
while (<F>) {
$count += () = /(\s$string\s)/goi;
}
close F or die $!;
}
HTH,
--Ala
------------------------------
Date: Mon, 01 Nov 1999 00:39:06 GMT
From: "H.A." <NS-Hanny@Technologist.Com>
Subject: Check disk space script
Message-Id: <Ki5T3.10778$H%5.392896@sapphire.mtt.net>
Does anyone know where I can a Perl script that checks the disk space on the
server and return back with an e-mail message or something with that sort?
thanks
please remove the NS- from my address when replying
------------------------------
Date: 1 Nov 1999 01:21:33 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Check disk space script
Message-Id: <slrn81pr0g.rui.mgjv@wobbie.heliotrope.home>
On Mon, 01 Nov 1999 00:39:06 GMT,
H.A. <NS-Hanny@Technologist.Com> wrote:
> Does anyone know where I can a Perl script that checks the disk space on the
> server and return back with an e-mail message or something with that sort?
You should do a search on www.deja.com in this news group for the words
'disk space'. It's been on this group a few times, and you'll find many
snippets of code doing just that. There is a File::Df module on cpan
which may do what you want, and there are several modules with Mail:: in
their name that may do what you want. http://www.cpan.org/
> thanks
> please remove the NS- from my address when replying
please fix your Reply-To header if you want to get email.
Martien
--
Martien Verbruggen |
Interactive Media Division | Think of the average person. Half of
Commercial Dynamics Pty. Ltd. | the people out there are dumber.
NSW, Australia |
------------------------------
Date: Sun, 31 Oct 1999 23:16:28 GMT
From: Ala Qumsieh <qumsieh@sympatico.ca>
Subject: Re: comparing text with words
Message-Id: <381CCE33.491FAD47@sympatico.ca>
Larry Rosler wrote:
> In article <x3yzox6829g.fsf@tigre.matrox.com> on Tue, 26 Oct 1999
> 13:23:24 -0400, Ala Qumsieh <aqumsieh@matrox.com> says...
> + So, my solution was to create an anonymous subroutine on the fly. I
> + constructed the subroutine as a long string of the form:
> +
> + my $string = "sub {
> + my \$x = shift;
> +
> + if (\$x =~ /$pat1/o) { return 1 }
> + if (\$x =~ /$pat2/o) { return 1 }
> + ....
> + ....
> + if (\$x =~ /$patn/o) { return 1 }
> +
> + return 0;
> + }";
> +
> + where the $pat1 .. $patn are the regexps which are the elements of the
> + initial array.
>
> The following snippet uses the same method, but has a *much* lower golf
> score:
>
> my $string = 'sub { local $_ = shift;' .
> join('||' => map "/$_/o" => @pats) . '}';
Of course what I showed above was simply an example to clarify things. I
don't know
the size of @pats beforehand, so I can't construct $string explicitly. I
used a for()
loop, something like:
my $string = 'sub { my $x = shift; ';
for my $pat (@pats) {
$string .= "if (\$x =~ /$pat/o) { return 1 } ";
}
$string .= 'return 0; }';
Perl golf is never in my mind when I write programs, but I like to be
simple
and concise.
Now, if you think about it a bit, the /o modifier isn't really needed,
so you can
improve your golf score by one :-)
--Ala
------------------------------
Date: Mon, 01 Nov 1999 00:18:35 GMT
From: "FS" <FS@FS.FS>
Subject: GuestBook thing in CGI
Message-Id: <v%4T3.2881$ek.122935@juliett.dax.net>
I need CGI help. I want to make a page, have it refreshed each 10 minutes.
That's easy. But i also need a form, where the user types in something in
some boxes. Almost a guestbook really. Then i need the refreshing page to
show the stuff in the form, only 15 of them at the same time. U get it? This
would probably be a bad example, but it was frome here i got the idea:
http://www.worldremote.net/ftc/liveftp.html
it is a warez ftp site, with a risk of porn-banners. don't go there without
needing to.
This is kinda urgent, so I would really appreciate it if you can answer
soon!
Fredrik Stock
------------------------------
Date: Sun, 31 Oct 1999 18:24:38 -0800
From: "Jon Frisby" <jfrisby@NOSPAM.megapathdsl.net>
Subject: Re: HELP: A slight update...
Message-Id: <s1prv797iqi48@corp.supernews.com>
> Now, I'm getting a different problem! :(
>
> When I run make, I get:
> `sh cflags libperl.a regcomp.o` regcomp.c
> CCCMD = gcc -DPERL_CORE -c -O
> regcomp.c:2688: macro `va_start' used with too many (2) args
> make: *** [regcomp.o] Error 1
I'm still getting this problem, although Someone From Above smacked me with
a clue stick and pointed me at gcc2 and ld2 which are now in my path, and
the cygwin32 stuff is where it's supposed to be apparently...
So in the above, s/gcc/gcc2/ for the output... :)
Anyway... Any ideas folks?
-JF
------------------------------
Date: Sun, 31 Oct 1999 16:48:52 -0800
From: "Jon Frisby" <jfrisby@NOSPAM.megapathdsl.net>
Subject: HELP: One down, new [problem though... :)
Message-Id: <s1pmbks2iqi59@corp.supernews.com>
Ok, I solved this... I had to change the DOS style paths to Unix-style,
which was easy...
Now, I'm getting a different problem! :(
When I run make, I get:
`sh cflags libperl.a regcomp.o` regcomp.c
CCCMD = gcc -DPERL_CORE -c -O
regcomp.c:2688: macro `va_start' used with too many (2) args
make: *** [regcomp.o] Error 1
Any ideas?
-JF
Jon Frisby <jfrisby@NOSPAM.megapathdsl.net> wrote in message
news:s1pk3apviqi18@corp.supernews.com...
> I'm running Windows 98...
>
> I'd like to build Perl for the purpose of using mod_perl under Apache.
>
> First off, there are no gcc2 and ld2 wrapper scripts included with this
> version of Cygwin!
>
> Configure seems to go OK, but when I try to run make, I get the following
> error:
>
> make: *** No rule to make target
>
`C:\\CYGNUS\\CYGWIN~1\\H-I586~1\\BIN\\..\\lib\\gcc-lib\\i586-cygwin32\\egcs-
> 2.91.57\\..\\..\\..\\..\\i586-cygwin32\\include\\_ansi.h', needed by
> `miniperlmain.o'. Stop.
>
> What am I doing wrong? :(
>
> -JF
>
>
>
>
------------------------------
Date: Sun, 31 Oct 1999 16:10:18 -0800
From: "Jon Frisby" <jfrisby@NOSPAM.megapathdsl.net>
Subject: HELP: Perl 5.005_03 wont build on Win32 w/ Cygwin 20.1!
Message-Id: <s1pk3apviqi18@corp.supernews.com>
I'm running Windows 98...
I'd like to build Perl for the purpose of using mod_perl under Apache.
First off, there are no gcc2 and ld2 wrapper scripts included with this
version of Cygwin!
Configure seems to go OK, but when I try to run make, I get the following
error:
make: *** No rule to make target
`C:\\CYGNUS\\CYGWIN~1\\H-I586~1\\BIN\\..\\lib\\gcc-lib\\i586-cygwin32\\egcs-
2.91.57\\..\\..\\..\\..\\i586-cygwin32\\include\\_ansi.h', needed by
`miniperlmain.o'. Stop.
What am I doing wrong? :(
-JF
------------------------------
Date: Mon, 01 Nov 1999 00:38:33 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: I just want to separate a string!!!
Message-Id: <slrn81poho.mdc.bmccoy@moebius.foiservices.com>
Also Sprach Landim <landim2NOlaSPAM@brhs.com.br.invalid>:
> I got from "CGI" a variable &query, and in this variable
>i have:
> &query= "blablabla blablabla blablabla",
>and now i want to separate this like that:
>
> $query1= "blablabla"
> and
> &query2= "blablabla"
> and
> &query3= "blablabla"
>
>How can i do that? Using split()? How?
First of all, you can't call your variables &query, since a & in front of
a variable signifies that is a function. Otherwise, you would do this:
@query = split(' ', $query);
or
(query1, $query2, $query3) = split(' ', $query);
The perldoc documentation for split can you lots more.
--
Brett W. McCoy bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek) http://www.foiservices.com
FOI Services, Inc./DIOGENES 301-975-0110
---------------------------------------------------------------------------
------------------------------
Date: Mon, 01 Nov 1999 00:41:57 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: I just want to separate a string!!!
Message-Id: <slrn81poo4.mdc.bmccoy@moebius.foiservices.com>
Also Sprach Brett W. McCoy <bmccoy@foiservices.com>:
>>How can i do that? Using split()? How?
>
>First of all, you can't call your variables &query, since a & in front of
>a variable signifies that is a function. Otherwise, you would do this:
>
>@query = split(' ', $query);
>
>or
>
>(query1, $query2, $query3) = split(' ', $query);
^^^^^^^
Oops. Make that $query1.
--
Brett W. McCoy bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek) http://www.foiservices.com
FOI Services, Inc./DIOGENES 301-975-0110
---------------------------------------------------------------------------
------------------------------
Date: 1 Nov 1999 01:15:25 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: ip address
Message-Id: <slrn81pqkt.rui.mgjv@wobbie.heliotrope.home>
On Sun, 31 Oct 1999 08:02:14 -0500,
Floyd Morrissette <Floyd@NewWebSite.com> wrote:
> I know this is not the right newsgroup fro this question but I am
> having trouble finding the right group and the other group I asked has
> still not responded.
>
> How can I get a permanent ip address with using an isp? Where do isp's
> get them?
\begin[very]{offtopic}
You are right, this is not the group for this at all, but I don't really
know off-hand which group would be better. comp.protocols.tcpip might be
better, or the .domains one there.. I'm not sure what they talk about
nowadays there.
Anyway: You normally get a subnet from an upstream ISP (Not all ISPs
are small dial-in providers, some of them only provide connectivity
for the smaller ones). I don't know who controls the IP address
allocation in the US (assuming that's where you are looking), but for
example for Europe it's the RIPE NCC at www.ripe.net, their
documentation on-line might help you out.
If all you need is a single IP address, you would normally talk to an
ISP who has a bundle of them, and get yourself something set up at
their place, probably with an entry in their DNS, and with their
routers taking care of all the TCP/IP stuff for you.
You could also try yahoo, and google or latavista to see if you can
find some decent links on this subject.
The point is that even if you had yourself an IP address, or a subnet,
you will still need to connect your network and information systems to
the Internet somewhere. And you _do_ need an ISP for that.
If you don't need connectivity to the Internet, just pick an address
in one of the appropriate ranges (10.0.0.0/8, 172.16.0.0/12 and
192.168.0.0/16 if memory serves correctly. RFC 1918 will have the
correct numbers)
\end{offtopic}
Martien
--
Martien Verbruggen |
Interactive Media Division | We are born naked, wet and hungry.
Commercial Dynamics Pty. Ltd. | Then things get worse.
NSW, Australia |
------------------------------
Date: 1 Nov 1999 00:33:44 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: It is always like this here?
Message-Id: <slrn81po6q.rui.mgjv@wobbie.heliotrope.home>
On 31 Oct 1999 13:41:03 -0500,
David Foster <dfoster@panix.com> wrote:
> In <slrn81n0bd.66b.abigail@alexandra.delanet.com> abigail@delanet.com (Abigail) writes:
>
> >David Foster (dfoster@panix.com) wrote on MMCCLI September MCMXCIII in
> ><URL:news:7vfbnq$cs3$1@panix.com>:
> >() So you're in the situation where new perl users need a place to discuss
> >() perl, and the most obvious place to do it is trying to keep them out.
> >() Most new users will respect this, but there's always going to be a
> >() percentage that won't. There's really no good answer to this one.
>
> >You are totally wrong. 100% completely wrong. New perl users are welcome
> >here.
>
> No, I'm not. I waited perhaps a year after learning perl before
> posting to clp. I suspect most common posters here did something
> similar. There's simply no way to really have a good question for this
> group until you've worked with the language a while.
I don't want to get into this 'yes, you are' - 'no, you are not' game.
But you are wrong :)
Seriously, the problem is not new users. Not at all. The problem is
cluelessness, and gimmeness. I agree with you that badly designed
software is playing a part in that, and I acknowledge that we can't
expect everyone to immediately know all the rules and all the
documentation, but we can expect people to have the common sense to do a
few things before posting the first time. When they open this group for
the first time, chances are that they can see some 1500+ articles
(depending on the server they use). It should occur to them that there
might be useful information in one of those articles. Even the most
crippled of software surely comes with some Subject search
functionality? If their headers are sorted alphabetically, the weekly
FAQ posts should end up somewhere at the top. They could read those.
The people who blatantly show that they haven't even tried any of the
above are the ones that aren't very welcome, until they change their
ways. I seem to repeat this a lot, but merely being new is not unwelcome
here at all. Phrase your question intelligibly, and show you've tried
something. You'll really notice people are very helpful in these
circumstances. Oh, and off course, you should be on-topic.
> It's not that new users aren't welcome per se, but rather that once
Ah, I should have read on before typing all that stuff, I guess. I see
we agree on this at least.
> >Off course, we have gone through all this over and over and over again.
> >It's all in deja news.
>
> Agreed, this is all old hat. Not just here, but in many many other
> groups. Sometimes things are fixed, and sometimes they aren't.
*nod*
> To be quite honest, and I know you'll probably disagree with this,
> enough regulars here *enjoy* the situation as it stands so much
> that it will never change.
And this is what I disagree with most. The fact that the most
knowledgeable of people keep dropping off this newsgroup should show you
that they are not happy at all with the situation. The fact that these
discussions keep appearing should show you that as well. Nobody is happy
with the situation as it is. And nobody knows how to fix it, if it's
fixable at all.
Martien
--
Martien Verbruggen |
Interactive Media Division | That's not a lie, it's a
Commercial Dynamics Pty. Ltd. | terminological inexactitude.
NSW, Australia |
------------------------------
Date: 31 Oct 1999 22:50:20 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Need Help!
Message-Id: <7vih3c$2tr$1@gellyfish.btinternet.com>
On Sun, 31 Oct 1999 14:25:29 -0700 jingdong li wrote:
> I am a beginner in perl, right now I got a question. Can somebody tell me
> how can I get and install the perl interpreter on my homecomputer so I can
> test my cgi program on my PC. Right now, I just write done my cgi program
> and then upload to unix machine to test it. It took a lot of time.
> Thanks a lot!
>
Assuming that you have Windows 9[58] or NT on your system then you
can download a Perl interpreter from <http://www.activestate.com> this
will also install a bunch of documentation as a link on your "Start Menu"
which may answer some of the questions that you will have. You may also
want to install some HTTP server on your PC - you will want to ask about
that (and any configuration issues thus arising) in the newsgroup
comp.infosystems.www.servers.ms-windows .
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Mon, 01 Nov 1999 01:30:14 +0000
From: DGJ <239554@aol.you.must.be.joking.com>
Subject: Perl and Novell Netware
Message-Id: <vqqp1s8oke9rkfhc5f2iq6jjtlvceafnm5@4ax.com>
Hi all
I run a script using UPDATE.EXE which lets me extract data from users
as they log into Novell 4.11 servers at my site. This script writes
information such as login name, server name, hard drive space, CPU
speed, etc etc to a comma delimited file. This information is very
useful to maintain our audit of users and the equipment they use.
I have seen a Perl NLM which can be used on Novell, but is it possible
to use Active Perl to do the same type of thing?
Any advice would be appreciated.
DGJ
------------------------------
Date: Sun, 31 Oct 1999 23:25:42 GMT
From: Kenneth Bandes <kbandes@home.com>
Subject: Re: perl double-split
Message-Id: <381CCFF6.25DF2DF0@home.com>
Ilya Zakharevich wrote:
> my $values = <> ?? die "'Name' line without matched 'values' line.\n";
>
> is the proper solution.
Is ?? in the language? I've got 5.005 patch 61 and it isn't documented
(except in perltodo as "or" testing defined not truth, which I assume
is what you mean) that I can find.
Ken Bandes
------------------------------
Date: 1 Nov 1999 00:22:23 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: Re: perl double-split
Message-Id: <7vimfv$a5q$1@rguxd.viasystems.com>
Kenneth Bandes <kbandes@home.com> wrote:
:>Ilya Zakharevich wrote:
:>> my $values = <> ?? die "'Name' line without matched 'values' line.\n";
:>>
:>> is the proper solution.
:>Is ?? in the language? I've got 5.005 patch 61 and it isn't documented
:>(except in perltodo as "or" testing defined not truth, which I assume
:>is what you mean) that I can find.
<Groan>
Once that operator exists people will never stop harping on
looking out for the case where <> returns the string 0 without
a newline; a condition that has about as much chance of happening
in any reasonable dataset as I do of winning the lottery.
</Groan>
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: Mon, 01 Nov 1999 02:00:03 +0000
From: Chris Moewes <cmoewes@pobox.com>
Subject: Setuid Problem
Message-Id: <381CF423.6D138446@pobox.com>
Given the following veru basic indea
#!/usr/bin/perl
$userid = $ARGV[0];
$passwd = $ARGV[1];
system "adduser -d /home/${userid} -p $passwd $userid";
Which will create a user account when run as root. How do I modify this
to make it work when run as a non-root user. I know the set chmod a+s,
but then the script complains. I understand that you have to use the
multi argument version of system but when I try to
system "adduser", " -d /home/${userid} -p $passwd $userid";
It doesn't seem to work. I appears that it passes the whole second
string as the arguement to adduser, but it thinks that the whole string
is the username. I don't know how to encapusuate the variables so I can
pass them to adduser properly. Anyhelp greatly appreciated.
Chris
cmoewes@pobox.com
------------------------------
Date: 1 Nov 1999 01:30:55 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Setuid Problem
Message-Id: <slrn81pri3.rui.mgjv@wobbie.heliotrope.home>
On Mon, 01 Nov 1999 02:00:03 +0000,
Chris Moewes <cmoewes@pobox.com> wrote:
> Which will create a user account when run as root. How do I modify this
> to make it work when run as a non-root user. I know the set chmod a+s,
I'd be very, very, very, very careful with that.
> but then the script complains. I understand that you have to use the
> multi argument version of system but when I try to
>
> system "adduser", " -d /home/${userid} -p $passwd $userid";
system( 'adduser', '-d', "/home/$userid", '-p', $passwd, $userid);
Martien
--
Martien Verbruggen |
Interactive Media Division | Freudian slip: when you say one thing
Commercial Dynamics Pty. Ltd. | but mean your mother.
NSW, Australia |
------------------------------
Date: 1 Nov 1999 00:47:51 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: to Alan Flavell
Message-Id: <slrn81pp1a.rui.mgjv@wobbie.heliotrope.home>
On Sun, 31 Oct 1999 15:11:04 -0500,
Diane <tech1@magicnet.net> wrote:
[snipped chronologically incorrect post]
*sigh*
Diane,
You have just secured yourself of a place in many people's killfiles
here, making certain that when you have a real Perl question next time,
that the people most qualified will not help you. Alan replied to your
post with correct pointers to where you could find the answer, in the
process also telling you that this subject is considered offtopic here,
and would you please post soemwhere else in the future.
You may, or may not, have noticed, when you were reading this group in
preparation for posting your question, that there have been a lot of
discussions going on again about how unhelpful this group is to people
new to perl and/or Usenet. You have just added negatively to the image
of new posters by your reaction (and there have been a few others
lately), thereby damaging the atmosphere on this group even more.
The point: Next time you post to a group, and get told that you're not
in the right place, bite your tongue and take their advice, especially
when it's phrased politely enough. You want something from us, not the
other way around.
The other point, more as an addition to the general discussions about
this sort of thing: How polite and helpful do we really need to get
before we don't offend anybody's sensibilities anymore? I know that one
case does not prove anything, but we've seen many of these. How much are
the regulars here to blame for the atmosphere, and how much is due to
inappropriate behaviour from people who don't know clp.misc?
Martien
--
Martien Verbruggen |
Interactive Media Division | That's not a lie, it's a
Commercial Dynamics Pty. Ltd. | terminological inexactitude.
NSW, Australia |
------------------------------
Date: 31 Oct 1999 22:20:54 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: upload progress
Message-Id: <7vifc6$2m9$1@gellyfish.btinternet.com>
On Sun, 31 Oct 1999 14:33:02 -0600 Blair Heuer wrote:
> Does anyone know a way, be it through a module, library, script, or
> whatever, to show the progress of a file being uploaded through perl. My
> script is to run a free webspace server, and it all works, but I was just
> wondering if there was a way to show the user that the file was in fact
> uploading and that something was happening... otherwise on big files it just
> looks like the browser is working hard at loading a page.
>
> Any help (even a simple "no") is welcome.
>
OK then: 'no' . You will however want to ask in the newsgroup
comp.infosystems.www.authoring.cgi if you want an explanation why or a
second opinion.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 31 Oct 1999 23:29:01 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: What's an elegant way to populate an array with method refs?
Message-Id: <1h4T3.15085$23.808666@typ11.nn.bcandid.com>
In article <381A17C3.DA56AD15@blur.com>, duane powell <duane@blur.com> wrote:
>What's an elegant way to populate an array with method refs? Something
>better than below? I am asking because ultimately I want to expose
>methods of my classes based on user access rights. Thanks, Duane
You can use the can method of UNIVERSAL to find methods by name.
(Perldoc UNIVERSAL for more.) That's probably the right way to do it.
However, you can't keep people from calling arbitrary methods in your
classes by such a method. You'll need to use lexical variables in
closures if you want to hide information from your clients who are
running in the same Perl script as you.
> push @{ $self->{MY_METHODS} }, \$self->someMethod();
$self->can("someMethod")
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Thu Oct 28 1999
12 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 1239
**************************************