develooper Front page | perl.perl5.porters | Postings from May 2008

Re: Porting perl script on Vxworks

Thread Previous
From:
Dominic Dunlop
Date:
May 5, 2008 03:05
Subject:
Re: Porting perl script on Vxworks
On 2008–05–05, at 07:12, Bhavna YADAV wrote:
> Can you help me to port perl script on Vxworks RTOS.

Probably not. I'll explain why.

The mail list you posted to is concerned with getting perl itself --  
rather than scripts written in Perl -- running on as many platforms as  
possible, and keeping it running on them. Wind River's version of Perl  
for VxWorks has been ported independently, and nobody on the mail list  
has written about the VxWorks it since 2001 (as far as I can tell),  
so, unless there is a subscriber who has been keeping very quiet, none  
of us has knowledge of your platform.
>
> I am very new to vxworks and to perl as well.

Well, the good news about Perl scripts is that, provided they do not  
try to do low-level stuff with the operating system or hardware,  
they're portable -- especially if the original programmer was  
programming for portability (and knew what they were doing). With  
luck, your script will work without change. With a little less luck,  
the changes needed won't be large. With no luck at all, it's a badly- 
written script that does low-level things (even if it does not need  
to) and you may be better off rewriting it.

In a real-time, possibly embedded environment, one issue I can see is  
that of modules. The lazy, impatient way to write Perl (which  
encourages both laziness and impatience) is to use as many external  
modules written by others as possible. Current versions of Perl ship  
with many modules, and there are thousands more at the public source,  
CPAN (http://www.cpan.org). However, if you are targeting an embedded  
environment with a script written for (say) a server, you may find it  
calls out modules that you can't access from the embedded environment  
for reasons of space, efficiency -- or even licensing. In that case,  
sorry, but you'll have to code replacements for those parts of the  
unavailable modules you actually need.

As a hint, first get the script running on a less unusual platform  
than VxWorks (Linux, Windows, ...) then, when you're sure that you  
know what it's doing and how it's doing it, start on the porting  
exercise. If you're happy using a debugger, perl's debugger (see the  
perldebug man page) will help you; if not, do what the rest of the  
world does, and add print statements to the script to show you what's  
happening.
>
> I really wonder if a amateur like me can port the perl script on  
> VxWorks.

Everyone's an amateur to start with. And I'll bet you know more about  
VxWorks than I do! My guess is that your best bet for support is  
resources accessible through Wind River (which live behind a log-in  
screen, so I can't see what they are). Other possibilities are the  
Perl Monks' web site (http://www.perlmonks.org) and the comp.lang.perl  
newsgroup. (There is a real-time Perl mailing list, http://www.nntp.perl.org/group/perl.rtos 
, but it's utterly dead.) And, if I were you, I'd see if I could get  
ST to send me on a training course or two: the company seems to be  
doing well enough...
-- 
Dominic Dunlop


-- 
Dominic Dunlop



Thread Previous


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About