perl -MO=Deparse,-p almsdealer.pl >deparse.pl
####
use strict;
use warnings;
sub myTrim {
(my($str) = @_);
(my($trimmed) = ($str =~ /\s*(.*)\s*/));
(return $trimmed);
}
(my(@allTags) = ());
foreach my $file (glob('[0-9][0-9][0-9][0-9].txt')) {
use File::Glob ();
(my(@fileTags) = ());
(open(my $handle, '<', $file) or die(q[couldn't open file]));
while (defined((my $line = readline($handle)))) {
do {
if (($line =~ /^tags/)) {
(my($tagsString) = ($line =~ /^tags\s+(.*)/));
(@fileTags = (@fileTags, split(/,/, $tagsString, 0)));
}
};
}
close($handle);
(my(%uniqueTags) = map({myTrim($_, 1);} @fileTags));
(@allTags = (@allTags, keys(%uniqueTags)));
}
print(("@allTags\n"));
##
##
my ($str) = @_;
##
##
my $str = shift; # the string to be trimmed