+ if ($return_output) {
+ return @out;
+ } else {
+ if ($dxchan->can('send_ans')) {
+ $dxchan->send_ans(@out);
+ } else {
+ dbg($_) for @out;
+ }
+ }
+ return ();
+}
+
+sub inscript
+{
+ my $self = shift;
+ $self->{inscript} = shift if @_;
+ return $self->{inscript};
+}
+
+sub store
+{
+ my $call = clean(lc shift);
+ my @out;
+ my $ref = ref $_[0] ? shift : \@_;
+ my $count;
+ my $fn = "$base/$call";
+
+ rename $fn, "$fn.o" if -e $fn;
+ my $f = IO::File->new(">$fn") || return undef;
+ for (@$ref) {
+ $f->print("$_\n");
+ $count++;
+ }
+ $f->close;
+ unlink $fn unless $count;
+ return $count;
+}
+
+sub lines
+{
+ my $self = shift;
+ return @{$self->{lines}};
+}
+
+sub erase
+{
+ my $self = shift;
+ unlink $self->{fn};