in reply to file command replacement (showing the type of a file with perl)

If you want same output as from file have a look at File::LibMagic, it uses the same library:

$ file 1x1.png 1x1.png: PNG image data, 1 x 1, 8-bit/color RGBA, non-interlaced $ perl -MFile::LibMagic -E'say File::LibMagic->new->describe_filename( +"1x1.png")' PNG image data, 1 x 1, 8-bit/color RGBA, non-interlaced
  • Comment on Re: file command replacement (showing the type of a file with perl)
  • Download Code