Clinician's
corner

Back to main page

Programmer's
corner
So, you use WinBUGS a lot? Want more?
Patrick Blisle
Division of Clinical Epidemiology
McGill University Health Center
Montreal, Quebec CANADA
patrick.belisle@rimuhc.ca

Last modification: 12 feb 2009















Submitting Perl programs
Installing Perl

Perl is a free software package (www.activestate.com) that installs easily in a few minutes. To run Perl programs found on my webpage, you will need Perl 5.6 or more.

If you are curious of why a statistician would think of Perl as a programming language, read my Invitation to Perl page.

Running a Perl program from DOS prompt

Every Perl program can be run from DOS-prompt by typing the command

c:\perl\bin\perl.exe c:\myperlpgmdirectory\myperlpgm.pl [list-of-arguments]

However, this is not very user-friendly as long paths may need to be typed in everytime. Placing your favorite Perl programs onto your desktop is an elegant and convenient solution.

Running this site's Perl programs

For programs such as WriteWinBUGSScript and RunWinBUGSScript, the list-of-arguments (above) consists in one or more file names.

Their submission can be made much more user-friendly than through DOS-prompt by putting a link to each of them onto your desktop.
  • Through Windows Explorer, browse to one of the above cited Perl program, right-click onto it and select the Create Shortcut item;
  • Drag and drop the shortcut onto a free area of your dekstop;
  • Right-click the new icon appearing on your desktop and select the item Properties;
  • Click the Shortcut tab;
  • Assuming Perl was installed in c:\Perl\bin, enter c:\perl\bin\wperl.exe c:\mypath\mypgm.pl in the Target text-box, where c:\mypath\mypgm.pl is to be replaced by the actual path to the Perl program at target;
  • Click Apply and Ok.


Repeat steps above for each Perl program.

You can now use your Perl program by simply dragging and dropping input files onto the appropriate Perl program's desktop icon.