Convert perl/ cgi web app to standalone perl app

L

learnerplates

I have a perl/cgi web application, running on ana pache server.
The web application has radiobuttons, textfields, combo boxes, submit
buttons etc.
I want to write a standalone perl version. Can this be done and if so
how ?

Thanks.
 
G

Gunnar Hjalmarsson

learnerplates said:
I have a perl/cgi web application, running on ana pache server.
The web application has radiobuttons, textfields, combo boxes, submit
buttons etc.
I want to write a standalone perl version. Can this be done

Yes, can't see why not.

But why do you want to do it?
and if so how ?

By replacing the CGI parameters with command line arguments, change the
code for parsing CGI data to parse arguments, and modify the code for
generating output.
 
I

Ian Wilson

learnerplates said:
I have a perl/cgi web application, running on ana pache server.
The web application has
I want to write a standalone perl version. Can this be done and if so
how ?

Perl/Tk allows you to write apps with GUI widgets such as "radiobuttons,
textfields, combo boxes, submit buttons etc."
 
C

Christopher Nehren

Perl/Tk allows you to write apps with GUI widgets such as "radiobuttons,
textfields, combo boxes, submit buttons etc."

As does Perl/GTK+, and it won't make your eyes bleed like Tk will.

Best Regards,
Christopher Nehren
 
J

John Bokma

Christopher said:
As does Perl/GTK+, and it won't make your eyes bleed like Tk will.

I have experience with WxWidgets, which I didn't like much. How does it
compare with GTK+?
 
C

Christopher Nehren

I have experience with WxWidgets, which I didn't like much. How does it
compare with GTK+?

[This is really becoming off-topic for this group, but I'm not sure of
where to redirect the discussion; comp.linux.development.apps or
whatever it is doesn't make sense, since at least I'm not using Linux,
and neither Perl or GTK+ are Linux-specific.]

WxWidgets uses the GTK+ widget set on Unix systems to do the actual
rendering, but that's where the similarities end. I've found GTK+ to be
a much simpler, more intuitive interface to GUI development than WxPerl.
For example, you aren't *absolutely positively required* to subclass
from anything to write Perl/GTK+ applications. It's OO, in a language
that supports OO (which is more than can be said for plain C/GTK+), but
not the sort that forces one particular programming style on you[1].
Perl/GTK+ allows you to follow normal Perl practises: make a window
object, add some widgets to it, optionally add signal handlers, show it,
enter the main event loop. You don't need to derive from a class to do
anything, but you can if you want (and it's necessary if you want to
extend a widget's behaviour). For a simple, working example, read the
very top of Gtk2.pm's POD in the Gtk2 module.

[1]: I'm sure that the Wx developers had at least one very good reason
for doing things that way; it just doesn't fit me all that well.

Best Regards,
Christopher Nehren
 
J

John Bokma

Christopher said:
I have experience with WxWidgets, which I didn't like much. How does
it compare with GTK+?

[This is really becoming off-topic for this group,

Nope, it's about GUI libraries for Perl, which I consider on-topic :-D
WxWidgets uses the GTK+ widget set on Unix systems to do the actual
rendering, but that's where the similarities end.

Yes, and Windows API for Windows :) But it looks almost as ugly as Tk
(on Windows).
I've found GTK+ to be
a much simpler, more intuitive interface to GUI development than
WxPerl. For example, you aren't *absolutely positively required* to
subclass from anything to write Perl/GTK+ applications. It's OO, in a
language that supports OO (which is more than can be said for plain
C/GTK+), but not the sort that forces one particular programming style
on you[1].

For Wx I found the documentation hard, incomplete, etc. I had to guess a
lot, and experiment a lot, two things that I don't consider part of
programming. I had no problem with *you have to subclass*, but I can
imagine that the forcing can be annoying for small things. (I don't like
force either, life will find a way :-D ).
Perl/GTK+ allows you to follow normal Perl practises: make a window
object, add some widgets to it, optionally add signal handlers, show
it, enter the main event loop. You don't need to derive from a class
to do anything, but you can if you want (and it's necessary if you
want to extend a widget's behaviour). For a simple, working example,
read the very top of Gtk2.pm's POD in the Gtk2 module.

But how good is the documentation? With Wx, there are plenty of
extremely simple examples, but I had a hard time to do real work based
on the samples.

Thanks,
 
C

Christopher Nehren

But how good is the documentation? With Wx, there are plenty of
extremely simple examples, but I had a hard time to do real work based
on the samples.

The API references are automatically generated, at least when last I
checked. The C API documentation helps a lot, and is excellent.

I personally believe that the best way for one to evaluate a package is
to try it. You can download the Gtk2 module from CPAN or SourceForge.

Best Regards,
Christopher Nehren
 
J

John Bokma

Christopher said:
The API references are automatically generated, at least when last I
checked. The C API documentation helps a lot, and is excellent.

I personally believe that the best way for one to evaluate a package is
to try it.

I agree, but since I already have some understanding of Wx I was wondering
if it's worth to evaluate Gtk. It has been on my todo list for months, so
any excuse to speed up evaluation is ok :-D. On the other hand, if several
people say it's not worth it, I leave it on the list.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top