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

Re: [MacPerl] GUSI and mime converting



Just offa da toppa my head:

> unless (@ARGV) {

you might explicitly test for defined:

unless defined(@ARGV)

Not that I really expect this to make any difference, mind you.

My prefered method for this sort of thing avoids GUSI (not that GUSI is 
bad (GUSI is very good for the things it's for), just that there are 
other more standard ways of reading in files).

    if ($#ARGV < 0) {
        use Mac::StandardFile;
        $file = StandardGetFile('', 'TEXT');
        if ($file->sfGood()) {
            push(@ARGV, $file->sfFile());
        } else {
          exit(1);
        }
    }

This isn't fully generic, as it only reads in files with the type 'TEXT'. 
 It also doesn't allow for a user prompt, but what-the-hey, it's only an 
example.

Also you seem to be confusing MIME types with Mac type/creator codes.  
Your code appears to convert the latter, and have nothing to do with the 
former.

--B

# Fungal Parataxonomy                   Mycology Information (Mycoinfo)
# Webmaster, Staff Writer      **The World's First Mycology E-Journal**   
# <mailto:webmaster@mycoinfo.com>            <http://www.mycoinfo.com/> 
#
# First they ignore you. Then they laugh at you. Then they fight you.
# Then you win.                                     --Mohandas Gandhi


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