Perl

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Changing the output record separator

    0 answers - 1430 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    From: "IvorW" <myyk-xcr8 (AT) xemaps (DOT) com>
    I have a need to output lines of text from TT with full <CR><LF>. This is
    because I am using Template Toolkit to generate SWIFT messages, for
    which the format requies the carriage return (I'm doing this on Solaris by
    the way).
    Currently, I have an application that works - using a template with
    embedded carriage returns. Unfortunately, these embedded <CR>s
    have been foobared by the version control system, which has, as a
    result, become very confused about which operating system platform
    the template file is for. So, I have resolved to solve this in code, and
    have a "clean" template with no embedded control characters.
    Rather than hardcoding the output postprocessing, I want to do <CR><LF>
    line endings conditionally, based on some logic inside the template.
    Is this something others have done already?
    What's the simplest way to do it?
    When I do text files where I need to conditionally output a line I do:
    [% IF whatever %]WARNING: Special Note![% "\n" %][% END -%]
    This statement outputs the data on its own line if the condition is true and
    outputs nothing if the condition is false.
    I think that fits your problem description.
    Todd W.
    templates mailing list
    templates (AT) template-toolkit (DOT) org

Re: Changing the output record separator


max 4000 letters.
Your nickname that display:
In order to stop the spam: 5 + 4 =
QUESTION ON "Perl"

EMSDN.COM