I've put together a sample of how you could achieve
what you want.
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @a; my $x = 0; my $y = 0; #fill with 0 all the matrix with one loop(no need for two really :) ) $a[$_/8][$_%8]=0 for 0..63;#it's a 7x7 matrix :) #initialisation of matrix with provided data $a[0][0]=4; $a[0][1]=4; $a[0][2]=4; $a[0][3]=4; $a[0][4]=0; $a[0][5]=0; $a[0][6]=4; $a[0][7]=0; #matrix transpose calculated while(exists $a[$y][0] && $x<=$y) { # the last condition here is due to not # getting to lower triangle and transposing them # back getting exactly what we started with # wich we obviously don't want $x = 0; #reset $x for a new pass tghrough the current row while(exists $a[0][$x]) { ($a[$y][$x],$a[$x][$y]) = ($a[$x][$y],$a[$y][$x]) ; #swap the current element to its corresponding position in the + transpose $x++;#increase the column }; $y++;#increase the row }
Good luck!

In reply to Re: Font bitmaps manipulation in perl (transposing row like font description to column like).... by spx2
in thread Font bitmaps manipulation in perl (transposing row like font description to column like).... by Anonymous Monk

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.