perl 3.6 KB

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