CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Linux to Windows migration

 



chulew
New User

May 8, 2013, 1:30 PM

Post #1 of 4 (348 views)
Linux to Windows migration Can't Post

Ok, I'm a nub. I am trying to understand a how I can migrate some perl.

As far as I can tell, I have a JMP script running in Windows which calls a website (.php and .pl residing on a Debian 2.30.2 system) to fetch data from SQL database (another server).

I need to understand what is happening enough to be able to move the perl scripts and php (and any dependencies) to run from Windows 7 (the Linux box is on its last leg).

I don't really know where to begin but I'm up for any challenge involved including learning perl as needed. I would like to believe that I can recreate a public site in Windows which I would then point the JMP script to. I never visit the php in a browser so perhaps the process could be simplified (no need for public directory?).

Thanks in advance for any guidance!


FishMonger
Veteran / Moderator

May 8, 2013, 1:43 PM

Post #2 of 4 (343 views)
Re: [chulew] Linux to Windows migration [In reply to] Can't Post

You'll need to go through the perl scripts looking for system calls and update those sections to use the equivalent Windows system calls. Or replace those sections with the equivalent platform independent code i.e., find a platform independent cpan module that preforms the required functionality.

Since you haven't provided any code or details about the scripts, I can't recommend anything more specific.

You will need to either learn Perl, or hire a programmer to do the migration for you.


chulew
New User

May 8, 2013, 2:17 PM

Post #3 of 4 (339 views)
Re: [FishMonger] Linux to Windows migration [In reply to] Can't Post

Attached is what appears to be the only script referred to in this JMP JSL script excerpt:

ISTCRC_download_recalc_params = Function( {lots},
{Default Local},
mode_lookup = {"vg", "id", "mixed"};
sampSel_lookup = {"all", "first", "last"};
curveSel_lookup = {"Transfer%20-%20Final", "Transfer%20-%20Initial"};
url = "http://cltsuss-m52xp/~nconrad/InStressParamExtract.php?action=Download%20data";
For( i = 1, i <= N Items( lots ), i++,
url = url || "&lots[]=" || Char( lots )
);
dt = Open(
url,
text,
Import Settings(
End Of Line( CRLF, CR, LF ),
End Of Field( Tab, Comma ),
Strip Quotes( 1 ),
Use Apostrophe as Quotation Mark( 0 ),
Labels( 1 ),
Column Names Start( 1 ),
Data Starts( 2 ),
Lines To Read( All ),
Year Rule( "10-90" )
)
);
dt << Set Name( "In-stress param recalc" );
rt5 = dt;
);
Attachments: xferAnalyze.pl (1.99 KB)


FishMonger
Veteran / Moderator

May 8, 2013, 2:29 PM

Post #4 of 4 (336 views)
Re: [chulew] Linux to Windows migration [In reply to] Can't Post

The perl script doesn't make any system calls, so it may be fine as is, with 1 possible exception.

You may need to change line 12 from:

Code
my @h1p = split m/[,\n\r]/, $h1;


to this:

Code
my @h1p = split m/[,\n\r]+/, $h1;


Reason being, on Debian the line terminator is \n and on windows it's \r\n

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives