From a0a7dbf7d3baa296618d4913477f4dc8c73bd0a0 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 8 Aug 2009 12:51:50 +0200 Subject: Fix lowercasing keyword. --- localmarkdown2sms | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'localmarkdown2sms') diff --git a/localmarkdown2sms b/localmarkdown2sms index 54e3cc9..380e1c5 100755 --- a/localmarkdown2sms +++ b/localmarkdown2sms @@ -45,9 +45,9 @@ foreach my $file (read_dir( $path )) { $content = $2; # key if ($level == 1 and $content =~ /(\w+)/) { - $key = $1; + $key = lc($1); $i = 0; - if ($content ne $key) { + if (lc($content) ne $key) { warn( "key \"$key\" extracted from fuzzy content: \"$content\"" ); } if (!defined( $delay{$key})) { @@ -88,10 +88,11 @@ foreach my $file (read_dir( $path )) { my ($phone) = shift @ARGV; my ($key) = shift @ARGV; +my $num_children = $#{ $reply{$key} }; # How many children we'll create $SIG{CHLD} = 'IGNORE'; # Don't worry about reaping zombies # Spawn off some children -for my $num ( 1 .. $#{ $reply{$key} } ) { +for my $num ( 1 .. $num_children ) { $reply{$key}[$num] =~ s/^\s*(.*?)\s*$/$1/s; run_fork { child { @@ -102,5 +103,6 @@ for my $num ( 1 .. $#{ $reply{$key} } ) { exit; } }; } +warn ("spawned $num_children reply processes"); 1; -- cgit v1.2.3