On 2009-10-19 at 11:33 PM, [email protected] (le...@gmail) wrote:
>It's a bad sign when the first line in the script completely
>confuses me.
>> #!/usr/bin/perl -w
Standard invocation of Perl at the start of a script, with
warnings enabled.
>> my %sort_buckets;
Just a name for a variable.
>> my %exclusions;
>
>And %exclusions is just automagically pulled from the end of
>the file (After the __END__?)
Yes, the idea being that you might not think of all the words to
exclude right away, so it's a convenient place for you to
maintain the list.
These lines do the work:
while (<DATA>) {
chomp;
$exclusions{$_}++;
}
<DATA> is a filehandle for the lines that appear after __END__.
I had the impression you were more familiar with Perl; otherwise
I wouldn't have composed something so quickly and so bare of
explanation. I did it while waiting for my machine to process
some large data sets (with Perl, natch). If I'd had time to be
more deliberate, I probably would have spared the list all my
revisions and also the opportunity for snarky comments about
Perl :-).
- Bruce
_bruce__van_allen__santa_cruz_ca_
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem,
please email "[email protected]" rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---