perl 1.6 KB

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