SPUG: set ruid?

Marc M. Adkins Marc.M.Adkins at Doorways.org
Thu Apr 25 14:10:54 CDT 2002


Well, the basic problem is that Windows doesn't support setruid().  There
are a number of functions that are present in Perl due to its UNIX origins
that don't work on Windows.

In the general case you can use the Config module to check these things:

	use Config;

	if ($Config{d_setruid})
	    {
	    print "Supports setruid()\n";
	    }

	else
	    {
	    print "Doesn't support setruid()\n";
	    }

However, this doesn't completely answer your question.  It is apparent that
somewhere in sdos.pl setruid() is being called -- only it isn't actually
part of any Perl library.  Instead, (as per the perldiag chapter in the Core
library) it is called due to an assignment to the pseudo-variable $<.  You
can double-check this by running the following one-line Perl script:

	$< = 23;

and getting the same error message.

So the long and the short of it is that you're running on Windows and some
Perl stuff isn't portable in that environment.  I mostly run Perl under
Windows so I run into this sort of thing on an irregular basis (it is in
fact remarkable that so much does work on Windows).

I don't know anything about the particular scripts you're running so I'm not
going to be much help with an actual fix.  Maybe fork()ing off sub-processes
(which are actually threads on Windows, another non-portability issue) or
segregating them in eval{} blocks would create localized contexts in which
this wouldn't happen.  Or you could dig into the code that's blowing up and
see what's what.

What scripts are these?  Did you get them from CPAN?

Marc M. Adkins

> -----Original Message-----
> From: owner-spug-list at pm.org [mailto:owner-spug-list at pm.org]On Behalf Of
> Pearson, Andrew S
> Sent: Thursday, April 25, 2002 10:25 AM
> To: 'spug-list at pm.org'
> Subject: SPUG: set ruid?
>
>
> Hello everyone,
>
> 	I am very new to Perl and to computer programming in general, but
> have been amazed at all the cool stuff that it can do.  Recently I've been
> working on a program to run loops of S-plus scripts.  I can get
> the program
> to run 1 s-plus batch script but when it attempts to run multiple
> scripts in
> loops I get a message that says:
> 	"setruid( ) not implemented at sdos.pl lone 10".
> 	I'm not sure what this means and I couldn't fin it in any of the
> Perl books that I have.  I would much appreciate any help I can get to fix
> this problem.  I'm running ActivePerl 5.6 on a Windows 98 system.
> 	Thanks
> 		Andrew S. Pearson
>
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>      POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
>       Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
>   Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
>  For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
>      Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
>
>


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org




More information about the spug-list mailing list