in reply to Re: Building ARRAY with grep expression NOT working
in thread Building ARRAY with grep expression NOT working

next unless $String =~ /([^\/]*\.js)/;

You may also want to use an anchor so that ".js" only matches at the end of the string instead of anywhere in the string:

next unless $String =~ /([^\/]*\.js)$/;