Thanks andy, that seemed to work.
Would someone be able to give me a quick explanation of what this actually does, i pieced it together from online examples and trial and error but dont fully understand how it works.
Thanks again
Basically, if you use strict (and you should) variables declared with "my" can only be used from the declaration on until the end of the scope they're declared in:
sub mysub {
my $var1 = 1;
# here you can use $var1
}
$var1 = "boo"; # compile error: there is no $var1 declared in this sco
+pe.