Code: Select all
#!/usr/bin/perl -w
use strict;
use Switch;
my $path = "test.txt";
my $choice = 0;
menu();
print("PATH: $path");
sub menu {
print("================================\n");
print("| Omer's NFA Simulation |\n");
print("--------------------------------|\n");
print("| Press [1] to specify a file |\n");
print("| Press [2] to test a String |\n");
print("| Press [3] to View Symbol Table|\n");
print("| Press [4] to Quit |\n");
print("================================\n");
print("Enter your choice: ");
$choice = <STDIN>;
$choice = chomp($choice);
print("choice: $choice");
if($choice == "1") {
print("You pressed 1\n");
change_path();
}
elsif($choice == "2") {
print("You pressed 2");
}
elsif($choice == "3") {
print("derp derp der");
}
elsif($choice == "4") {
print("You chose: $choice");
}
else {
print("you f*** moron");
}
}
sub readFile {
print("read file");
}
sub change_path {
print("Enter Test Filename: ");
$path = <STDIN>;
chomp($path);
print("p: $path");
#print("choice: $choice");
#print("heck: $_");
}