http://qs321.pair.com?node_id=56582

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Replies are listed 'Best First'.
Re: How can I delete a part of a string?
by I0 (Priest) on Feb 06, 2001 at 12:15 UTC
    What part of the string do you want to delete?
    You might assign "" to a substr, or you might use s///, or perhaps chomp or chop, depending on how you specify the part to be deleted.
Re: How can I delete a part of a string?
by ariels (Curate) on Feb 15, 2001 at 15:31 UTC
    Expanding on japhy:
    $x = 'Just another COBOL hacker,'; substr($x,13,5) = 'Perl';
    Saying substr($x,13,5,'Perl') would work as well, but I find it less clear.
Re: How can I delete a part of a string?
by japhy (Canon) on Feb 06, 2001 at 06:23 UTC