perl 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #------------------------------------------------------------------------------
  2. # $File: perl,v 1.21 2013/12/08 23:33:18 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 eval\ "exec\ /bin/perl Perl script text
  9. !:mime text/x-perl
  10. 0 search/1 eval\ "exec\ /usr/bin/perl Perl script text
  11. !:mime text/x-perl
  12. 0 search/1 eval\ "exec\ /usr/local/bin/perl Perl script text
  13. !:mime text/x-perl
  14. 0 search/1 eval\ '(exit\ $?0)'\ &&\ eval\ 'exec Perl script text
  15. !:mime text/x-perl
  16. 0 search/1 #!/usr/bin/env\ perl Perl script text executable
  17. !:mime text/x-perl
  18. 0 search/1 #!\ /usr/bin/env\ perl Perl script text executable
  19. !:mime text/x-perl
  20. 0 search/1 #!
  21. >0 regex \^#!.*/bin/perl$ Perl script text executable
  22. !:mime text/x-perl
  23. # by Dmitry V. Levin and Alexey Tourbin
  24. # check the first line
  25. 0 search/1 package
  26. >0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *; Perl5 module source text
  27. !:strength + 10
  28. # not 'p', check other lines
  29. 0 search/1 !p
  30. >0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *;
  31. >>0 regex \^1\ *;|\^(use|sub|my)\ .*[(;{=] Perl5 module source text
  32. !:strength + 10
  33. # Perl POD documents
  34. # From: Tom Hukins <tom@eborcom.com>
  35. 0 search/1/W \=pod\n Perl POD document text
  36. 0 search/1/W \n\=pod\n Perl POD document text
  37. 0 search/1/W \=head1\ Perl POD document text
  38. 0 search/1/W \n\=head1\ Perl POD document text
  39. 0 search/1/W \=head2\ Perl POD document text
  40. 0 search/1/W \n\=head2\ Perl POD document text
  41. 0 search/1/W \=encoding\ Perl POD document text
  42. 0 search/1/W \n\=encoding\ Perl POD document text
  43. # Perl Storable data files.
  44. 0 string perl-store perl Storable (v0.6) data
  45. >4 byte >0 (net-order %d)
  46. >>4 byte &01 (network-ordered)
  47. >>4 byte =3 (major 1)
  48. >>4 byte =2 (major 1)
  49. 0 string pst0 perl Storable (v0.7) data
  50. >4 byte >0
  51. >>4 byte &01 (network-ordered)
  52. >>4 byte =5 (major 2)
  53. >>4 byte =4 (major 2)
  54. >>5 byte >0 (minor %d)
  55. # This is Debian #742949 by Zefram <zefram@fysh.org>:
  56. # -----------------------------------------------------------
  57. # The Perl module Hash::SharedMem
  58. # <https://metacpan.org/release/Hash-SharedMem> defines a file format
  59. # for a key/value store. Details of the file format are in the "DESIGN"
  60. # file in the module distribution. Magic:
  61. 0 bequad =0xa58afd185cbf5af7 Hash::SharedMem master file, big-endian
  62. >8 bequad <0x1000000
  63. >>15 byte >2 \b, line size 2^%d byte
  64. >>14 byte >2 \b, page size 2^%d byte
  65. >>13 byte &1
  66. >>>13 byte >1 \b, max fanout %d
  67. 0 lequad =0xa58afd185cbf5af7 Hash::SharedMem master file, little-endian
  68. >8 lequad <0x1000000
  69. >>8 byte >2 \b, line size 2^%d byte
  70. >>9 byte >2 \b, page size 2^%d byte
  71. >>10 byte &1
  72. >>>10 byte >1 \b, max fanout %d
  73. 0 bequad =0xc693dac5ed5e47c2 Hash::SharedMem data file, big-endian
  74. >8 bequad <0x1000000
  75. >>15 byte >2 \b, line size 2^%d byte
  76. >>14 byte >2 \b, page size 2^%d byte
  77. >>13 byte &1
  78. >>>13 byte >1 \b, max fanout %d
  79. 0 lequad =0xc693dac5ed5e47c2 Hash::SharedMem data file, little-endian
  80. >8 lequad <0x1000000
  81. >>8 byte >2 \b, line size 2^%d byte
  82. >>9 byte >2 \b, page size 2^%d byte
  83. >>10 byte &1
  84. >>>10 byte >1 \b, max fanout %d