#!/usr/bin/perl -w # # preferred_view for Safari # Copyright (c) 1999 by Barrie Slaymaker, rbs@telerama.com # # You may distribute under the terms of either the GNU General Public # License or the Artistic License, as specified in the README file. # use strict ; die "Need a single argument which is a file name" unless @ARGV == 1 ; use File::Type qw( get_type type_2_mime type_2_file_output ) ; my $file_type = get_type( { follow => 1 }, $ARGV[0] ) ; my $file_output = type_2_file_output( $file_type ) ; my $mime_type = type_2_mime( $file_type ) ; print STDERR join( ' ', $file_type, $mime_type, $file_output ), "\n" ; if ( defined( $mime_type ) && $mime_type eq 'text/html' ) { print STDERR "html\n" ; print "None\n" } else { print STDERR "plain\n" ; print "plain\n" ; } 0 ;