Froody::Argument::Trim - trim leading and trailing whitespace


Froody documentation Contained in the Froody distribution.

Index


Code Index:

NAME

Top

Froody::Argument::Trim - trim leading and trailing whitespace

AUTHORS

Top

Copyright Fotango 2006. All rights reserved.

Please see the main Froody documentation for details of who has worked on this project.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


Froody documentation Contained in the Froody distribution.

package Froody::Argument::Trim;

use strict;
use warnings;

use base qw(Froody::Argument);

sub type {
  "trim";
}

sub process {
  my ($self, $param, $check ) = @_;

  $param =~ s/^\s+//;
  $param =~ s/\s+$//;
  
  return $param;
}

1;
__END__