C's gotoxy() equivalent in Perl

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?
yogi [ Mi, 30 Januar 2008 11:14 ] [ ID #1920429 ]

Re: C's gotoxy() equivalent in Perl

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/Curses-1.20/gen/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
someone [ Mi, 30 Januar 2008 11:24 ] [ ID #1920430 ]

Re: C's gotoxy() equivalent in Perl

On Jan 30, 3:24 pm, "John W. Krahn" <some... [at] example.com> wrote:
> 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/Curses-1.20/gen/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
yogi [ Mi, 30 Januar 2008 11:43 ] [ ID #1920431 ]

Re: C's gotoxy() equivalent in Perl

Quoth Yogi <yogeshkagrawal [at] 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
Ben Morrow [ Mi, 30 Januar 2008 13:48 ] [ ID #1920433 ]

Re: C's gotoxy() equivalent in Perl

"Yogi" <yogeshkagrawal [at] gmail.com> wrote in message
news:7bb7b711-0fbb-423a-9d5a-f134a1e78133 [at] k2g2000hse.googleg roups.com...
> On Jan 30, 3:24 pm, "John W. Krahn" <some... [at] example.com> wrote:
>> 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/Curses-1.20/gen/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.
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
Frank Silvermann [ Mi, 30 Januar 2008 14:42 ] [ ID #1920436 ]

Re: C's gotoxy() equivalent in Perl

Quoth "Gerry Ford" <invalid [at] invalid.net>:
> "Yogi" <yogeshkagrawal [at] gmail.com> wrote in message
> news:7bb7b711-0fbb-423a-9d5a-f134a1e78133 [at] k2g2000hse.googleg roups.com...
> >
> > 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.

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
Ben Morrow [ Mi, 30 Januar 2008 15:12 ] [ ID #1920440 ]

Re: C's gotoxy() equivalent in Perl

"Ben Morrow" <ben [at] morrow.me.uk> wrote in message
news:t7d675-4je.ln1 [at] osiris.mauzo.dyndns.org...
>
> Quoth "Gerry Ford" <invalid [at] invalid.net>:
>> "Yogi" <yogeshkagrawal [at] gmail.com> wrote in message
>> news:7bb7b711-0fbb-423a-9d5a-f134a1e78133 [at] k2g2000hse.googleg roups.com...
>> >
>> > 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.
>
> 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?
--
Frank Silvermann [ Mi, 30 Januar 2008 17:04 ] [ ID #1920451 ]
Perl » comp.lang.perl.misc » C's gotoxy() equivalent in Perl

Vorheriges Thema: Can't call NEXT::f from B::g
Nächstes Thema: Get an arbitrary hash key, quickly.