[10650] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4242 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 17 19:07:30 1998

Date: Tue, 17 Nov 98 16:00:17 -0800
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, 17 Nov 1998     Volume: 8 Number: 4242

Today's topics:
    Re: Carp for email <rootbeer@teleport.com>
    Re: Cwd module <r28629@email.sps.mot.com>
    Re: Holy Abounding Books, Batman! <tchrist@mox.perl.com>
    Re: Holy Abounding Books, Batman! (Erik)
        How do I suppress this warning? <yong@shell.com>
    Re: How do I suppress this warning? <yong@shell.com>
    Re: How do I suppress this warning? (Mike Stok)
    Re: How do i trim a string in Perl?? (Tad McClellan)
        Learning <random3@earthlink.net>
    Re: Not to start a language war but.. <zenin@bawdycaste.org>
    Re: NT + Perl + redirection of output (Ben Coleman)
    Re: Perl script wanted <softsci@eagle.ca>
    Re: Perl Usage Survey - interpretations, anyone? <metcher@spider.herston.uq.edu.au>
    Re: Perl Usage Survey - interpretations, anyone? (Adam Turoff)
    Re: Perl Usage Survey - interpretations, anyone? <uri@fastengines.com>
        Perl5 <pauljr@nt.com>
        Sql Call Hanging <geoff@newinteractive.com>
        Trouble creating a new file <pauljr@nt.com>
        User ID problem email@address.com
    Re: Win32::AdminMisc::UserSetMiscAttributes (Was Re: Wi odinjon@my-dejanews.com
        Working with *in and mkdir() <alcazar@netcomp.net>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 17 Nov 1998 23:11:06 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Carp for email
Message-Id: <Pine.GSO.4.02A.9811171508060.27321-100000@user2.teleport.com>

On Tue, 17 Nov 1998 miko@idocs.com wrote:

> I'm writing a Perl script which is sometimes launched by qmail.  The
> problem I'm having has two parts:
> 
> - I can't see the errors when they happen

If some program is hiding (or discarding) the errors from perl, that
program isn't being very nice. But you could send the errors to a log
file, for example. You may need to lock the log file, if many processes
might be accessing it. You may need to make the log file writable by a
different userid.

> - Until it gets an exit code it likes (0 or 99 are preferred), qmail
> keeps trying the program over and over.

Well, you can give it whatever exit code you want, generally. You may want
to modify $? in an END block; see perlvar for more info about this.

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Tue, 17 Nov 1998 15:51:49 -0600
From: Tk Soh <r28629@email.sps.mot.com>
To: Ken Tang <ktlb@accessv.com>
Subject: Re: Cwd module
Message-Id: <3651EFF5.80A24613@email.sps.mot.com>

[posted to c.l.p.m and copy emailed]

Ken Tang wrote:
> 
> Hi,
> 
> Is it possible that the Cwd module or function is disabled or not
> available
> on certain ISP servers.  When I  use "use Cwd():" the program seems to
                                                 ^
Is this what you typed, ':' instead of ';'? 

> terminate abnormally.

-TK


------------------------------

Date: 17 Nov 1998 22:32:18 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Holy Abounding Books, Batman!
Message-Id: <72sthi$o5e$1@csnews.cs.colorado.edu>

In comp.lang.perl.misc, Helen Rice @ foothill.net writes:
:I don't recommend Programming Perl, too encyclopedic and absolutely useless
:for learning. Once you know it, it might be a good reference book. Not
:enough examples.

After reading your astonishing message, I flipped through Programming
Perl in search of long stretches of text devoid of examples.  I came up
empty handed though -- virtually every page has code example, usually
indented and in a constant-width font.

If you could please indicate which parts don't have enough examples,
I will do my very best to fix this in the next edition.  Right now,
though, I am at a complete loss to help you, because as far as I can see,
it's simply jammed full of them all the way from stem to stern.

I realize I'm probably too close to the problem to see it.  So, if you
could please point out to me what's not where, I'm sure that everyone
will be happier.

--tom
-- 
 PS/2 -- Half a computer
 OS/2 -- Half an operating system
 PS/2: Yesterday's hardware today. OS/2: Yesterday's software tomorrow


------------------------------

Date: 17 Nov 1998 23:25:24 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Holy Abounding Books, Batman!
Message-Id: <72t0l4$kca$1@news.cyberhighway.net>

In article <72sthi$o5e$1@csnews.cs.colorado.edu>,
	Tom Christiansen <tchrist@mox.perl.com> writes:
> In comp.lang.perl.misc, Helen Rice @ foothill.net writes:
>:I don't recommend Programming Perl, too encyclopedic and absolutely useless
>:for learning. Once you know it, it might be a good reference book. Not
>:enough examples.

Now look what you've done...you've gone and given Tom a coronary.

> After reading your astonishing message, I flipped through Programming
> Perl in search of long stretches of text devoid of examples.  I came up
> empty handed though -- virtually every page has code example, usually
> indented and in a constant-width font.

Well, the entire preface has no code examples at all.  Sure, it has
a screen listing of how to get and install perl, but no actual perl code
to be found.  Shame!  Pages 2 and 3 of the book proper also contain no code
examples (but copious humorous footnotes).

After going through the next 30 pages without finding a code-less one, I've
decided to give up the pursuit to someone with more free time than me.

> If you could please indicate which parts don't have enough examples,
> I will do my very best to fix this in the next edition.  Right now,
> though, I am at a complete loss to help you, because as far as I can see,
> it's simply jammed full of them all the way from stem to stern.

Not quite...the aforementioned preface and the index are noticeably free
of examples.

> I realize I'm probably too close to the problem to see it.  So, if you
> could please point out to me what's not where, I'm sure that everyone
> will be happier.

You have failed to include exact solutions to every conceivable programming
problem a person might have, and have in several instances used words
containing more than two syllables.  You should be ashamed.

In all seriousness, I too am at a loss as to how this poster could possibly
consider the camel book to be "absolutely useless" for learning, and I'm
not even getting a dime from O'Reilly or any of the authors of the work
(donations are always welcome, of course).  Perhaps Ms. Rice opened the
book at random, happened to land in Chapter 3 (and the alphabetic
listing of functions therein), and just gave up on the book right there?
Or maybe she's allergic to camel hair...the world may never know.

The Camel book is, quite simply, the best book out there for learning
Perl, if you take into account all of ease of reading, completeness,
technical accuracy, and the ability to keep the reader awake.  For
people that read the first 50 pages and can't make heads or tails of
it, there's always the Llama book.

Now, I'm not one to consistently champion one book (or a collection of
books by the same author(s)) over another, simply because I don't
feel the need to advertise for something that doesn't need any more
advertising, and that I'm not getting anything out of anyway (past what I've
already gotten out of my own copy), but having read the Camel
book, and several other perl tutorial books, I can safely say I have never
encountered a single book that so far surpasses any other book in its
field like the Camel does.  The beauty of it is that it's easy to learn
from, and yet well-organized enough to be used as a reference after you've
read it cover to cover and been enlightened.

I had been under the impression before now that the Camel was the undisputed
champion of the Perl world in terms of completeness and accuracy (the
creator of the language did collaborate on it, after all), and was also
undisputedly an excellent resource for learning Perl.  Sure, you might need
to look at another book (the Llama) before you read it, but it should be
an indispensable part of any perl hacker's library.

Apparently that's not so undisputed after all.  Or this is a troll.  Please
tell me this is a troll.  Or Ms. Rice is secretly working for the
"for dummies" people.

-- 
Erik Nielsen, Cyberhighway Internet Services NOC

Just don't make the '9' format pack/unpack numbers...  :-)
             -- Larry Wall in <199710091434.HAA00838@wall.org>


------------------------------

Date: Tue, 17 Nov 1998 16:47:30 -0600
From: yong <yong@shell.com>
Subject: How do I suppress this warning?
Message-Id: <3651FD02.F6810D52@shell.com>

I don't know why $^W=0 won't suppress this warning: Name "main::SAVEERR"
used only once: possible typo at myscript.pl line 4. The script is

#!perl -w
local $^W=0;
open SAVEERR, ">&STDERR";
open STDERR, ">tmp" or die "Can't open a temp file: $!";
close STDERR;
open STDERR, ">&SAVEERR";

In fact, a trivial script:
#!perl -w
$a=3;
does not give "used only once" warning. Thanks for an explanation.

Yong Huang
Email:yong@shell.com



------------------------------

Date: Tue, 17 Nov 1998 16:50:48 -0600
From: yong <yong@shell.com>
Subject: Re: How do I suppress this warning?
Message-Id: <3651FDC8.D9618C80@shell.com>

yong wrote:

> I don't know why $^W=0 won't suppress this warning: Name "main::SAVEERR"
> used only once: possible typo at myscript.pl line 4. The script is
>
> #!perl -w
> local $^W=0;
> open SAVEERR, ">&STDERR";
> open STDERR, ">tmp" or die "Can't open a temp file: $!";
> close STDERR;
> open STDERR, ">&SAVEERR";

Sorry. I have a typo. The error is "...myscript.pl line 3".

Yong



------------------------------

Date: 17 Nov 1998 23:30:19 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: How do I suppress this warning?
Message-Id: <72t0ub$9oq@news-central.tiac.net>

In article <3651FD02.F6810D52@shell.com>, yong  <yong@shell.com> wrote:
>I don't know why $^W=0 won't suppress this warning: Name "main::SAVEERR"
>used only once: possible typo at myscript.pl line 4. The script is
>
>#!perl -w
>local $^W=0;
>open SAVEERR, ">&STDERR";
>open STDERR, ">tmp" or die "Can't open a temp file: $!";
>close STDERR;
>open STDERR, ">&SAVEERR";
>
>In fact, a trivial script:
>#!perl -w
>$a=3;
>does not give "used only once" warning. Thanks for an explanation.

$a and $b are exempt from that warning as they can be used in sort blocks,
so

  @sorted = sort {$a <=> $b} @unsorted;

doesn't provoke messages.

#!/usr/local/bin/perl -w
$c=3;

will grumble.

One way to get artound it it to mention the variable somehow e.g.

#!/usr/local/bin/perl -w

use vars qw/*SAVEERR/;

open SAVEERR, ">&STDERR";

doesn't grumble.

Hope this helps,

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


------------------------------

Date: Tue, 17 Nov 1998 18:14:00 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How do i trim a string in Perl??
Message-Id: <8g3t27.er7.ln@flash.net>

Larry Rosler (lr@hpl.hp.com) wrote:
: [Posted to comp.lang.perl.misc and copy mailed.]

: In article <36519259.FAE138F4@staff.mgu.bg> on Tue, 17 Nov 1998 17:12:26 
: +0200, Alexander Avtanski <sasho@staff.mgu.bg> says...
: > xxx wrote:
: ....
: > > I need to get rid of leading and trailing spaces in a string!
: > 
: > a) s/^\b+//; s/\b+$//;
: > b) s/^\b*(.*)\b*/$1/;

: That gets rid of backspaces only, not what was requested.  


   Oh boy! Finally I get a chance to turn the tables on Larry.

   I'm still behind about 9:1 though...  ;-(


   That gets rid of zero or more zero width assertions, not backspaces.

   That is, it gets rid of nothing.


   perl says:

   /^\b+/: regexp *+ operand could be empty at ./testprog line 5.
   
   for the a) code...
   

: Other posts 
: have discussed why the 'a' approach is preferable.


   If \s is used instead of \b of course.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 17 Nov 1998 17:31:16 -0500
From: "Ross Milton" <random3@earthlink.net>
Subject: Learning
Message-Id: <72sthj$hfs$1@oak.prod.itd.earthlink.net>

I am interested in Learning Perl. Where should I start. Are there any good
tutorials on the web?

Thank You





------------------------------

Date: 17 Nov 1998 22:41:49 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Not to start a language war but..
Message-Id: <911342338.432938@thrush.omix.com>

[posted & mailed]

meaw4@my-dejanews.com wrote:
	>snip<
: Sorry for a simple question, but what/where is p5p archive?

	p5p == Perl 5 Porters

	For more info see:

	http://language.perl.com/info/mailing-lists.html

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


------------------------------

Date: Tue, 17 Nov 1998 22:37:49 GMT
From: tnguru@termnetinc.com (Ben Coleman)
Subject: Re: NT + Perl + redirection of output
Message-Id: <3651fa41.120762577@news.mindspring.com>

On Tue, 17 Nov 1998 20:42:36 GMT, mcnay@my-dejanews.com wrote:

>I am having problems with redirecting the output of a perl script into a file.
>example:   update.plx -i xt -p 100 >>.update.log

This is a known problem with NT:  redirection doesn't work with anything
but ordinary executables and command/batch files.  Blame Microsoft.

Ben
-- 
Ben Coleman
Senior Systems Analyst
TermNet Merchant Services, Inc.
Atlanta, GA


------------------------------

Date: Tue, 17 Nov 1998 17:36:08 -0500
From: "Kumar Sundaram" <softsci@eagle.ca>
Subject: Re: Perl script wanted
Message-Id: <72stub$kno$1@mur2.odyssey.on.ca>

http://www.cgi-resources.com/

dave@mag-sol.com wrote in message <72s7d2$uca$1@nnrp1.dejanews.com>...
>In article <36515E22.7B4260FF@hotmail.com>,
>  Kati Gaebler <katigaebler@hotmail.com> wrote:
>> Hello,
>>
>> I'm looking looking for a good guestbook in Perl for my web-page, does
>> anyone know where I can find CUT-N-PASTE free script which includes the
>> following functions:
>>
>> - Possibility of messages deleting themselfs automatically after a given
>> period of time, i.e. two weeks.
>>
>> - A admin page so the administrator can remove unwanted messages.
>>
>> Thats just about all I can think about. I would really appreciate your
>> advice.
>
>Kati,
>
>I've got a guestbook for download on my site at
><http://www.mag-sol.com/Download.html>, the current tarball doesn't include
>the admin program that I wrote for it last week, but I could mail that to
you
>if you're interested. Currently it doesn't age messages, but this would be
a
>very simple thing for me to add.
>
>hth,
>
>Dave...
>
>--
>Magnum Solutions Ltd: <http://www.mag-sol.com/>
>London Perl M[ou]ngers: <http://london.pm.org/>
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




------------------------------

Date: Wed, 18 Nov 1998 08:33:24 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: Perl Usage Survey - interpretations, anyone?
Message-Id: <3651F9B4.5E167712@spider.herston.uq.edu.au>

Adam Turoff wrote:
> 
> 
> NT was designed to sell servers to people who didn't know what a server
> was supposed to do or why the need servers.  That market is still pretty
> big and growing, but it's also realizing that BSOD is a feature you want
> to avoid on a server, or servers are so complex that you want someone who
> knows the magic incantations to maintain 24x7, not NT's 23x6.
> 
> Z.

Servers complex?  Servers are simple (compared to, say, SAP R3 or
Microsoft Office).  Keeping them reliable is difficult, but then simple
doesn't mean easy.

-- 
Jaime Metcher


------------------------------

Date: 17 Nov 1998 18:19:45 -0500
From: ziggy@panix.com (Adam Turoff)
Subject: Re: Perl Usage Survey - interpretations, anyone?
Message-Id: <72t0ah$sll@panix.com>

Elaine -HappyFunBall- Ashton  <eashton@bbnplanet.com> wrote:
>Adam Turoff wrote:
>> I R A Aggie <fl_aggie@thepentagon.com> wrote:
>> >Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:
>> >
>> >+ growing even when NT is supposedly eating the Unix market share. Linux
>> >
>> >I haven't seen anyone predicting the death of unix in a while...
>
>Note the word 'supposedly'. Unix isn't going anywhere, especially when
>we have 85% of our customers using Solaris. 

I don't find it surprising that 85% of BBN's customers are using Solaris,
since BBN is mostly a solaris shop.  Nevertheless, there are those 
predicting the death of Unix, facts and 4 kiloboxen shops be damned.

While Unix is gaining overall seats/racks, it's not growing as quickly 
as NT is, and it's not growing the market as quickly as NT is.  In the 
long term, it's a blip; now that that market has been created, Unix/Linux
can grow into it and gradually displace NT from it's own market.  

THAT is where the myths of NT eating Unix market share are coming from, 
and that's a valid view if you believe in marketing statistics.  :-)

>> NT was designed to sell servers to people who didn't know what a server
>> was supposed to do or why the need servers.  That market is still pretty
>> big and growing, but it's also realizing that BSOD is a feature you want
>> to avoid on a server, or servers are so complex that you want someone who
>> knows the magic incantations to maintain 24x7, not NT's 23x6.
>
>Well, NT is accessible and easily maintained by neanderthals and teenage
>boys. 

I may not be well read in anthropology, but I've never read of a case
where neanderthals devolved into 'homo microsofticus'.  That would lead
me to believe that our fur-clad relatives were more intelligent than
your average ntadmin, teenage boy or otherwise.

>It is attractive to have a server on cheap hardware and be able to
>find someone to manage it without having to pay for the expertise. Unix
>hardware, software and administration can be prohibitively expensive for
>mom & pop shops as well as inappropriate. This is the gap where linux
>can win and is winning. 

Yes, and in a large number of those mom&pop shops, that experience is
largely unnecessary (e.g. a lan for file/print/email, with no
gateway).  NT tried to deliver that goal and succeeded in a niche where
Unix failed.  Now we have Linux to show the besat from the northwest
how it should be done, and a rather nice documentation project to go
with it.

At the same time, if we don't recognize that there was value in putting
a consistent, friendly face onto the mundane arcana of running a system,
we're hurting ourselves as well as the mom&pop shops that want to
get some real work done without worrying about kernel modules and 
IP tunneling.

>Though the rub here is when you get an
>inexperienced admin running a linux box and do a disservice to the
>perception of linux as a robust secure alternative.

On the flip side, there's a rub in paying for an experienced admin
to babysit a 15-node network.

Ideally, Linux will take off with the notion of a p/t sysadmin who takes
care of your network and 3-8 others from home will take off.  

Z.



------------------------------

Date: 17 Nov 1998 18:46:58 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: Re: Perl Usage Survey - interpretations, anyone?
Message-Id: <sarr9v1evbh.fsf@camel.fastserv.com>

>>>>> "AT" == Adam Turoff <ziggy@panix.com> writes:

  >> Though the rub here is when you get an
  >> inexperienced admin running a linux box and do a disservice to the
  >> perception of linux as a robust secure alternative.

  AT> On the flip side, there's a rub in paying for an experienced admin
  AT> to babysit a 15-node network.

  AT> Ideally, Linux will take off with the notion of a p/t sysadmin who takes
  AT> care of your network and 3-8 others from home will take off.  

that is a good ideal, but if the gateway system gets hosed (linux or
u$hit), remote sysadmining is not a nice thing. but mom&pop will have
problems with whatever they use in that case. there ain't no easy way to
have true 24x7 without someone on the physical premises. someone has to
hit the power button!

uri

-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


------------------------------

Date: Tue, 17 Nov 1998 16:56:26 -0800
From: Paul Deshaies <pauljr@nt.com>
Subject: Perl5
Message-Id: <36521B3A.66AF003@nt.com>

Hi everyOne,
	I just sent a message asking for help. I'm pretty sure installing PERL5
on my UNIX server would get me rid of my problem. My question now is how
long does it take to install PERL5 and what problems can I expect?

Thanks
pd


------------------------------

Date: Tue, 17 Nov 1998 14:23:13 -0800
From: "Geoff Caylor" <geoff@newinteractive.com>
Subject: Sql Call Hanging
Message-Id: <3Hm42.543$G3.2991@news14.ispnews.com>

Hello,

I'm trying to update a record in a database using the following function,
the problem is that when it gets to the UPDATE call, it seems to freeze up
 I never see the "Post Sql Statement" printed out), nor does it modify the
record.  Can anyone see the problem?   Thanks for any help!

Geoff Caylor.

sub changeRecord
 {
    $recordkey = $_[0];
    #successfully works

    foreach  $Temp ($O->TableList("", "", "%", "TABLE, VIEW,
SYSTEM_TABLE")){
        $Table = $Temp;
    }

    $stmt = "UPDATE contacts SET FIRSTNAME = Name WHERE CONTACTID =
$recordkey";

    $rc = $db->Sql($stmt);
        die qq(SQL failed "$stmt": ), $db->Error(), qq(\n) if $rc;

print "Post Sql Statement \n";

} ##changeRecord




------------------------------

Date: Tue, 17 Nov 1998 16:49:59 -0800
From: Paul Deshaies <pauljr@nt.com>
Subject: Trouble creating a new file
Message-Id: <365219B7.73E8A214@nt.com>

Hi everyBody,
	I'm trying to create a file with an unknown name using perl4 on an
HP-UX system running Netscape Enterprise Server. This is the code I'm 
using.

	$userFile = $uid . ".user";         #$uid being a random number
	system '/bin/touch', $userfile; || die"couldn't create file";
     #open does not create the file if it doesn't exist in perl4.

	open(UID, '+<path'. $userFile) || die"couldn't open file";
	bla;
	bla;
	bla;
	close(UID);


I'm calling this script from a web page, and I get a server error. When
I check out the error message this is what I get:


[17/Nov/1998:16:34:45] failure: for host 47.15.193.29 trying to GET
/~pauljr/www/cgi-bin/upDateUserInfo.pl, cgi-parse-output reports: the
CGI program /home/x740/pauljr/www/cgi-bin/upDateUserInfo.pl did not
produce a valid header (name without value: got line "could not open
file /home/x740/pauljr/www/cgi-bin/updateuserinfo.pl line 107,  line
11.")

if you look at the end of the message you can see that the error is
giving me my "could not open file" message. This would tell me that my
file was created no problem right? Wrong! It's not there. What made me
write this message in the hope  I would get a reply is that my script
works fine directly in UNIX. Please. Please. Please. Please. Please.
Please. Please. Please. Please. Help me I need to finish this project
for the end of this month and I'm stuck with this stupid little problem.

Thanks for your attention on this matter.
pd


------------------------------

Date: Tue, 17 Nov 1998 22:52:29 GMT
From: email@address.com
Subject: User ID problem
Message-Id: <3651fb88.355689880@news-server.amherst.edu>

Hello-

I have an online survey in the works. There are 2 scripts, one to
register users, and one that collects the survey data to a file. The
survey data must be blind, so I have to assign ID's to each of the
users when they register. The output file has their answers to the
survey and their ID. The registration script assign's the ID and
writes the name and ID to a seperate file so it can be matched up
later with the survey results.

Right now, the user stores their Name and ID in a cookie--which works
fine. However, if the user does not support or rejects cookies, I am
screwed. The data collection script has no way to know the user's name
or what their ID is. 

Anyone have any clever ideas how to circumvent the problem? The
registration part must be on a seperate page as the survey itself. I
would prefer not to reject those users who do not support or reject
cookies.

Thanks in advancel.

GJB



------------------------------

Date: Tue, 17 Nov 1998 22:42:55 GMT
From: odinjon@my-dejanews.com
To: rothd@roth.net
Subject: Re: Win32::AdminMisc::UserSetMiscAttributes (Was Re: Win32 UserCreate )
Message-Id: <72su5b$jv4$1@nnrp1.dejanews.com>

Thanks Jimmer for the tip!

Unfortuanly, it behaved no differently...  The function errored out, and the
value for USER_HOME_DIR_DRIVE was blank.

Oddly though, I noticed that Win32::AdminMisc::UserGetMiscAttributes doesn't
report the value of USER_HOME_DIR_DRIVE, even when I set it through User
Manager.  So maybe there's a problem with the way AdminMisc handels this
value?

Odin
--
Odin.Anderson@TDSTelecom.Com
(608) 664-4627

From:	Jimmer
Sent:	Tuesday, November 17, 1998 2:56 PM
To:	Anderson, Odin J.
Subject:	Re: Win32::AdminMisc::UserSetMiscAttributes (Was Re: Win32
UserCreate )

Here is your original code:
Source:
use Win32::AdminMisc;
Win32::AdminMisc::UserSetMiscAttributes('', 'OdinTest789',
                USER_HOME_DIR_DRIVE, "i:",)||print "No Set!!!\n";
Win32::AdminMisc::UserGetMiscAttributes('', 'OdinTest789', \%hash) ||
die;
foreach $i (sort keys(%hash)){
  print "$i = ". $hash{$i} ."\n";
}

You need to change the "i:" from double quotes to single quotes like
this: 'i:'. Once you do this you will set the USER_HOME_DIR_DRIVE=i:.

Your code with the change:

use Win32::AdminMisc;
Win32::AdminMisc::UserSetMiscAttributes('', 'OdinTest789',
                USER_HOME_DIR_DRIVE, 'i:',)||print "No Set!!!\n";
Win32::AdminMisc::UserGetMiscAttributes('', 'OdinTest789', \%hash) ||
die;
foreach $i (sort keys(%hash)){
  print "$i = ". $hash{$i} ."\n";
}

Jimmer
In article <72ne4t$s4p$1@nnrp1.dejanews.com>,
  Odin.Anderson@TDSTelecom.Com wrote:
> I was just scanning some of the perl module archives, and came accross this
> old post.
>
> I'm also having trouble using the UserSetMiscAttributes function in the
> AdminMisc module.  I was unable to find any list of issues that may be related
> to this function.
>
> I can't seem to get the UserSetMiscAttributes function to set certain
> attribute values.  Can you please let me know if you've had success or
> problems with this function?
>
> Source:
> use Win32::AdminMisc;
> Win32::AdminMisc::UserSetMiscAttributes('', 'OdinTest789',
> 		USER_HOME_DIR_DRIVE, "i:",)||print "No Set!!!\n";
> Win32::AdminMisc::UserGetMiscAttributes('', 'OdinTest789', \%hash) || die;
> foreach $i (sort keys(%hash)){
>   print "$i = ". $hash{$i} ."\n";
> }
>
> Output:
> No Set!!!
> USER_ACCT_EXPIRES = 4294967295
> USER_AUTH_FLAGS = 0
> USER_BAD_PW_COUNT = 0
> USER_CODE_PAGE = 0
> USER_COMMENT = User Account: (dev4000)
> USER_COUNTRY_CODE = 0
> USER_FLAGS = 513
> USER_FULL_NAME = Anderson, Odin Test 789
> USER_HOME_DIR = \\dev4000\odintest789
> USER_HOME_DIR_DRIVE =
> USER_LAST_LOGOFF = 0
> USER_LAST_LOGON = 0
> USER_LOGON_HOURS = 255
> USER_LOGON_SERVER = \\*
> USER_MAX_STORAGE = 4294967295
> USER_NAME = odintest789
> USER_NUM_LOGONS = 0
> USER_PARMS =
> USER_PASSWORD =
> USER_PASSWORD_AGE = 146040
> USER_PASSWORD_EXPIRED = 0
> USER_PRIMARY_GROUP_ID = 513
> USER_PRIV = 1
> USER_PROFILE = \\dev4000\odintest789\profile\odintest789
> USER_SCRIPT_PATH = login.scr
> USER_UNITS_PER_WEEK = 168
> USER_USER_ID = 1228
> USER_USR_COMMENT = Added by OdinAdmin, 11-4-1998
> USER_WORKSTATIONS =
>
> Perl Version:
> This is perl, version 5.005_02 built for MSWin32-x86-object
> Binary build 504 provided by ActiveState Tool Corp. http://www.ActiveState.com
> Built 14:58:28 Oct  9 1998
>
> AdminMisc Version:
> ftp://ftp.roth.net/pub/ntperl/adminmisc/980511/bin/
> 75994      Oct  8 15:06  File        AdminMisc_Build_5_005.zip
>
> Other Background Stuff:
> NT 4.0 SP4 Workstation
> NT 4.0 SP3 Server
> Single Domain Model
> Script run from a Domain Admin account on an NT Workstation
>
> Any input you can provide is greatly appreciated!!!
>
>  Odin
> --
> Odin.Anderson@TDSTelecom.Com
> (608) 664-4627
>
> >In article <01bda511$b6e61140$55a0479c@UKMCPHISFW051.ukmcph.zeneca.com>,
> >  "David Richards" <david.richards@alderley.zeneca.com> wrote:
> >>
> >> WedgeX@my-dejanews.com wrote in article
> >> <6ndc9i$uv8$1@nnrp1.dejanews.com>...
> >> > I've managed to get UserCreate to work in NT, but one thing I haven't
> >> found a
> >> > setting for is to tell NT what drive letter to assign the home directory
> >> I
> >> > specify in the UserCreate statement.
> >>
> >> In Dave Roth's Win32::AdminMisc there is a UserSetMiscAttributes with an
> >> attribute USER_HOME_DIR_DRIVE.
> >>
> >> David
>
> >Hmm, it wasn't in the README but I see it in there now.  There is one strange
> >thing I've seen with AdminMisc's UserSetMiscAttributes though.  I used it to
> >set the USER_FULL_NAME field.  It worked wonderfully for 2-3 test runs, but
> >then just stopped working.  Win32::GetLastError just spits out a generic
> >message about not being able to get some environment option.  I just assumed
> >that might be that AdminMisc doesn't set up the errors for GetLastError the
> >same as the stock Win32 modules.
> >
> >This exact problem occurred on two different computers on two different
> >domains.  I use the ActiveState perl build 316, and AdminMisc 980511 (the
> >latest one on it's web page).  Any clues?
>
> --
> Odin
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>


--
Odin
--
Odin@POBox.Com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Tue, 17 Nov 1998 16:14:54 -0600
From: "illfigah" <alcazar@netcomp.net>
Subject: Working with *in and mkdir()
Message-Id: <72ssen$4et$1@excalibur.flash.net>

Hello all,

    I thank you for all the assistance the newsgroup readers have given in
past posts.  However, I'm completely clueless once again.  I'm trying to
create a directory based on form input, but cannot seem to do so.  I tried
countless different approaches, but my lack of experience and knowledge of
perl has me stumped.

    I have a perl script that calls another subroutine located in an
external file.  The script calls this subroutine using the code as follows
(in summary):

    require "cgi-lib.pl";
    &ReadParse;

    &create_directory(*in);


    I've been told that the parameter (*in) is not necessary, but I've tried
using/not using the parameter in several different attempts to execute the
subroutine.  It doesn't seem to make much of a difference.  Plus, all the
existing subroutines that require form input are using this naming
convention and would require too much time to go back and change.  Here is
the code for the external subroutine (in summary):

     sub create_directory{

     print "Content-type: text/html \n\n";
     $username = $in{'auth_user_name'};
     print "This is the username: $username";

     mkdir($username, 0777) || die "Can't make directory: $! \n";

     exit();

    }
    1;

    To me, this looks pretty straightforward, however, it doesn't seem to
work AT ALL!  The mkdir function doesn't even execute (neither do any
functions listed afterwards) and it doesn't return any error messages or die
statements.  I've run the subroutine separately (which have no affect) and
when I compile the script using the -w tag I get this peculiar warning:

    Name "main::in" used only once: possible typo at filename.pl at line 11
(the line that contains $username = $in{'auth_user_name'};)

    Because of this, I executed the subroutine alone and changed the
reference to the form inputs to &ReadParse(*input).  This seems to correct
the problem.  However, in all the other scripts (of which I'm working with
and did not write) reference the form inputs using *in (and because of this
changing the naming convention is not an option).  It is at this point where
I don't have enough knowledge to figure out what to do, furthermore, I don't
have any guidance as to where I should start troubleshooting the problem.  I
need to be able to create a directory based on the form input provided using
the current naming conventions.  Can anyone provide a solution?  If not,
then perhaps an idea of where I may start looking?

    Thanks,
    illfigah





------------------------------

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 4242
**************************************

home help back first fref pref prev next nref lref last post