{ my $counter = 0; sub inc_counter { $counter++ }; # $counter is visible here sub get_counter { $counter }; # and here } #### $/ = "\n"; my $line = ; # <> operator reads just one line my $whole_file; { local($/) = undef; $whole_file = ; # <> operator reads in all of the data from filehandle F } $line = ; # reads just one line again, since $/ returns to "\n" #### for (0 .. 100) { next unless $_ % 2; # skip multiples of 2 next unless $_ % 5; # skip multiples of 5 print "$_\n"; }