added support for subroutines in commands
[spider.git] / cmd / blank.pl
index 5032edf0329c2c2d6216c2435a7e61c27314cff2..4a91b70fdc6374aa0cbd77fbc9b245b94748cf8f 100644 (file)
@@ -6,20 +6,29 @@
 #
 #
 
-my ($self, $line) = @_;
-my $lines = 1;
-my $data = ' ';
-my @f = split /\s+/, $line;
-if (@f && $f[0] !~ /^\d+$/) {
-       $data = shift @f;
-       $data = $data x int(($self->width-1) / length($data));
-       $data .= substr $data, 0, int(($self->width-1) % length($data))
-}
-if (@f && $f[0] =~ /^\d+$/) {
-       $lines = shift @f;
-       $lines = 9 if $lines > 9;
-       $lines = 1 if $lines < 1;
+sub this {};
+
+sub that {};
+
+sub another {}
+
+sub handle
+{
+               my ($self, $line) = @_;
+               my $lines = 1;
+               my $data = ' ';
+               my @f = split /\s+/, $line;
+               if (@f && $f[0] !~ /^\d+$/) {
+                       $data = shift @f;
+                       $data = $data x int(($self->width-1) / length($data));
+                       $data .= substr $data, 0, int(($self->width-1) % length($data))
+               }
+               if (@f && $f[0] =~ /^\d+$/) {
+                       $lines = shift @f;
+                       $lines = 9 if $lines > 9;
+                       $lines = 1 if $lines < 1;
+               }
+               my @out;
+               push @out, $data for (1..$lines);
+               return (1, @out);
 }
-my @out;
-push @out, $data for (1..$lines);
-return (1, @out);