in reply to Once more, question about Formats


I posted an updated solution to this here Re: How to route a format into a variable.

The reason that ~~ doesn't really work with formline() is explained in perlfunc:

formline PICTURE,LIST ... Note that a format typically does one `formline' per line of form, but the `formline' function itself doesn't care how many newlines are embedded in the PICTURE. This means that the `~' and `~~' tokens will treat the entire PICTURE as a single line. You may therefore need to use multiple formlines to implement a single record format, just like the format compiler. ...

--
John.

Replies are listed 'Best First'.
Re: Re: Once more, question about Formats
by ppm (Novice) on Feb 14, 2003 at 12:42 UTC
    Hey jmcnamara,

    youre the best ;o) thx a lot! i've learned much about formats in perl. i never looked at this topic before but now i need to use it.

    Btw .. do you know a better way to make a output like this in my e.g.? or is the usage of formats allready up to dat?

    beste regardes

    ppm

      I think in your case you should be fine with formats. However, if you have something more complex or would like to split up code and layout, then a templating system might be a good solution, see e.g. a discussion on Text::Template here at PM, with pointers to other templating modules.

      -- Hofmator