I'm not sure if it's a bug or an expected behavior, but it seems that I can't use constants in m/.{m}/ and I see no references to it in the perlre manpage. I'm trying to split string into substrings of SIZE chars and a remainder. unpack "(A" . SIZE . ")*", $string does the job: % perl-5.8.1 -le 'use constant SIZE => 4; \ print join "-", unpack "(A" . SIZE . ")*", join "", "a".."z";' abcd-efgh-ijkl-mnop-qrst-uvwx-yz but it doesn't work in 5.6.1. So I've tried to use a regex, but the only way I could embed a constant in m/.{m}/ was using the string interpolation workaround: @{[SIZE]}} % perl-5.8.1 -le 'use constant SIZE => 4; $_ = join "", "a".."z"; my @w = /(.{@{[SIZE]}}|.+)/g; print join "-", @w' abcd-efgh-ijkl-mnop-qrst-uvwx-yz I can neither do: m/.{+SIZE}/ nor m/.{SIZE()}/ which I've tried to use, which is the usual trick for using constants in the hash keys. I know that {} here don't do the same thing, but I see no reason why shouldn't they behave identically to hash's {} brackets. __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:stas@stason.org http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.comThread Next