Best way to have a formatted output with Perl

前端 未结 4 926
鱼传尺愫
鱼传尺愫 2020-12-15 00:24

I want to output strings into eight columns, but I want to keep the spacing the same. I don\'t want to do it in HTML, but I am not sure how to do it normally. Example:

4条回答
  •  死守一世寂寞
    2020-12-15 01:22

    I would look at formatting, but I would do it using Perl 6's (now Raku) Form.pm, which you can obtain as Perl6::Form for Perl 5.

    The reason for this is that the format builtin has a number of drawbacks, such as having the format statically defined at compile time (i.e., building it dynamically can be painful and usually requires string eval), along with a whole list of other shortcomings, such as lack of useful field types (and you can't extend these in Perl 5).

提交回复
热议问题