What I need is a script that will do the following:

1. Note the location of file 'A' relative to the site root.

2. Find in  file 'A' the first root-relative or absolute link to
another file (file 'B') on the site.  (Root-relative: /
my_root_directory/path/file; Absolute: http://my_root_directory/path/file).

3. Based on the previously noted location of file 'A' relative to the
site root, and the path in the link, which specifies the path from the
site root to file 'B', calculate the direct path from file 'A' to file
'B'.

4. Change the link to the direct path.

5. Do this for every link in the file.

4. Do this for all files in this directory, recursively.

It seems as if these actions wouldn't be difficult if I knew
scripting...but I don't. Anyone want to give it a try and make me
ecstatic?

On Jun 24, 9:10 pm, Rick <[email protected]> wrote:
> http://www.perlmonks.org/?node=Change%20Absolute%20to%20Relative%20li...
>
> 'nuff sed,
> Rick Bychowski

On Jun 26, 12:27 pm, BBunny <[email protected]> wrote:
> Thanks, Rick. I wish it were "'nuff said." After investigating how to
> run a perl script, I ran it from the terminal. It responded (and I
> quote):
>
> Can't locate Getopt/Declare.pm in @INC (@INC contains: /Library/Perl/
> Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /
> System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-
> multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-
> thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/
> Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /
> System/Library/Perl/Extras/5.10.0 .) at /Users/BBunny/Library/
> Application Support/BBEdit/Scripts/
> change_absolute_to_relative_links.pl line 4.
> BEGIN failed--compilation aborted at /Users/BBunny/Library/Application
> Support/BBEdit/Scripts/change_absolute_to_relative_links.pl line 4.
>
> Any clues what the problem might be? Also, it supposedly will change
> absolute links (http://) to relative ones, but it says nothing about
> changing root-relative links to document-relative ones, which is what
> I'm trying to do.
>
> On Jun 24, 9:10 pm, Rick <[email protected]> wrote:
>
>
>
>
>
>
>
> >http://www.perlmonks.org/?node=Change%20Absolute%20to%20Relative%20li...
>
> > 'nuff sed,
> > Rick Bychowski

-- 
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.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to