in reply to Script to change $ENV{PATH}

Changes to environment variables are only passed down to child processes in Unix. Therefore, without taking some special steps, any changes your Perl program makes to your environment won't be reflected back to the calling shell program. A typical way to do something like this is to have your program output a bash command on its stdout, and eval that in bash.

For example, your bash line in .profile or .bashrc would be:eval `path_munch.pl`where the basic structure of path_munch.pl (bad name, I know) is:

#! /usr/bin/perl -w my @newpath; foreach (split /:/, $ENV{PATH}) { push @newpath, ... # however you do this } print 'export PATH=', join(':', @newpath), "\n";
(Note, this is untested code).

HTH