From 841134aa779206fbc3223edd3eb55ee591b1ae19 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Sat, 24 May 2008 20:23:01 -0500 Subject: get rid of one more direct data member access --- lib/Language/TECO.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Language/TECO.pm b/lib/Language/TECO.pm index 454f3b5..8cdce1c 100644 --- a/lib/Language/TECO.pm +++ b/lib/Language/TECO.pm @@ -54,6 +54,12 @@ sub num { return $self->_num_accessor(@_); } +sub shift_num { + my $self = shift; + $self->{num2} = $self->{num}; + $self->{num} = undef; +} + sub get_string { my $self = shift; my $command = shift; @@ -110,8 +116,7 @@ sub try_cmd { my $need_reset = 1; if ($command =~ s/^,//) { - $self->{num2} = $self->num; - $self->num(undef); + $self->shift_num; $self->want_num(1); $need_reset = 0; } -- cgit v1.2.3-54-g00ecf