perl 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #------------------------------------------------------------------------------
  2. # $File: perl,v 1.16 2009/09/19 16:28:11 christos Exp $
  3. # perl: file(1) magic for Larry Wall's perl language.
  4. #
  5. # The `eval' lines recognizes an outrageously clever hack.
  6. # Keith Waclena <keith@cerberus.uchicago.edu>
  7. # Send additions to <perl5-porters@perl.org>
  8. 0 search/1/w #!\ /bin/perl Perl script text executable
  9. !:mime text/x-perl
  10. 0 search/1 eval\ "exec\ /bin/perl Perl script text
  11. !:mime text/x-perl
  12. 0 search/1/w #!\ /usr/bin/perl Perl script text executable
  13. !:mime text/x-perl
  14. 0 search/1 eval\ "exec\ /usr/bin/perl Perl script text
  15. !:mime text/x-perl
  16. 0 search/1/w #!\ /usr/local/bin/perl Perl script text executable
  17. !:mime text/x-perl
  18. 0 search/1 eval\ "exec\ /usr/local/bin/perl Perl script text
  19. !:mime text/x-perl
  20. 0 search/1 eval\ '(exit\ $?0)'\ &&\ eval\ 'exec Perl script text
  21. !:mime text/x-perl
  22. # by Dmitry V. Levin and Alexey Tourbin
  23. # check the first line
  24. 0 search/1 package
  25. >0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *; Perl5 module source text
  26. # not 'p', check other lines
  27. 0 search/1 !p
  28. >0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *;
  29. >>0 regex \^1\ *;|\^(use|sub|my)\ .*[(;{=] Perl5 module source text
  30. # Perl POD documents
  31. # From: Tom Hukins <tom@eborcom.com>
  32. 0 search/1/W \=pod\n Perl POD document text
  33. 0 search/1/W \n\=pod\n Perl POD document text
  34. 0 search/1/W \=head1\ Perl POD document text
  35. 0 search/1/W \n\=head1\ Perl POD document text
  36. 0 search/1/W \=head2\ Perl POD document text
  37. 0 search/1/W \n\=head2\ Perl POD document text
  38. # Perl Storable data files.
  39. 0 string perl-store perl Storable (v0.6) data
  40. >4 byte >0 (net-order %d)
  41. >>4 byte &01 (network-ordered)
  42. >>4 byte =3 (major 1)
  43. >>4 byte =2 (major 1)
  44. 0 string pst0 perl Storable (v0.7) data
  45. >4 byte >0
  46. >>4 byte &01 (network-ordered)
  47. >>4 byte =5 (major 2)
  48. >>4 byte =4 (major 2)
  49. >>5 byte >0 (minor %d)