PERL   68

Default

Guest on 19th August 2022 04:41:38 PM

  1. # -*- Mode: perl; tab-width: 4; indent-tabs-mode: nil; -*-
  2. #
  3. # This file is MPL/GPL dual-licensed under the following terms:
  4. #
  5. # The contents of this file are subject to the Mozilla Public License
  6. # Version 1.1 (the "License"); you may not use this file except in
  7. # compliance with the License. You may obtain a copy of the License at
  8. # http://www.mozilla.org/MPL/
  9. #
  10. # Software distributed under the License is distributed on an "AS IS"
  11. # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
  12. # the License for the specific language governing rights and
  13. # limitations under the License.
  14. #
  15. # The Original Code is PLIF 1.0.
  16. # The Initial Developer of the Original Code is Ian Hickson.
  17. #
  18. # Alternatively, the contents of this file may be used under the terms
  19. # of the GNU General Public License Version 2 or later (the "GPL"), in
  20. # which case the provisions of the GPL are applicable instead of those
  21. # above. If you wish to allow use of your version of this file only
  22. # under the terms of the GPL and not to allow others to use your
  23. # version of this file under the MPL, indicate your decision by
  24. # deleting the provisions above and replace them with the notice and
  25. # other provisions required by the GPL. If you do not delete the
  26. # provisions above, a recipient may use your version of this file
  27. # under either the MPL or the GPL.
  28.  
  29. package PLIF::Input::Default;
  30. use strict;
  31. use vars qw(@ISA);
  32. use PLIF::Input::Arguments;
  33. @ISA = qw(PLIF::Input::Arguments);
  34. 1;
  35.  
  36. sub applies {
  37.     return 1;
  38. }
  39.  
  40. sub defaultOutputProtocol {
  41.     return 'stdout';
  42. }
  43.  
  44. sub getMetaData {
  45.     my $self = shift;
  46.     my($field) = @_;
  47.     if ($field eq 'host') {
  48.         return 'localhost';
  49.     } elsif ($field eq 'acceptType') {
  50.         return 'text/plain';
  51.     } else {
  52.         return $self->SUPER::getMetaData($field);
  53.     }
  54. }
  55.  
  56. # Everything else that PLIF::Input::Arguments does by default is great
  57. # for this. Namely, no command, and returning 'undef' for everything.

Raw Paste


Login or Register to edit or fork this paste. It's free.