Help for this page

Select Code to Download


  1. or download this
    sub detaint_1 {
        $[0] =~ /^(.*)$/;
        return $1;
    }
    
  2. or download this
    sub detaint_1_inp {
        $[0] =~ /^(.*)$/;
        $[0] = $1;
    }
    
  3. or download this
    sub detaint_n {
        map { /^(.*)$/; $1 } @_;
    ...
    sub detaint_n_inp {
        foreach (@_) { /^(.*)$/; $_ = $1}
    }
    
  4. or download this
    my @a;
    # ... set @a ... 
    my @b = map { detaint_1 } @a;   # Copy
    detaint_1_inp($_) foreach (@a); # In-place
    
  5. or download this
    sub detaint {
        my $subref = sub { $_[0] =~ /^(.*)$/; $1 };
    ...
        $_ = &$subref($_) foreach (@_);                 # In-place
        return;
    }
    
  6. or download this
    sub apply_filter {
        my $subref = shift;
    ...
            $v;
        }, @_);
    }