Perl Split String Into Array Js Slice