package Preempt::Stdin; use strict; use Carp; sub TIEHANDLE { my $class = shift; my @lines = @_; bless \@lines, $class; } sub READLINE { my $self = shift; if (@$self) { shift @$self; } else { croak "List of prompt responses has been exhausted: $!"; } } 1;