Programming

by

The following Perl script uses regular expressions to parse a text file called myFile.txt and replace any occurrence of the character sequence REPLACE with the string (or number) stored in $NEWTEXT. The modified text file is saved as myNewFile.txt. #!/usr/bin/perl $NEWTEXT = “New Stuff”; # could also be a number open(INPUT, “< myFile.txt") or die

by

Most motherboards have a feature that I have been aware of for some time but have not tried until recently. It is called wake-on-LAN (WOL) and gives you the ability to wake a computer simply by sending it a “magic packet” from any other machine on the local area network (LAN). A magic packet is

by

One of my recent projects required me to convert a time-lapse video of a microscope slide to a sequence of JPEGs so I could analyze these JPEGs using imageJ. To accomplish the conversion I used my iMac running OS X and FFmpeg, a freely available image and video conversion program. I ran the following command

by

The code below demonstrates a short Perl function that takes an array as an argument and returns the average of this array. #!/usr/bin/perl sub average { my @array = @_; # save the array passed to this function my $sum; # create a variable to hold the sum of the array’s values foreach (@array) {

by

The code below presents the basic structure of a Perl script that reads the columns of a tab-delineated text file and saves each column to a separate data array that can then be used to for additional processing. The code is set up to process a data file with two columns of data (x and