Thanks for the info. Your example is great. I've tried it on occasion, but it always comes back to haunt me, so I don't fiddle around unless it's absolutely necessary:). There are times when I can see using line numbers. For example, when I'm editing a post and the line number would be helpful like this, looking at a charblock:
#!/usr/bin/perl use strict; use warnings; use PerlIO::via::LineNumber; my $post = '/root/Desktop/myLines.log'; die unless open my $out, '>via(LineNumber)', $post; print $out <<'EOD'; { bidi => "L", block => "Basic Latin", category => "Lu", code => "0041", combining => 0, comment => "", decimal => "", decomposition => "", digit => "", lower => "0061", mirrored => "N", name => "LATIN CAPITAL LETTER A", numeric => "", script => "Latin", title => "", unicode10 => "" upper => "" } EOD print $out; close $out;
With line numbers:
1 { 2 bidi => "L", 3 block => "Basic Latin", 4 category => "Lu", 5 code => "0041", 6 combining => 0, 7 comment => "", 8 decimal => "", 9 decomposition => "", 10 digit => "", 11 lower => "0061", 12 mirrored => "N", 13 name => "LATIN CAPITAL LETTER A", 14 numeric => "", 15 script => "Latin", 16 title => "", 17 unicode10 => "" 18 upper => "" 19 }

In reply to Re: Line Numbering in Code Listings by Khen1950fx
in thread Line Numbering in Code Listings by Xiong

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.