From af706d34e954b7e8be8c8b7351f0938bc2d36670 Mon Sep 17 00:00:00 2001 From: Hugh Rawlinson Date: Fri, 30 Dec 2011 16:34:14 +0400 Subject: [PATCH] added some more basic functionality. I've started working on a python version instead. Next update will remove the perl version and include a semi-finished python version. --- main.pl | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/main.pl b/main.pl index 3522db0..29dc5da 100755 --- a/main.pl +++ b/main.pl @@ -4,8 +4,9 @@ $prev; $break = 1; $n = 0; +$mbreak = 1; print "|| SYSTEM UP ||\n"; -print "|| BE AWARE THAT 'reset' IS A RESERVED KEYWORD ||\n"; +print "|| BE AWARE THAT 'reset', 'save', 'load' AND 'quit' ARE RESERVED KEYWORDS ||\n"; sub the_loop{ @@ -14,12 +15,31 @@ sub the_loop{ #} } -while (1) { +sub save(@lines, @responses){ + +} + +sub load{ + +} + +while ($mbreak == 1) { $input = ; + chomp($input); if ($input eq "reset"){ + print "|| has been reset ||"; + system("clear"); + } + elsif ($input eq "quit"){ + $mbreak = 2; + } + elsif ($input eq "save"){ + save(); + } + elsif ($input eq "load"){ + load(); } else{ - chomp($input); if (scalar(@lines > 0)){ the_loop(); }