aboutsummaryrefslogtreecommitdiffstats
path: root/task_capture_completed.pl
diff options
context:
space:
mode:
authorMatthew Lemon <chaffinach+git@protonmail.ch>2022-04-22 21:33:56 +0100
committerMatthew Lemon <chaffinach+git@protonmail.ch>2022-04-22 21:33:56 +0100
commitb3e9242232dd19fcd4e1fbb3ea6ecdce883d06fd (patch)
tree0cfd8787493953184cf4faae3e05f093705e3307 /task_capture_completed.pl
parentf613b41f5d46563458386d22f2d484c8f90f1333 (diff)
starting to tinker with references
Diffstat (limited to '')
-rw-r--r--task_capture_completed.pl16
1 files changed, 7 insertions, 9 deletions
diff --git a/task_capture_completed.pl b/task_capture_completed.pl
index a61145a..f178dca 100644
--- a/task_capture_completed.pl
+++ b/task_capture_completed.pl
@@ -13,6 +13,7 @@ my @x = split(/\n/, $stuff);
# print "$_\n" foreach @x;
+my %tasks;
my @taskids;
my $id;
@@ -20,18 +21,15 @@ foreach my $line (@x) {
my @data = split / /, $line;
if (defined($data[4])) {
if ($data[4] =~ /\S{8}/) {
- push @taskids, ($data[4])
+ $tasks{$data[4]} = (
+ [`task _get $data[4].description`,
+ `task _get $data[4].end`]
+ )
}
}
}
-foreach (@taskids) {
- my $desc = `task _get $_.description`;
- chomp $desc;
- my $end = `task _get $_.end`;
- $end = substr($end, 0, -1);
- $end =~ s/T/ /;
- printf "%s: %-50s\t%s\n", ($_, $desc, $end)
+while ( (my $key, my $value) = each %tasks ) {
+ print "$key => @{ $value }\n";
}
-say "Found " . scalar @taskids . " tasks.";