Using Perl To Convert Hyperlinks And Filenames To Lowercase

Newsflash

With a wide range and collection of sex toys, we have found an adult shop that provide good value for money on their range of adult products. With a vast collection of cock rings, vibrators, dildos and dongs, condoms and other safety gear. Fetish gear and fantasy stuff to suit to tickle your fancy.

You may also be interested in the fantastic range from Tenga where they have some the best masturbators in the market, straight from Japan.

 
Using Perl To Convert Hyperlinks And Filenames To Lowercase
I recently had a requirement to change all the hyperlinks in a particular web site to lower case, and also to change all the filenames (HTML pages, images, and so on) in the site to lowercase. This is how I did it.

Like a lot of web developers, I'm not always that disciplined when it comes to the file naming convention I use and I sometimes end up with a situation whereby I have some files that are in lowercase, some that begin with a capital, and some that are a bit of a mixture.

One web site I maintain contains about 2000 web pages and has about 20,000 hyperlinks. As you can imagine, I had one of those sinking feelings when I was told that in order to migrate the web site to a new content management system, all the file names and hyperlinks would need to be changed to lowercase.

Whenever I am presented with a problem like this, my instinct is always to write a Perl script using one or more regular expressions to solve the problem. This particular situation was no exception.

Change a string to lowercase

The following regular expression changes all the characters in a string to lowercase. The first part of the regular expression finds a hyperlink, and the second part converts the string. (Just in case this article is not displayed correctly, there should be a single backslash in front of the 'L$1').

1. $line =~ s/<a rel='nofollow' href="(.*?)"/<a rel='nofollow' href="L$1"/gs;

Change a filename to lowercase

Likewise, changing a filename itself is very simple. The following two lines perform the task quite nicely:

1. use File::Copy; 2. move ("$name", "L$name");

(Again, there should be a single backslash in front of the 'L$name'.)

If you need more information on how to incorporate the above code snippets into a complete script, feel free to contact me directly.

 

Friends Links

Sex Toys 247

Great Links

Some other sites that we found pretty interesting can be found here at Sex Toys Reviews and also Erotic Toys Reviews. They both provide unbiased reviews and details on adult shops and everything that they offer. Worth checking out.  Also it is worth considering checking out the Love Lizards guide to sex toys.