Search Results

Search found 2 results on 1 pages for 'codaddict'.

Page 1/1 | 1 

  • How can I obfuscate my Perl script to make it difficult to reverse engineer?

    - by codaddict
    I've developed a Perl script that the a confidential business logic. I have to give this script to another Perl coder to test it in his environment. He will definitely try to extract the logic in my program. So I want to make my script impossible, or at least very very hard, to understand. I've tried a few sites like liraz, but they did not work for me. The encoded Perl script does not work the same as the original one.

    Read the article

  • How can I substitute the nth occurrence of a match in a Perl regex?

    - by Zaid
    Following up from an earlier question on extracting the n'th regex match, I now need to substitute the match, if found. I thought that I could define the extraction subroutine and call it in the substitution with the /e modifier. I was obviously wrong (admittedly, I had an XY problem). use strict; use warnings; sub extract_quoted { # à la codaddict my ($string, $index) = @_; while($string =~ /'(.*?)'/g) { $index--; return $1 if(! $index); } return; } my $string = "'How can I','use' 'PERL','to process this' 'line'"; extract_quoted ( $string, 3 ); $string =~ s/&extract_quoted($string,2)/'Perl'/e; print $string; # Prints 'How can I','use' 'PERL','to process this' 'line' There are, of course, many other issues with this technique: What if there are identical matches at different positions? What if the match isn't found? In light of this situation, I'm wondering in what ways this could be implemented.

    Read the article

1