# this program reads through a file # line by line and prints "PRINTING" # for every line between $START & $STOP # i'm intersted in improving my function &flip(\$flop) $START = 'START'; $STOP = 'STOP'; $flop = 0; while(<>) { my @record = split /,/; chomp($record[0]); if (($flop) && ($record[0] ne $STOP)){ print "PRINTING"; } else { print "not printing"; } if (($record[0] eq $START) || ($record[0] eq $STOP)) { &flip(\$flop); } } sub flip {$ref = @_[0]; $$ref = !($$ref)}