Undoubtedly, you script also work but i think with MMagic you can do the same thing with much less effort.
----- Original Message ----- From: "R. Joseph Newton" <[EMAIL PROTECTED]> To: "John" <[EMAIL PROTECTED]> Cc: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Sunday, February 22, 2004 1:07 AM Subject: Re: Checking about gif > John wrote: > > > I want to test if a file is a gif image or not. > > print "filename to check: "; > my $filename = <STDIN>; > chomp $filename; > open IN, $filename or die "Could not open file to check specs: $!"; > binmode IN; > my $gif_label; > read (IN, $gif_label, 6); > chomp $gif_label; > if ($gif_label =~ /^GIF8[79]a/) { > print "itsa GIF!"; > } else { > print"No, its not. Sorry\n"; > } > > > Is it practicable using a module? > > Uh, yeah. Sorta takes the fun out of it, though. > > Joseph > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>