For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > January 2008 > C's gotoxy() equivalent in Perl









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author C's gotoxy() equivalent in Perl
Yogi

2008-01-30, 4:29 am

Hi,
I am trying to print something on my screen at specific location. Do
we have anything equivalent to gotoxy() , as we have in C language, in
Perl? I tried using Term::Cap but not getting any success.
Getting an error message : "TERM not set at...".

I am trying to run my perl script on Windows envt.
Perl version = v5.8.8 built for MSWin32-x86-multi-thread

Any pointers/help?
John W. Krahn

2008-01-30, 4:29 am

Yogi wrote:
> Hi,
> I am trying to print something on my screen at specific location. Do
> we have anything equivalent to gotoxy() , as we have in C language, in
> Perl? I tried using Term::Cap but not getting any success.
> Getting an error message : "TERM not set at...".
>
> I am trying to run my perl script on Windows envt.
> Perl version = v5.8.8 built for MSWin32-x86-multi-thread


gotoxy() is not a C language function, it is a Curses function:

http://search.cpan.org/~giraffed/Cu.../make.Curses.pm


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
Yogi

2008-01-30, 7:18 pm

On Jan 30, 3:24 pm, "John W. Krahn" <some...@example.com> wrote:
> Yogi wrote:
>
>
> gotoxy() is not a C language function, it is a Curses function:
>
> http://search.cpan.org/~giraffed/Cu.../make.Curses.pm
>
> John
> --
> Perl isn't a toolbox, but a small machine shop where you
> can special-order certain sorts of tools at low cost and
> in short order. -- Larry Wall


Thanks John for providing me link. I believe, I will have to install
Curses as its not available in perl version I am using.
Regards,
-YK
Ben Morrow

2008-01-30, 7:18 pm


Quoth Yogi <yogeshkagrawal@gmail.com>:
> Hi,
> I am trying to print something on my screen at specific location. Do
> we have anything equivalent to gotoxy() , as we have in C language, in
> Perl? I tried using Term::Cap but not getting any success.
> Getting an error message : "TERM not set at...".
>
> I am trying to run my perl script on Windows envt.
> Perl version = v5.8.8 built for MSWin32-x86-multi-thread


Term::Cap won't work under Windows. I would recommend Term::ANSIScreen
for what you're trying to do; you could also look at Win32::Console.

Ben

Gerry Ford

2008-01-30, 7:18 pm


"Yogi" <yogeshkagrawal@gmail.com> wrote in message
news:7bb7b711-0fbb-423a-9d5a-f134a1e78133@k2g2000hse.googlegroups.com...
> On Jan 30, 3:24 pm, "John W. Krahn" <some...@example.com> wrote:
>
> Thanks John for providing me link. I believe, I will have to install
> Curses as its not available in perl version I am using.

Maybe one way to get what you want is to install Ruby and borrow the curses.
I frankly don't know a curse from a gem or a rake, but since Ruby was
created using MVC++6, it might be better for windows stuff than the
equivalent from perl.

PDCurses 2.60-1
--
Gerry Ford


Ben Morrow

2008-01-30, 7:18 pm


Quoth "Gerry Ford" <invalid@invalid.net>:
> "Yogi" <yogeshkagrawal@gmail.com> wrote in message
> news:7bb7b711-0fbb-423a-9d5a-f134a1e78133@k2g2000hse.googlegroups.com...
>
> Maybe one way to get what you want is to install Ruby and borrow the curses.
> I frankly don't know a curse from a gem or a rake, but since Ruby was
> created using MVC++6, it might be better for windows stuff than the
> equivalent from perl.


ActivePerl is build using MSVC6, and if the OP has MSVC (and Curses will
build under Windows at all) it will build perfectly well. Also, recent
versions of ActivePerl have some provision for using MinGW to build
modules that are compatible with perl.

Ben

Gerry Ford

2008-01-30, 7:18 pm


"Ben Morrow" <ben@morrow.me.uk> wrote in message
news:t7d675-4je.ln1@osiris.mauzo.dyndns.org...
>
> Quoth "Gerry Ford" <invalid@invalid.net>:
>
> ActivePerl is build using MSVC6, and if the OP has MSVC (and Curses will
> build under Windows at all) it will build perfectly well. Also, recent
> versions of ActivePerl have some provision for using MinGW to build
> modules that are compatible with perl.


Good Grief! I thought I was a certifiable dinosaur to even possess MVC 4
and 6, unwilling as I was to cross the dot net threshold, and now you say
it's building the scripting languages on the world's platform of choice. Do
you know of any web resources that talk about how MVC can augment an AS or a
Ruby install?
--


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com