Should I use Perl or something else?

M

Martin

I'm new to Perl (running it on RH Linux 9); by "new", I mean I just
got past "Hello World"!

I'm trying to decide if Perl is an "appropriate" language to use for
an application I need to develop. A couple of critical factors are the
need for:
(1) two-way communications over multiple serial ports
(2) two-way communications to other computers and devices via
sockets

Of lesser importance is the user interface (the app will run un-manned
- there is little user interaction). The program would run 24/7,
receiving incoming data and sending the results back out.

I have this type of program already working in numerous installations
but it runs on Windows machines and was written in Visual Basic (and
utilizes several 3rd party controls). I also have some older version
that were developed in DOS Basic. I now need to develop a version that
can run in Linux.

Any advice?

Are Perl scripts available that I could adapt for the serial/socket
communications?

Thanks for any tips.
 
B

Ben Morrow

Martin said:
I'm trying to decide if Perl is an "appropriate" language to use for
an application I need to develop. A couple of critical factors are the
need for:
(1) two-way communications over multiple serial ports
(2) two-way communications to other computers and devices via
sockets

Perl is entirely appropriate for that sort of thing.
Are Perl scripts available that I could adapt for the serial/socket
communications?

You want to look into the following modules (perldoc perlmod):

IO::Socket (don't even consider doing socket stuff by hand),
POSIX, the section on POSIX::Termios, for doing serial port control.

You may also find IO::Select useful.

Ben
 
C

Chris

Martin said:
I'm new to Perl (running it on RH Linux 9); by "new", I mean I just
got past "Hello World"!

I'm trying to decide if Perl is an "appropriate" language to use for
an application I need to develop. A couple of critical factors are the
need for:
(1) two-way communications over multiple serial ports
(2) two-way communications to other computers and devices via
sockets

Of lesser importance is the user interface (the app will run un-manned
- there is little user interaction). The program would run 24/7,
receiving incoming data and sending the results back out.

I have this type of program already working in numerous installations
but it runs on Windows machines and was written in Visual Basic (and
utilizes several 3rd party controls). I also have some older version
that were developed in DOS Basic. I now need to develop a version that
can run in Linux.

Any advice?

Are Perl scripts available that I could adapt for the serial/socket
communications?

Thanks for any tips.

You've already received feedback that indicates Perl is great for what
you are wanting to do. Adding whatever GUI interfaces you might want
later using Perl/Tk is always there as an option too (even if GUI
interfaces aren't important right now). But I think your main "win" in
using Perl is the potential to run your app from a single code base
under both Linux and Windows. Or at least get very close to doing that.
Perl/Tk on Windows works rather well too (what very limited playing
around I've done with it.) If you leave your app as VB under Win32 and
Perl under Linux you will have two code bases to manage.

There are plenty of Perl Win32 people lurking around in here to help
with any Win32 Perl issues you would have. Perl under Win32 is quite
powerful. There is little need to speak to its power under *nix...

Chris
 
D

David K. Wall

Martin said:
Are Perl scripts available that I could adapt for the serial/socket
communications?

You might consider a copy of Lincoln Stein's book _Network Programmnig with
Perl_.
 
A

Andy Baxter

At earth time Mon, 12 Jan 2004 19:55:04 +0000, the following transmission
was received from the entity known as Chris:

You've already received feedback that indicates Perl is great for what
you are wanting to do. Adding whatever GUI interfaces you might want
later using Perl/Tk is always there as an option too (even if GUI
interfaces aren't important right now). But I think your main "win" in
using Perl is the potential to run your app from a single code base
under both Linux and Windows. Or at least get very close to doing that.
Perl/Tk on Windows works rather well too (what very limited playing
around I've done with it.) If you leave your app as VB under Win32 and
Perl under Linux you will have two code bases to manage.

There are plenty of Perl Win32 people lurking around in here to help
with any Win32 Perl issues you would have. Perl under Win32 is quite
powerful. There is little need to speak to its power under *nix...

There's also a gtk wrapper for perl which should run under linux and
windows if you want a prettier interface for any GUI bits. See
www.ethereal.com or www.gimp.org for a couple of cross platform apps using
the gtk toolkit.

One thing I've found good about perl is there's a wide choice of free
modules at www.cpan.org (but the search function there isn't so good - try:
http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search?request=search )
 
P

pkent

Martin said:
I'm new to Perl (running it on RH Linux 9); by "new", I mean I just
got past "Hello World"!

Bearing that in mind...
I'm trying to decide if Perl is an "appropriate" language to use for
an application I need to develop. A couple of critical factors are the
need for:
(1) two-way communications over multiple serial ports
(2) two-way communications to other computers and devices via
sockets

Yes indeed, perl can happily do that, with flair, panache, and all that
stuff.

The problem is, you say you're quite new to perl, so you may find this
sort of program quite a jump in complexity from helloworld.pl. OTOH, if
you're proficient in another language (or 2) then you might find it easy
to transfer the skills and concepts into perl.

In either case I recommend this book:
http://modperl.com:9000/perl_networking/
which has lots of examples and covers the network side of things. You
can probably apply many of the same concepts to the serial port comms,
e.g. polling multiple handles.

P
 

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,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top