[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Whois as BBEdit Perl Filter?



I'd like to adapt the sample whois client from the Perl Power Tools project
for use as a BBEdit Perl Filter, but I've run into a bit of a problem or
two.  I can figure out how to get the program to work as a stand-alone, but
not as a filter.

Also the whois server returns text with Unix newlines, which need
conversion.

The unmodified code is here:

http://language.perl.com/ppt/src/whois/index.html

For the stand-alone you add the following early in the program:

if ($^O eq 'MacOS') {
    $mac_answer = eval "MacPerl::Ask(
         'Enter Command-Line Options', '-h whois.geektools.com '
         )";
    push(@ARGV, split(' ', $mac_answer))
}

I like to use GeekTools when doing a whois on a bare IP number in an unknown
netblock, so I've made it the default

BBEdit places the pathname to the current file (or a temporary file if the
current window is not saved) in @ARGV.  The text goes to STDIN and can be
read off $_.

I thought:

@ARGV = split;

might do the trick.  Alas, no.

--B
--
Webmaster/MacPerl Guru <-- or maybe not
(I'm certainly not feeling that way at the moment)
*****************************************************
Mycoinfo, the World's First Mycology e-Journal
http://www.mycoinfo.com/
*****************************************************


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org