#!/usr/bin/perl -- =head1 NAME Regexp::CharProps - User Defined Character Properties =head1 SYNOPSIS use Regexp::CharProps qw/ Thai /; ## like use Regexp::CharProps::Thai qw/ :all /; ## imports all exports like sub InThaiPunct... print "\$_ has got Thai" if m{ \p{InThai} |\p{InThaiCons} |\p{InThaiHCons} |\p{InThaiMCons} |\p{InThaiLCons} |\p{InThaiVowel} |\p{InThaiPreVowel} |\p{InThaiPostVowel} |\p{InThaiCompVowel} |\p{InThaiDigit} |\p{InThaiTone} |\p{InThaiPunct} }x; use Regexp::CharProps::Thai qw/ InThaiPunct /; ## not import :all just sub InThaiPunct print "got Thai punctuation\n" if m/\p{InThaiPunct}/; =cut package Regexp::CharProps; sub import { my( $class, @modsforall ) = @_; return if not @modsforall; my $target = scalar caller; require Import::Into; for my $mod( @modsforall ){ my $package = $class."::".$mod; $package ->import::into( $target , ':all' ); } } 1;