use strict; use warnings; my @paths = grep{/perl/i}split ";", $ENV{PATH}; print "$_\n" for @paths; __END__ C:\Perl64\site\bin C:\Perl64\bin