[9716] in Perl-Users-Digest
Resend: Perl-Users Digest, Issue: 3307 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 1 22:04:50 1998
Date: Sat, 1 Aug 98 18:59:05 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 1 Aug 1998 Volume: 8 Number: 3307
Today's topics:
Re: -w warning ??? <ms@xy.org>
Good Book? <dmckeown@istar.ca>
Re: Good Book? <dmckeown@istar.ca>
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Gary L. Burnore)
Re: hiding user input <sneaker@sneex.fccj.org>
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Kelly Hirano)
Re: hiding user input (Abigail)
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Greg Bacon)
Is performance tweak in searching list of hash entries <steve.tolkin@fmr.com>
Re: newbie split question (Kelly Hirano)
Re: Perl == Unix? (was Re: Programmer's Editor) (I R A Aggie)
perldoc (was Re: # in a print statement) <dgris@rand.dimensional.com>
Re: Please Help - Perl on the Web <knguyen@ab.bluecross.ca>
Problem changing NT Win32 user attributes with NetAdmin <csw@ameritech.net>
Re: Q: lpd / sockets / perl / HP750 plotters <Adriaan.van.Kessel@NotThere.rivm.nl>
Q:How to "mkdir -p"? <dereks@fc.hp.com>
Schemelike qqq function? reinterpolation without eval; <david@kasey.umkc.edu>
search and replace - help <jaudall@students.wisc.edu>
Re: search and replace - help (Matthew Bafford)
Re: search and replace - help (Tad McClellan)
Re: Writing 'date' format with OraPerl on a Oracle DB. (John D Groenveld)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 01 Aug 1998 19:17:23 +0200
From: magnus stahre <ms@xy.org>
Subject: Re: -w warning ???
Message-Id: <8767gczknw.fsf@harmless.xy.org>
thartman@xxxx.xx (Todd "Waxahachiefortudinouslyexportitionismistically" Hartman) writes:
> I've got a question about a -w warning:
> while ($line = <FIN>) {
> Value of <HANDLE> construct can be "0"; test with defined() at ww.p line 65535.
Change the row above to:
while (defined($line = <FIN>)) {
-ms
------------------------------
Date: Thu, 30 Jul 1998 20:44:18 GMT
From: Dave Mckeown <dmckeown@istar.ca>
Subject: Good Book?
Message-Id: <35C0DC21.FB200D4E@istar.ca>
I just bought "Perl 5 Complete" by Edward S. Peschko & Michele DeWolfe I
was told by someone to buy "programming perl" by Larry wall, Randal
Swartz or "Cgi programming for the www" Is the book I bought any good
any one read it I sat down and read it for about 30 minutes in the store
and it looked good any opinions??
--
Icq# 14056739
mailto:dmckeown@istar.ca
------------------------------
Date: Thu, 30 Jul 1998 21:41:38 GMT
From: Dave Mckeown <dmckeown@istar.ca>
Subject: Re: Good Book?
Message-Id: <35C0E993.12E92851@istar.ca>
Tom Christiansen wrote:
> See http://www.perl.com/perl/critiques/
>
> --tom
> --
> Von Neumann: "Anyone attempting to generate random numbers by
> deterministic means is, of course, living in a state of sin."
I does not seem to be listed....
--
Icq# 14056739
mailto:dmckeown@istar.ca
------------------------------
Date: Sat, 01 Aug 1998 18:56:30 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35c96426.144523576@nntpd.databasix.com>
On Sat, 1 Aug 1998 14:31:55 -0400, in article
<1dd35u2.17fditn1ap1n0gN@bay1-241.quincy.ziplink.net>, rjk@coos.dartmouth.edu
(Ronald J Kimball) wrote:
>Gary L. Burnore <gburnore@databasix.com> wrote:
>
>> It's clear that both of you have NO clue what the difference is between email
>> and USENet. While you're all so happy to see abigail abuse new users and
>> complaining that I say something about it you're being hypocrites by posting
>> sending private email and then posting the reply to USENet.
>
>I sent you a private email message. Your response told me to keep
>USENet discussions on USENet. At your request, I posted to the
>newsgroup in order to return the discussion to your preferred medium.
You're lying. I did not request that you post my private email to this group
or any other. I said keep USENet discussions in USENet. You still seem to be
confused as to the difference in the two.
>
>It seems to me that you are being hypocritical by rudely demanding that
>I not send you email, then flaming me when I post in the newsgroup.
I commented on the posting of private email to USENet. That's hardly
hypocritical.
>
>By the way, as I clearly stated in my email message to you, I am *not*
>happy to see Abigail abusing new users. As I wrote, "You are right that
>Abigail is unnecessarily rude to newbies, and it is a shame." I did not
>complain that you said something about it; my complaint was that you
>said it (rudely and repeatedly) *in the newsgroup*. Your posts were
>directed at Abigail, and would have been more appropriate for email
>instead of the newsgroup.
>
>> USENet discussions belong in USENet. Not in email.
>
>Yes, and, as you desired, this discussion is back on USENet. I'm not
>sure what your complaint is now.
It's very clear that you're not sure. I'll say it again but you'll surely not
get it then. Your posting of private email to USENet without the permission
of the author is unethical behavior. Moreso than her abuse of the person
asking a question. Your claim that I asked you to post it is an outright lie
and is therefore also unethical. Get it? Bet not.
--
for i in databasix primenet ; do ; gburnore@$i ; done
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
spamgard(tm): zamboni | Official Proof of Purchase
===========================================================================
------------------------------
Date: Sat, 01 Aug 1998 19:01:20 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35ca64f1.144725678@nntpd.databasix.com>
On Sat, 1 Aug 1998 14:31:57 -0400, in article
<1dd3665.17sypj7107z09iN@bay1-241.quincy.ziplink.net>, rjk@coos.dartmouth.edu
(Ronald J Kimball) wrote:
>Gary L. Burnore <gburnore@databasix.com> wrote:
>
>> On Fri, 31 Jul 1998 21:05:33 -0400, in article
>> <1dd1ufc.17axra21ttmh6oN@bay2-136.quincy.ziplink.net>, rjk@coos.dartmouth.edu
>> (Ronald J Kimball) wrote:
>>
>> >Per Gary Burnore's request:
>>
>> [private email posted to USEnet deleted]
>>
>> Ronald J Kimball is a _LIAR_. I did not give him permission nor request that
>> he post my private email to him to USENet.
>
>Not a lie, but a misinterpretation of your reply:
Hardly a misinterpretation. I didn't give you permission to post private
email from me to USENet. You did. You can't seem to apologise for your
unethical behavior (or as you might call it, a mistake)
>
>> USENet discussions belong in usenet. Further email from you will be
>> considered harassment and will be reported as such to your provider.
>
>You preferred to discuss this on USENet, so I posted it to USENet.
You posted EMAIL to usenet. My comment was USENet discussions belong in
USENet. I guess you're still confused as to the difference between USENet and
email. You might just consider one has different letters or one has MORE
letters in it than the other. That might help you understand. Perhaps the
fact that each is delivered in a different manner on a different tcp port.
Perhaps the terms public and private might help you to understand the
difference. Perhaps you'll just never understand it.
Or perhaps you just can't possibly admit you were wrong for posting private
email to USENet and you need what sounds like a valid excuse.
>I
>apologize if that is not what you meant to say. You should choose your
>words more carefully in the future.
Nice try at stretching words into something that suits your need. I don't
consider your stretch an apology.
--
for i in databasix primenet ; do ; gburnore@$i ; done
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
spamgard(tm): zamboni | Official Proof of Purchase
===========================================================================
------------------------------
Date: Sat, 01 Aug 1998 15:07:01 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: hiding user input
Message-Id: <35C36755.CC9914FF@sneex.fccj.org>
Gary L. Burnore wrote:
>
> I believe enough people have seen this thread and understand that some people
> just don't think that SOME experts should treat newbies this way in this
> group. Since abigail hasn't yet continued her abuse of new users, there's no
> point continuing to point it out.
In defense of those 'experts' who would help those 'newbies':
In the time I've read this group alone, the questions revolve
around FAQs, and other documented sources. I honestly
believe that the same questions keep being asked and answered
here in three to four month time frames, more often for
some questions relating to CGI, Mail, and TMTOWTDI, etc...
Thank you for your time,
-Sneex- :]
__________________________________________________________________
Bill Jones | FCCJ Webmaster | Life is a 'Do it yourself' thing...
http://webmaster.fccj.org/cgi/mail?webmaster
------------------------------
Date: Sat, 01 Aug 1998 19:28:18 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35c36b86.146411020@nntpd.databasix.com>
On Sat, 01 Aug 1998 15:07:01 -0400, in article
<35C36755.CC9914FF@sneex.fccj.org>, Bill 'Sneex' Jones
<sneaker@sneex.fccj.org> wrote:
>Gary L. Burnore wrote:
>>
>> I believe enough people have seen this thread and understand that some people
>> just don't think that SOME experts should treat newbies this way in this
>> group. Since abigail hasn't yet continued her abuse of new users, there's no
>> point continuing to point it out.
>
>In defense of those 'experts' who would help those 'newbies':
>
>In the time I've read this group alone, the questions revolve
>around FAQs, and other documented sources. I honestly
>believe that the same questions keep being asked and answered
>here in three to four month time frames, more often for
>some questions relating to CGI, Mail, and TMTOWTDI, etc...
True but not quite the point. Again, there's a difference between saying
The answer is ... and it's in the faq.
The answer can be found in the faq located at ...
-or-
Is something wrong with your eyes that you can't see the faq
Is your brain dead because it's in the faq...
That's the point. Those who've grown tired of answering questions and then
abuse those asking should move on to something else. And yet again, I say, not
all "Experts" in this group are jerks. The non-jerks answer questions and or
point the poster to the faq without making comments that will chase them away.
--
for i in databasix primenet ; do ; gburnore@$i ; done
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
spamgard(tm): zamboni | Official Proof of Purchase
===========================================================================
------------------------------
Date: 30 Jul 1998 14:00:03 -0700
From: hirano@Xenon.Stanford.EDU (Kelly Hirano)
Subject: Re: hiding user input
Message-Id: <6pqmsj$m0p@Xenon.Stanford.EDU>
In article <35C0855E.82D3256E@interactive.ibm.com>,
John Call <johnc@interactive.ibm.com> wrote:
>
>
>Abigail wrote:
>
>> Is there something wrong with your eyes that you didn't read the FAQ?
>>
>> Abigail
>> --
>> perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-
>
> I thought once the "Perl Studs" got their .moderated group that any advice they
>gave here would be a little less venomous. I guess not. You got the new group. Go
>be rude in there. If you give advice here then take the Tom P.'s approach please.
please don't tell me that you're going to follow up each of abigail's posts
with this message. why not send such messages in email instead of spewing it
out to everyone. sorta like this message. 8^)
--
Kelly William Hirano Stanford Athletics:
hirano@cs.stanford.edu http://www.gostanford.com/
hirano@alumni.stanford.org (WE) BEAT CAL (AGAIN)! 100th BIG GAME: 21-20
------------------------------
Date: 30 Jul 1998 21:03:36 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: hiding user input
Message-Id: <6pqn38$5h$2@client3.news.psi.net>
John Call (johnc@interactive.ibm.com) wrote on MDCCXCIV September
MCMXCIII in <URL: news:35C0855E.82D3256E@interactive.ibm.com>:
++
++
++ I thought once the "Perl Studs" got their .moderated group that any advic
++ gave here would be a little less venomous. I guess not. You got the new group
++ be rude in there. If you give advice here then take the Tom P.'s approach ple
Lines of 80 characters, and repeatedly posting the same posting.
That must make you luser first class, doesn't?
Abigail
--
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
${qq$\x5F$} = q 97265646f9 and s g..g;
qq e\x63\x68\x72\x20\x30\x78$&eggee;
{eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'
------------------------------
Date: Thu, 30 Jul 1998 21:29:37 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35c8e560.14065952@nntpd.databasix.com>
On 30 Jul 1998 14:00:03 -0700, in article <6pqmsj$m0p@Xenon.Stanford.EDU>,
hirano@Xenon.Stanford.EDU (Kelly Hirano) wrote:
>In article <35C0855E.82D3256E@interactive.ibm.com>,
>John Call <johnc@interactive.ibm.com> wrote:
>>
>>
>>Abigail wrote:
>>
>>> Is there something wrong with your eyes that you didn't read the FAQ?
>>>
>>> Abigail
>>> --
>>> perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-
>>
>> I thought once the "Perl Studs" got their .moderated group that any advice they
>>gave here would be a little less venomous. I guess not. You got the new group. Go
>>be rude in there. If you give advice here then take the Tom P.'s approach please.
>
>please don't tell me that you're going to follow up each of abigail's posts
>with this message. why not send such messages in email instead of spewing it
>out to everyone. sorta like this message. 8^)
Because that would be abuse and would be grounds for termination of an account
by most reputable ISP's.
Besides, in this case, John is correct. If Abigail is too lazy to answer the
qustion, Abigail should just shut the fuck up.
--
for i in databasix primenet ; do ; gburnore@$i ; done
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
spamgard(tm): zamboni | Official Proof of Purchase
===========================================================================
------------------------------
Date: 31 Jul 1998 15:28:18 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: hiding user input
Message-Id: <6psnqi$18n$6@info.uah.edu>
In article <35c8e560.14065952@nntpd.databasix.com>,
gburnore@databasix.com (Gary L. Burnore) writes:
: Besides, in this case, John is correct. If Abigail is too lazy to answer the
: qustion, Abigail should just shut the fuck up.
You're morbidly wrong. If someone is too lazy to check the FAQ, they
have no business posting.
If all you're going to talk about is advocating giving this group over
to FAQs, then you should shut the fuck up.
Greg
------------------------------
Date: Thu, 30 Jul 1998 21:06:10 GMT
From: Steven Tolkin <steve.tolkin@fmr.com>
Subject: Is performance tweak in searching list of hash entries worthwhile?
Message-Id: <35C0E0C8.27BF0C5D@fmr.com>
I downloaded the recent 5.005_50 version of perl and frequently find
code like the following in hv.c and elsewhere.
for (; entry; entry = HeNEXT(entry)) {
if (HeHASH(entry) != hash) /* strings can't be equal */
continue;
if (HeKLEN(entry) != klen)
continue;
if (memNE(HeKEY(entry),key,klen)) /* is this it? */
continue;
return &HeVAL(entry);
}
I assume the test
if (HeKLEN(entry) != klen)
continue;
is done because testing the length is very fast, and
it was intended to eliminate mismatches.
But is this really worthwhile?
Given that we know the hash does match the likelihood is extremely
high that the entry is the one we want.
Determining when the extra check is worthwhile depends on
many factors, but the most important are the average length
of the list of entries and the number of buckets.
For the sake of this discussion assume we have 64K buckets.
Then the hash value still has 16 extra bits to distinguish
among entries in the same bucket.
The average number of entries in a bucket is usually very small,
e.g. 1 to 2, so the probability of having the same hash and
not being the same entry is less than 1/32000.
So as cheap as the test against klen is,
it seems hardly ever effective.
Or am I missing something?
Steve
---
Steven Tolkin steve.tolkin@fmr.com 617-563-0516
Fidelity Investments 82 Devonshire St. R27C Boston MA 02109
There is nothing so practical as a good theory. Comments are by me,
not Fidelity Investments, its subsidiaries or affiliates.
<insert your favorite quote about the dangers of optimization here.>
------------------------------
Date: 30 Jul 1998 12:44:45 -0700
From: hirano@Xenon.Stanford.EDU (Kelly Hirano)
Subject: Re: newbie split question
Message-Id: <6pqife$f8p@Xenon.Stanford.EDU>
yes, you are doing something stupid. ^ is a regex meta character. try /\^/ as
your regex.
In article <6pqh8e$9f8$1@kira.cc.uakron.edu>, tyler <tyler@uakron.edu> wrote:
>hello,
>
> im having trouble with split. im trying to read a file which is carat
>delimited, parsing each field into an array. my problem is that i'm using
>the split function to split it up and when i do, it doesnt work. however,
>when i change it from carat delimited to colon delimited, the code works.
>here's the code:
>
>
>open(MINN,"klaisjul2.txt") || die "no $!\n";
>
>while (<MINN>)
>{
> @list=split(/^/); # split up the fields
> chomp(@list); # take the carriage return off
> print $list[0],"\n"; # print out first field
>}
>
>close(MINN);
>
>
>what happens is when its like this, it prints out the entire line instead of
>the first field. if i change the ^ to a : and change the input file, it
>works fine. am i doing something stupid here? thanks in advance.
>oh, im using perl for win32
>
> tyler
>
>
--
Kelly William Hirano Stanford Athletics:
hirano@cs.stanford.edu http://www.gostanford.com/
hirano@alumni.stanford.org (WE) BEAT CAL (AGAIN)! 100th BIG GAME: 21-20
------------------------------
Date: Fri, 31 Jul 1998 09:43:33 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl == Unix? (was Re: Programmer's Editor)
Message-Id: <fl_aggie-3107980943330001@aggie.coaps.fsu.edu>
In article <35C0BDB3.475A26B6@mail.uca.edu>, Cameron Dorey
<camerond@mail.uca.edu> wrote:
+ I beg to differ, your logic is faulty.
No, yours is.
+ That would lead me to believe that,
+ although it may be the vast majority of systems which use Perl are some
+ flavor of Unix, that the two are not inseparable.
No. You can take the perl out of the unix, but you can't take the unix
out of perl.
Take a look at the perlfunc man page, and look at all the perl functions
that are direct links into the unix C libraries...
James
------------------------------
Date: Fri, 31 Jul 1998 00:36:00 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: perldoc (was Re: # in a print statement)
Message-Id: <6pr2qd$ml5$1@rand.dimensional.com>
[posted to comp.lang.perl.misc and mailed to the cited author]
In article <t75qp6.018.ln@localhost>
tadmc@flash.net (Tad McClellan) wrote:
[snip]
> 1) word search in perlfaq*.pod files
The perldoc that ships with 5.005 includes an option to
search perlfaq for keywords.
$ perldoc -q sort
=head1 Found in /home/dgris/lib/perl5/5.005/pod/perlfaq4.pod
=head2 How do I sort an array by (anything)?
[snip]
It only searches against the headings, though, and
passing regular expressions in is kind of a pain.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: Thu, 30 Jul 1998 15:13:30 -0600
From: Ky Nguyen <knguyen@ab.bluecross.ca>
To: Andy Ng <aacwn100@york.ac.uk>
Subject: Re: Please Help - Perl on the Web
Message-Id: <35C0E1FA.33E15A72@ab.bluecross.ca>
Why did you send same msgs serveral times? The number of msgs sent is not
proportional to the amount of help recv, you know :)!
Andy Ng wrote:
> Can anyone help?
>
> I want to use perl to execute a program, which is normally run from a
> unix prompt in the form of a command line. What goes into the command
> line will be collected via a 'form' and just stured in variables, but
> how do I execute a program (with a file that the user has already
> uploaded!) and then get the output of that program (which will be
> another file) back to the user.
To understand form, look at examples
in:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/fill-out-forms/overview.htmlThe
entered values is passed into the program (specified in "action" element)
as QUERY_STRING variable. Parse it and you can get the entries.
You also have to chg yr prg to include html tags for the header, then the
result,
and finally the html trailing tags.
> (the program is a sound processing one. I'm trying to make it possible
> to use it on the Web!)
>
> Please HELP!!
> aacwn100@york.ac.uk
------------------------------
Date: Sat, 01 Aug 1998 19:06:13 GMT
From: Craig Williams <csw@ameritech.net>
Subject: Problem changing NT Win32 user attributes with NetAdmin
Message-Id: <35C3667A.A81BAAB@bakernet.com>
I'm attempting to write a script that will get all members of a group
and then change the login scripts for those members. I seem to have the
same problem when actually running in a domain environment as well as
when I attempt this on a single workstation. Everything seems to be
working up until the SetAttributes part. I receive a Win32::GetLastError
value of 87 on both the UserGetAttributes (despite the fact that all the
attrs are there & correct after the get) and UserSetAttributes, but
nothing ever gets set. I'm using the ActiveState distribution.
Here is the code I'm running:
#!/usr/bin/perl
use Win32::NetAdmin;
use Win32::AdminMisc;
use Win32;
$GroupName = "CHICZWTEST";
#$server=Win32::AdminMisc::GetPDC("BMWHEM");
$server = "\\locutus";
$NEW_SCRIPT_PATH = "chikix.bat";
print "\n\\$server";
Win32::NetAdmin::LocalGroupGetMembers("\\$server", $GroupName,
\@userArray);
foreach $User (@userArray) {
Win32::NetAdmin::UserGetAttributes("\\$server", $User, $password,
$passwordAge, $privilege, $homeDir, $comment, $flags, $scriptPath);
$LCScript=lc($scriptPath);
print "\n$User";
print "\tOld: $LCScript";
$error=Win32::GetLastError;
print "\t$error";
if ($LCScript ne $NEW_SCRIPT_PATH) {
print "\tNew: $NEW_SCRIPT_PATH";
Win32::NetAdmin::UserSetAttributes("\\$server", $User,
$password, $passwordAge, $privilege, $homeDir, $comment, $flags,
$LCScript);
$error=Win32::GetLastError;
print "\t$error";
} else {
print "\tNO CHANGE";
}
}
Would appreciate any help in getting this to work, or other sources of
information on using Perl for more Domain oriented tasks.
Thanks,
craig.s.williams@bakernet.com
------------------------------
Date: 31 Jul 1998 13:57:09 GMT
From: "A.van.Kessel" <Adriaan.van.Kessel@NotThere.rivm.nl>
Subject: Re: Q: lpd / sockets / perl / HP750 plotters
Message-Id: <6psifl$hcn$2@mississippi.rivm.nl>
BTW if the plotter has buit-in lpd-functionality, cant you just
configure as a remote printer with :rm=plottername:rp=lp: in yout printcap.
Am I missing something ?
--
Happy hacking,
Adriaan van Kessel.
Ingres DBA, C/Unix hacker
Email: Adriaan.van.Kessel@rivm.nl
(remove NotThere. from the address in the header)
*** Nederlandstalige zachtwaar is een pijn in de aars ***
------------------------------
Date: Sat, 01 Aug 1998 20:53:53 +0000
From: Derek <dereks@fc.hp.com>
Subject: Q:How to "mkdir -p"?
Message-Id: <35C38061.2BB3EBEB@fc.hp.com>
Folks,
I want to do the equivalent of mkdir -p (i.e. greate all directories in
the path at once) in Perl. Obviously, I could just use backticks, but I
prefer to use stuff that's native to perl if possible. Also I could
write some iterative thing, but I'm sure there's already a tidy solution
somewhere.
Any ideas?
Derek.
------------------------------
Date: Thu, 30 Jul 1998 16:17:31 -0500
From: David Nicol <david@kasey.umkc.edu>
Subject: Schemelike qqq function? reinterpolation without eval; weak eval?
Message-Id: <35C0E2EB.3AD05999@kasey.umkc.edu>
Hello
I'm sending some form-letter e-mail based on templates read in
from a database.
So I've got this template, $Template and a pile of local variables
that fit into it, and I'm interpolating the local variables into the
template like so
send_email_function(eval "qq/$Template/")
I am worried about my templates getting tainted.
Is there a Scheme triple quote kind of operator that can explicitly
interpolate a scalar, following the double-quote rules?
qq/$Template/ isn't what I want, it will return
To: $RecipAddress
Subject: $Subject
Dear $Recipient
Regarding $Issue
et cetera, et cetera
Or how do I cripple eval so it won't do anything but interpolation,
even if the string in there is all full of semicolons and such?
Example:
#!perl
$one = "one1";
$two = 'two2';
$OT = "\$one};print `date`;qq{ \$two\n";
print $OT, qq/$OT/, eval "qq{$OT}";
I suppose I am going to use s/// to eliminate all occurances of my
quoting character from $Template before evaluating it, so the text
could not break out of the qq//.
but a qqq/STRING/ operator would be nice, and I am a little surprised
that there isn't one already. Is there some kind of
_sys_interpolate function that can be called?
the CPAN text-handling modules that provide a whole language
for writing your form letters (or web pages) are a bit beyond
what I'm looking for.
______________________________________________________________________
David Nicol 816.235.1187 UMKC Network Operations david@news.umkc.edu
"The latest monstrous creation from the loathsome..."
------------------------------
Date: Sat, 01 Aug 1998 19:38:27 +0000
From: Joshua Udall <jaudall@students.wisc.edu>
Subject: search and replace - help
Message-Id: <35C36EB3.C6828099@students.wisc.edu>
I know this probably falls into the realm of awk - but the little perl I
know amounts to a lot compared to the amount of awk I know.
I would like to know where I could find some better search and replace
scripts as well. This will only work for this case.
Essentially, I want to insert 'BLOCK=0' into all my images within
several html files. (<IMG SRC="foo"> into <IMG BLOCK=0 SRC="foo">)
I'm confused about handling the files. How can I 'open' a file, edit it
then save it with the same name as it was opened with? Below I'm trying
to write new files with '2' appended to the file name. Then I'll just
have to rename them. What a bother.
This is what I have so far:
#!/usr/bin/perl
my @files=<*.html>;
#insert all *.html file names from current dir into an array
foreach $files (@files)
#for each file in the array I want to change the images.
{
open (SESAME, $files) or die "Can't open html files";
#open the file
open (OUTPUT, >$files "2")
#create a file with '2' appended to the filename and give it a handle
LINE: while (<SESAME>)
{
if ($line =~ /<IMG SRC=/)
{
$line = join 'BLOCK=0 ', split /<IMG /, $line;
#within the line, split it at <IMG then join inserting 'BLOCK=0'
}
else
{
next LINE;
#if <IMG not in $line, move on
}
print OUTPUT $line;
#print lines to output file
}
}
------------------------------
Date: Sat, 01 Aug 1998 20:44:03 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: search and replace - help
Message-Id: <MPG.102d4063a948dad0989692@news.scescape.net>
In article <35C36EB3.C6828099@students.wisc.edu> on Sat, 01 Aug
1998 19:38:27 +0000, Joshua Udall (a) felt the following
information to be of use:
> I'm confused about handling the files. How can I 'open' a file, edit it
> then save it with the same name as it was opened with? Below I'm trying
> to write new files with '2' appended to the file name. Then I'll just
> have to rename them. What a bother.
Look in the help for the switch -i and -p, they do exactly what
you want.
--Matthew
------------------------------
Date: Sat, 1 Aug 1998 15:33:04 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: search and replace - help
Message-Id: <02uvp6.8dl.ln@localhost>
Joshua Udall (jaudall@students.wisc.edu) wrote:
: I'm confused about handling the files. How can I 'open' a file, edit it
: then save it with the same name as it was opened with?
perlfaq, part 5:
"How do I change one line in a file/
delete a line in a file/
insert a line in the middle of a file/
append to the beginning of a file?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 31 Jul 1998 11:28:04 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Writing 'date' format with OraPerl on a Oracle DB.
Message-Id: <6psnq4$hns$1@tholian.cse.psu.edu>
Does this help?
John
groenveld@acm.org
BTW I removed c.l.p.tk from the Newsgroups line.
#!/usr/bin/perl -w
use strict;
use Date::Format;
use DBI;
my $dbh = DBI->connect('dbi:Oracle:DATA', 'scott', 'tiger')
or die $DBI::errstr;
my $sql = "
SELECT TO_CHAR(SYSDATE,'DD/MM/YYYY') FROM DUAL
WHERE TO_CHAR(SYSDATE,'YYYYMMDD') = ?";
my $sth = $dbh->prepare($sql)
or die $DBI::errstr;
$sth->execute(time2str("%Y%m%d", time))
or die $DBI::errstr;
my @row = $sth->fetchrow_array
or die $DBI::errstr;
$sth->finish
or die $DBI::errstr;
$dbh->disconnect
or die $DBI::errstr;
print "@row\n";
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 3307
**************************************