re: Search and substutiing text and adding in a carriage return?

From: FlashMX (FlashMX_at_sympatico.ca)
Date: 11/25/04

  • Next message: ds10025_at_cam.ac.uk: "Debug a form that requires input variables"
    To: "beginners@perl.org" <beginners@perl.org>
    Date: Thu, 25 Nov 2004 08:51:27 -0500
    
    

    Hi,

    How can I enter in a carriage return when doing a text substitution?

    while ( <INPUT> ) {
    if (/FIND_MATCH/) {
    s/AAA/BBB CCC/;
    }

    Input file
    =======

    111 222 333 AAA
    444 555 666 7777

    Output file
    ========

    111 222 333 BBB CCC
    444 555 666 7777

    Is it possible to have the output like so (with a carriage return)?

    Output file
    ========

    111 222 333 BBB
    CCC
    444 555 666 7777


  • Next message: ds10025_at_cam.ac.uk: "Debug a form that requires input variables"

    Relevant Pages