Bioperl Training Exercise 2
From BITS wiki
#!/usr/bin/perl $variable = 42; print $variab1e;
- Create a script containing the lines above and make it executable. Run it and see what happens. What needs to be done to fix it ?
my_script.pl |
---|
|
- What needs to be done to prevent these kind of mistakes ?
my_script.pl |
---|
Always use the strict pragma ! Look at the error message and get used to it. Happens a lot of times, but fortunately easy to fix.
BTW: there is a nice tool which explains error messages for you. Simply run splain and paste in Perl's one line error message. Alternatively you can do it like this (my_script.pl is the script that does not run because of an error, e.g. the little script above): $ my_script.pl 2>&1 | splain |