473,473 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Perl Script on Linux OS

57 New Member
Hello all,
I have written a pretty lengthy Perl script using Win32. Now i need to take this same script and run it on a Linux operating system. I'm not familiar with Linux at all, so I've been researching it for a few days. I feel like it's a little over my head. Or am I looking too much into it? Or maybe I'm looking in the wrong places.

Is there a straightforward way to convert this script and run it on Linux? Or can anyone direct me to a site that will explain how to do this?

Thanks,
Terra
Jan 17 '08 #1
5 1579
numberwhun
3,509 Recognized Expert Moderator Specialist
Hello all,
I have written a pretty lengthy Perl script using Win32. Now i need to take this same script and run it on a Linux operating system. I'm not familiar with Linux at all, so I've been researching it for a few days. I feel like it's a little over my head. Or am I looking too much into it? Or maybe I'm looking in the wrong places.

Is there a straightforward way to convert this script and run it on Linux? Or can anyone direct me to a site that will explain how to do this?

Thanks,
Terra
The first thing you would need to do is insert the shebang line (the first line in the script on a unix system. It should read:

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl 
  2.  
That will tell the system what to use to run the script when it is executed. Next, you need to ensure that all paths reference Unix paths, and not windows. You are on a different OS now.

After that, you need to make sure the script is executable:

Expand|Select|Wrap|Line Numbers
  1. chmod +x <scriptname>
  2.  
and then just run it using:

Expand|Select|Wrap|Line Numbers
  1. ./<scriptname>
  2.  
if you are in the same directory, or use the full path in place of the "./".

Hope that helps.

Regards,

Jeff
Jan 17 '08 #2
Perl Beginner
57 New Member
Yes Jeff! That helps a lot. I'm going to digest what you've said for a while. i may have more questions later.

Thank you!
Terra
Jan 17 '08 #3
numberwhun
3,509 Recognized Expert Moderator Specialist
Yes Jeff! That helps a lot. I'm going to digest what you've said for a while. i may have more questions later.

Thank you!
Terra
No problem Terra! Ask away when you are ready.

Regards,

Jeff
Jan 17 '08 #4
KevinADC
4,059 Recognized Expert Specialist
Hello all,
I have written a pretty lengthy Perl script using Win32. Now i need to take this same script and run it on a Linux operating system. I'm not familiar with Linux at all, so I've been researching it for a few days. I feel like it's a little over my head. Or am I looking too much into it? Or maybe I'm looking in the wrong places.

Is there a straightforward way to convert this script and run it on Linux? Or can anyone direct me to a site that will explain how to do this?

Thanks,
Terra
If the script is not meant to run exclusively in a Windows environment, but is a sort of general application, then converting should be pretty straight forward and in fact may not require you do anything besides add or change the shebang line.

On the other hand, if you are using Win32 modules the script will need to be modified to work on other operating systems.
Jan 17 '08 #5
Perl Beginner
57 New Member
If the script is not meant to run exclusively in a Windows environment, but is a sort of general application, then converting should be pretty straight forward and in fact may not require you do anything besides add or change the shebang line.

On the other hand, if you are using Win32 modules the script will need to be modified to work on other operating systems.

Yes, I thought about that. in my script i have created GUI windows using Win32::XMLBuilder, so i'm going to have to figure out how to create GUI windows for that operating system.

Terra
Jan 23 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: DP | last post by:
(2nd post, I think my first may have been to the wrong group - sorry) Hello Perl-ers - I´m hoping I can get some help here, because I'm very lost. Don't know Perl, I'm not a programmer. And...
3
by: David F. Skoll | last post by:
Hi, I'm tearing my hair out on this one. I'm trying to embed a Perl interpreter into a C program. I need to be able to create and destroy the interpreter periodically, but will never actually...
4
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
0
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile....
4
by: Ignoramus6539 | last post by:
There were some strange requests to my server asking for config.php file (which I do not have in the requested location). I did some investigation. Seems to be a virus written in perl,...
1
by: graphman | last post by:
I have a perl script that I'm calling using php's shell_exec that uses an expect module to go to another system to pull tiff files. The php perl combination works great when I launch from the...
9
by: 8anos | last post by:
Hello, I am new at the community and newbie at programming :) As you may know rapidshare provides a perl script for linux, to upload files at their servers. You can find the original scripts at...
1
by: pvenu | last post by:
Hi, I know basic perl (regular expressions, pattern matching, string manipulation, reading writing into text files). Yet, my requirement is to read an input text file -> process this input file...
0
by: Rebles | last post by:
I'm writing a PERL script to access and insert rows into a Microsoft SQL. i'm using MS SQL Server Management Studio Express (2005) to architect tables and queries. I've inserted two records into...
1
by: Rebles | last post by:
Hi, I just posted this in the MS SQL Section, but maybe my problem is rooted in Perl, so it's more appropriate to post here instead (sorry for the double post) I'm writing a PERL script to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.