$self->{directive} = ::read_directive_from_string($self->{directive_text});
- $self->{oplist} = interpret_directive($self->{directive});
-
- validate_directive($self, $self->{oplist});
+ $self->_interpret_directive;
+ $self->_validate_directive;
}
sub auth_clearsigned_message { (shift)->{directive_text} }
=over
-=item $oplist = interpret_directive ( $directive )
+=item $packet->_interpret_directive
-Analyze the elements in DIRECTIVE, performing basic validation. An
-exception is thrown if DIRECTIVE contains invalid element values.
+Analyze the elements in the directive in PACKET, performing basic
+validation. An exception is thrown if invalid element values are found.
-The return value is an arrayref of command/parameter arrayrefs representing
-the operations to be performed to carry out DIRECTIVE.
+An arrayref of command/parameter arrayrefs representing the operations to
+be performed to carry out the directive is stored in PACKET.
-The values in the returned structure are untainted.
+The values stored are untainted.
=cut
-sub Local::Packet::Directive::interpret_directive {
- my $directive = shift; # presumed tainted
+sub Local::Packet::Directive::_interpret_directive {
+ my $self = shift;
+ my $directive = $self->{directive}; # presumed tainted
my @errors;
my @trace;
target_directory => $header{directory};
}
- return \@ops;
+ $self->{oplist} = \@ops;
}
-=item validate_directive ( $packet, $oplist )
+=item $packet->_validate_directive
-Validate the commands in OPLIST as applicable to PACKET. PACKET is a
-packet object. OPLIST is an operation list arrayref.
+Validate the commands in the operation list stored in PACKET. PACKET is a
+packet object.
An exception is thrown if validation fails.
=cut
-sub Local::Packet::Directive::validate_directive {
+sub Local::Packet::Directive::_validate_directive {
my $packet = shift;
- my $ops = shift;
+ my $ops = $packet->{oplist};
my $stem = $packet->file_name_stem;
my $op_header = $ops->[0][1];