print "The time is $time\n"; #### #!/usr/bin/perl use strict; print "Enter path to script: "; my $script_path = (); # read in script open (SCRIPT, $script_path) || die("Can't find script $script_path - $!"); my $script_text = join '', (<SCRIPT>); close(SCRIPT); my %replace_key; # read in vars of at least 2 chars - well, I always use $i anyway :) while ($script_text =~ /\$(\w\w+)/gs) { $replace_key{$1} = 1; } # read in subs while ($script_text =~ /sub (\w+)/gs) { $replace_key{$1} = 1; } my $i=1; for (keys %replace_key) { my $replace = unpack ("B32", pack("N", $i)); # get binary of $i $replace =~ s/^0+(?=\d)//; # remove trailing zeroes $replace =~ s/0/I/g; # change 0 -> I $replace =~ s/1/l/g; # change 1 -> l (lowercase L) $i++; $script_text =~ s/$_/$replace/gs; # obfuscate } # remove extraneous CRs $script_text =~ s/;\s*\n\s*/;\n/gis; # now screw up tab spacing $script_text =~ s/\t+/"\t" x (int(rand 6))/ges; # take a look at your handywork print $script_text; exit(0); #### # ## comment #### s/# ##[^\n]+\n\s*/\n/g; #### s/\{/n/ /g; s/\}\s+elsif/} elsif/g; s/;\s+my/; my/g;