Stephan Hochhaus wrote:
> 
> A question I assume can be answered using regexp, unfortunately I am
> just starting my way into it. I have a bunch of words that I want to
> split, so that the first letters (minus n) and the last n-letters are
> seperated.
> n is user defined and therefore not static.
> 
> How can I have Perl split at the last n-letters from the end of a word?
> 
> Any help is appreciated (hints as where to find the answer myself
> without buying a book are also very welcome!)


$last = substr $first = $word, -$n, $n, '';



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to