On Feb 8, 2010, at 4:07 AM, John Delacour wrote:

> A Perl script I am developing and running from BBE rather than in Terminal 
> begins thus:
> 
> #!/usr/local/bin/perl
> use strict;
> use Cwd;
> use Math::Trig;
> use Svgq;
> 
> 
> Now the module Svgq resides in the same directory as the script and there is 
> no difficulty locating it, whereas getcwd() always returns "/", so that 
> relative paths to other files in the directory do not work and I need to 
> hard-code the directory in the script.
> 
> I think I must be missing some simple trick.  If the module is visible then 
> it follows that the directory is included.  Why then does Cwd not know where 
> it is?  Is there some preference in BBE that will resolve the problem?

BBEdit passes -I `script’s directory` when executing the script so that local 
modules are found.

By default, it doesn’t mess with the working directory. You can choose “Run…” 
(hold down the option key) and set “chdir to Script’s Folder” in that dialog if 
you require this behavior. (That setting is sticky.)

- Jim

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.

Reply via email to