my $a = ; if($a eq 'y'){ my ($fname, $lname) = ('tom', 'test'); print "$fname $lname\n"; #OK because vars declared in block } print "$fname $lname\n"; #Vars are out of scope now, will die under strict #### #!/usr/bin/perl use strict; use warnings; open (IN, "infile") or die "Can't open input file: $!\n"; open (OUT, ">outfile") or die "Can't create outfile for write: $!\n "; my ($junk,$qno,$junk2,$vtext,$recno); while () { if (/^##recstart/) { ($junk,$recno) = split; $recno =~ s/'//g; }elsif (/^##v/) { ($junk,$qno,$junk2,$vtext) = split (/ /,$_,4); $qno =~ s/'//g; $vtext =~ s/'//g; }else { print OUT "$recno^$qno^$vtext"; } }