Perl script - Linux to Windows

G

guru

HI

I have written a script which runs successfully in Linux. But When I
took same script and ran in Windows it is failing.

I tried to figure out if there any problem with following,

1. Paths handling --> Wheter this should be handled.
I came to know that perl will handle path structure depending
on the OS.
2. Configuration setting.

Any other parameters I need to look while porting to Windows.

Thanks & Regards
Gururaja
 
N

Noway

guru said:
HI

I have written a script which runs successfully in Linux. But When I
took same script and ran in Windows it is failing.

How do you know that it fails under win?
 
G

Gunnar Hjalmarsson

guru said:
HI

I have written a script which runs successfully in Linux. But When I
took same script and ran in Windows it is failing.

I tried to figure out if there any problem with following,

1. Paths handling --> Wheter this should be handled.
I came to know that perl will handle path structure depending
on the OS.
2. Configuration setting.

Any other parameters I need to look while porting to Windows.

There is a bug at line 126 of the script.
 
G

guru

There is a bug at line 126 of the script.

Thanks Gunnar. I got the answer. This is a general question that I
asked. While porting I faced some problem with path and configuration.
So I asked any other I need to consider.
 
G

guru

How do you know that it fails under win?

Scenario is fun1.pl is calling fun2.pl, while passing it is passing
list of files too.
In fun2.pl i am failing to read those file.

What I got is if file is passed like 'filename1' then fun2.pl will
fail to open it, so I passed without '' and it worked.
 
R

RedGrittyBrick

guru said:
Scenario is fun1.pl is calling fun2.pl,

Presumably using system() or backticks.

while passing it is passing
list of files too.
In fun2.pl i am failing to read those file.

What I got is if file is passed like 'filename1' then fun2.pl will
fail to open it, so I passed without '' and it worked.

Sounds fragile, maybe you should convert fun2.pl to a module fun2.pm so
that you are not dependant on the quirks of shells in various operating
systems.
 
J

Jürgen Exner

guru said:
I have written a script which runs successfully in Linux. But When I
took same script and ran in Windows it is failing.

I tried to figure out if there any problem with following,

1. Paths handling --> Wheter this should be handled.
I came to know that perl will handle path structure depending
on the OS.

Depends on what you mean. Obviously Windows doesn't have e.g. an
/etc/proc and neither named pipes or sockets as part of the file system
just as you need to consider the concept of drives.
2. Configuration setting.

Again, depends on what you mean.
Any other parameters I need to look while porting to Windows.

Did you read 'perldoc perlport'?

jue
 

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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top