summaryrefslogtreecommitdiff
path: root/test/module/test.pl
blob: 5e25d84f14e26d59c5fd3f68ca165d9be0d21fba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/perl

use Getopt::Long;
use IO::Handle;

STDERR->autoflush(1);
STDOUT->autoflush(1);

my $train;
my $test;
GetOptions (
  "train"  => \$train,
  "test"  => \$test
)
or die("Error in command line arguments\n");

print "hello i am a perl script :o)\n";

if ($train) {
  print "we are training...\n";
  for (my $i = 0; $i < 10; $i++) {
    print "$i...\n";
    sleep 1;
  }
} elsif ($test) {
  print "we are testing...\n";
  for (my $i = 0; $i < 10; $i++) {
    print "$i...\n";
    sleep 1;
  }
} else {
  die "unknown command!";
}

print 'done!';

exit;