borovez has asked for the wisdom of the Perl Monks concerning the following question:
sub sortDictionary { foreach my $key (sort keys %dictionary) { $key =~ /^(.)/; my $lline = $key . '/' . $dictionary{$key}; #print $lline; $line = $lline; writeFiles($line); } } sub writeFiles { @alphabet=(a..z); $letter = substr($line,0,1); $namestub = "_words"; for ($i; $i<26; $i++); $filename = @alphabet[$i] . $namestub . ".txt"; if ($letter eq @alphabet[$i]){ open FILE, "+>", $filename or die $!; print FILE "$line\n"; print @alphabet[$i]; close FILE; } } return 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Function skips
by jwkrahn (Abbot) on Mar 12, 2012 at 04:44 UTC | |
|
Re: Function skips
by Marshall (Canon) on Mar 12, 2012 at 07:08 UTC | |
|
Re: Function skips
by Marshall (Canon) on Mar 12, 2012 at 12:12 UTC |