Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Answer: How do I insert, (not overwrite) into a string?

by bluescreen (Friar)
on May 27, 2010 at 13:02 UTC ( [id://841913]=note: print w/replies, xml ) Need Help??


in reply to Re: How do I insert, (not overwrite) into a string?
in thread How do I insert (not overwrite) into a string?

try this:
#!/usr/bin/perl use strict; sub insert_x_into_y_at_z { my ( $x, $y, $z) = @_; $y =~s/^(.{$z})/$1$x/; return $y; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://841913]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-26 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found