User input CGI-PERL script

Posted by ljmacphee on March 12, 2007 under how to, perl | Be the First to Comment

Here is an example of a HTML form that takes numbers and information from a user, manipulates them using a CGI PERL script and calculates an answer, this one does lucky numbers, you can adjust it to any calculation you choose.

Lucky Numbers html page in txt format

Download Lucky Numbers Perl Script

PERL script to find and replace every string in a sub directory

Posted by ljmacphee on March 8, 2007 under linux, osx, perl, tools | Be the First to Comment

This is a tool that enters a sub-directory and reads and changes one string to another.

I use it when I make major updates to my website or am updating links. I can have it search for the old link and replace it with the new link. (or any other piece of text you’d like to change).

It puts the altered files in the working directory and leaves the originals unchanged. It also prints to the screen the file name and line number of any changes made.

findAndReplace.pl

Change all the file names in a directory

Posted by ljmacphee on March 7, 2007 under how to, linux, osx, perl, tools | Be the First to Comment

If you have a directory of files with the same substring sayjoke1.html, joke2.html, joke3.html … and you want to rename themriddle1.html, riddle2.html, riddle3.html this tool does that.

It is a PERL script, it will ask you for the old and new strings and changethe files in the directory in which the script is located.

chgfilename.pl

PERL script to fetch your IP and email it to yourself

Posted by ljmacphee on March 6, 2007 under how to, linux, osx, perl, tools | Be the First to Comment

I have two older scripts for grabbing your ip and emailing it to you. Getip.pl and Getip2.pl And today I put together Getip3.pl

The first script is the bare minimum needed and works on Linux. Just change it to put in your email address and run it as a cron job. 

The second script works on Windows or Linux and is more robust than the first one. Again change the email information and then run it as a cron script under Linux or in the Windows scheduler if you are running Windows. 

The third script works on OSX. Change the email to and from addresses. Install it as a cron job to have it run automatically on your computer. (MacDevCenter Cron job how to is at bottom of the page )