Changeset 5253
- Timestamp:
- Oct 7, 2005, 4:09:05 PM (21 years ago)
- Location:
- trunk/PS-IPP-PSFTP
- Files:
-
- 2 edited
-
Build.PL (modified) (1 diff)
-
lib/PS/IPP/PSFTP/Parser.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PSFTP/Build.PL
r5252 r5253 8 8 license => 'gpl', 9 9 create_makefile_pl => 'passthrough', 10 requires => { 11 'Params::Validate' => '0.77', 12 }, 10 13 build_requires => { 11 14 'Test::Warn' => '0.08', -
trunk/PS-IPP-PSFTP/lib/PS/IPP/PSFTP/Parser.pm
r5248 r5253 1 1 # Copyright (C) 2005 Joshua Hoblitt 2 2 # 3 # $Id: Parser.pm,v 1. 2 2005-10-08 01:20:12jhoblitt Exp $3 # $Id: Parser.pm,v 1.3 2005-10-08 02:09:05 jhoblitt Exp $ 4 4 5 5 package PS::IPP::PSFTP::Parser; … … 8 8 9 9 use Carp qw( carp ); 10 use Params::Validate qw( validate_pos SCALAR ); 10 11 11 12 use vars qw( @FIELDS @REQUIRED_FIELDS ); … … 16 17 sub new 17 18 { 18 my ($class, %parameters) = @_;19 my $class = shift; 19 20 20 my $self = bless ({}, ref ($class) || $class); 21 validate_pos(@_); 22 23 my $self = bless {}, ref ($class) || $class; 21 24 22 25 return $self; … … 25 28 sub parse 26 29 { 27 my ($self, $doc) = @_; 30 my $self = shift; 31 32 my ($doc) = validate_pos(@_, 33 { 34 type => SCALAR, 35 regex => qr/\S+/, # string with atleast 1 non WS char 36 } 37 ); 28 38 29 39 # pack data into an HoH
Note:
See TracChangeset
for help on using the changeset viewer.
