Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 26 lines (17 sloc) 0.496 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#!/usr/bin/perl

# Copyright 2004, Paul Johnson (pjcj@cpan.org)

# This software is free. It is licensed under the same terms as Perl itself.

# The latest version of this software should be available from my homepage:
# http://www.pjcj.net

package Foo;

sub is_3digits {
    my $val = shift;
    my $retval = undef;
    $retval=1 if $val =~ /^\d{3}$/;
    return $retval;
}

package main;

*main::is_3digits = *Foo::is_3digits;
# delete $Foo::{is_3digits};

is_3digits(1234);
is_3digits(123);
Something went wrong with that request. Please try again.