Google Suggest beta is a new toy available from the famous Google labs. As soon as you start to type something Google Suggest recognizes in the search field, a drop down menu appears under this field with several suggestions followed by the number of results available. Also, what you type is completed with what Google considers the best suggestion. The part added by Google is selected so when you keep typing it is deleted by what you type and hence a new suggestion (if available) will be given. You can also navigate the drop down list using the arrow keys to select a suggestion made by Google.
Since the number of results have the string " results" (or "result") appended, this string is removed. When the number of results is not known, the result is returned as just by Google and replaced by an empty string by the Perl program. Note that this means that trailing null fields can occur and hence a negative limit must be specified in the split function to prevent undefined results.
Example of program usage and output:
gsuggest.pl script 24,900,000 scripts 59,800,000 script 2,880,000 script fonts 8,110,000 script writing 545,000 scripture union 103,000 scripting.filesystemobject 58,200 script o rama 6,320,000 scripture 11,700,000 scripting 6,300,000 script font sorted: 59,800,000 script 24,900,000 scripts 11,700,000 scripting 8,110,000 script writing 6,320,000 scripture 6,300,000 script font 2,880,000 script fonts 545,000 scripture union 103,000 scripting.filesystemobject 58,200 script o rama