[Petal] Re: improvement on the _code_with_line_numbers() method and how to writte my own modifiers?

Bruno Postle bruno@webarchitects.co.uk
Fri, 6 Sep 2002 15:23:45 +0100


On Fri 06-Sep-2002 at 03:11:35PM +0100, Jean-michel Hiver wrote:
> 
> You write a very simple module:

This should be slightly different:

>   package Petal::Hash::Types::Is_Whole;
>   use strict;
>   use warnings;
> 
>   sub process
>   {
>       my $class = shift;
>       my $hash  = shift;
>       my $value = $hash->FETCH (@_);

        return unless($value);
        return unless($value =~ /^\d+$/);
        
>       return 1;
>   }

-- 
Bruno