Skip navigation.
Home

Email Obfuscation and Shielding Script

Here's a perl script that takes email addresses as arguments, and returns javascript code that hides your email address from web spiders. The email address is also linked so it's clickable.

#! /usr/bin/perl

foreach my $email (@ARGV) {

        $email =~ s/@/ @ /;
        $email =~ s/\./ . /;

        @parts = split( ' ', $email );

        print "\n";
        print "document.write('');";
        foreach my $word (@parts) {
                print "document.write('".$word."');\n";
        }
        print "document.write('');\n";
        print "\n\n";
}

Reply

  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Allowed HTML tags: <a> <b> <dd> <dl> <dt> <i> <li> <ol> <u> <ul> <p> <br> <div> <pre> <code> <img><h1><h2><h3><h4> <blockquote>
  • Lines and paragraphs break automatically.

More information about formatting options