Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, How do I go about printing chars in the xth column of the screen ?

Replies are listed 'Best First'.
(jeffa) Re: Printing to a column
by jeffa (Bishop) on May 27, 2002 at 04:06 UTC
    Curses allows you to do this with it's addstr() method. The second argument is the column position:
    use strict; use Curses; my $win = Curses->new; for (0..60) { $win->addstr(10, $_, 'x'); $win->refresh; select(undef,undef,undef,.02); # sleep for less than a second $win->clear; }

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re: Printing to a column
by mephit (Scribe) on May 27, 2002 at 03:42 UTC
    This is probably a homework problem, so I'll just suggest that you look up the repetition operator in the perlop manpage (in the "Multiplicative Operators" secion), and just print out the corresponding number of spaces. There's probably a funkier WTDI, though.

    --

    There are 10 kinds of people -- those that understand binary, and those that don't.