Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Aug 2001 18:31:29 -0600 (CST)
From:      Ryan Thompson <ryan@sasknow.com>
To:        Duke Normandin <01031149@3web.net>
Cc:        Freebsd Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Perl and permissions
Message-ID:  <Pine.BSF.4.21.0108181814500.16969-100000@ren.sasknow.com>
In-Reply-To: <20010818143219.A78199@mandy.rockingd.calgary.ab.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
Duke Normandin wrote to Freebsd Questions:

> I'm trying to get a Perl script (mbx2mbox.pl) running w/o choking. The
> script inhales 'Manip.pm' which in turn is suppose to read
> '~/.GlobalManip.cnf' if the full path was given in the appropriate
> variable in 'Manip.pm'. I can't get 'Manip.pm' to read that sucking
> '~/.GlobalManip.cnf' file --- perms maybe? Should config-type files such
> as the one mentioned have the same perms as the Perl module? Tia...
> 

In general, those files need to be readable by the user the script is
running as. If you are actually executing them (normally not the case),
they have to have the execute bit set as well, even for root. Also, the
same user needs read/search access to all of the directories along the
path. First, confirm that, as that user, you can read the file.  
(cat ~/.GlobalManip.cnf is a good indicator). You should verify the
permissions, but maybe that's not the culprit in this case:

It looks like you are trying to use the ``~'' expansion in your Perl code.
(It's either that, or you used it in your email as a shortcut). Perl does
not support the ``~'' expansion like the login shells do. If you want to
include the file ".GlobalManip.cnf" in the user's home directory, expand
it thus:

	$filename = sprintf "%s/.GlobalManip.cnf", $ENV{"HOME"};

	require $filename
	
- Ryan

-- 
  Ryan Thompson <ryan@sasknow.com>
  Network Administrator, Accounts

  SaskNow Technologies - http://www.sasknow.com
  #106-380 3120 8th St E - Saskatoon, SK - S7H 0W2

        Tel: 306-664-3600   Fax: 306-664-1161   Saskatoon
  Toll-Free: 877-727-5669     (877-SASKNOW)     North America


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0108181814500.16969-100000>