http://www.perlmonks.org?node_id=117916


in reply to Re: Re: Compressing/Obfuscating a Javascript file
in thread Compressing/Obfuscating a Javascript file

I presume the problem is that it is splitting on the anon functions which you do not want. Either of these two should work better:

# alternative one - insist on "function name (" syntax or no split my @functions = split /(?=\bfunction\s+\w+\s*\()/, $data; # alternative two - functions always on line by themselves my @functions = split /^(?=function\s)/, $data;

Alternative 1 is the better option. cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print