Schwedler Kofoed wrote:
> 
> Hi There,

Hello,

> I would like to change a array @xx looking like this:
> 
> R23 4587 4985934 3245324 66666
> 
> to:
> 
> R23 458XXXX7 4985934 3245324 6666XXXX6
> 
> with other words I would like to insert (not replace) XXXX at character
> position 8 and 31. I have have tried to use splice and substr but since the
> changes have to occur in the middle of the single scalar ($xx[1] and $xx[5])
> it dos not work (??)

What are you using to determine which array elements to expand?  Always
indexes 1 and 5?  If the number is less than seven digits?  A specific
digit sequence like '458' or '6666'?

You can use substr to insert a character string anywhere in a scalar:

$ perl -le'$scalar = 4587; substr( $scalar, -1, 0, "XXXX" ); print
$scalar'
458XXXX7

perldoc -f substr


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to