Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › How to run a perl program in windows?
New Posts  All Forums:Forum Nav:

How to run a perl program in windows?

post #1 of 13
Thread Starter 
I am learning perl by the book learn perl in 21 days and there is a sample program to run

Code:
1: #!c:\\perl2\\bin\\perl.exe
2: $inputline = <STDIN>;
3: print( $inputline );
I changed the first line to the location of the interpretor, and saved the program as program1.pl on the desktop. The book only explains how to run it in linux so can someone explain how to run it in windows?
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD X2 4800 Brisbane Gigabyte GA-M55Plus-s3g EVGA 7600GS 1gb 
Hard DriveOSMonitorPower
1x160, 1x120, 1x40 1x20 Win Vista Ultimate sceptre 20 inch widescreen Orion 580 Watt 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD X2 4800 Brisbane Gigabyte GA-M55Plus-s3g EVGA 7600GS 1gb 
Hard DriveOSMonitorPower
1x160, 1x120, 1x40 1x20 Win Vista Ultimate sceptre 20 inch widescreen Orion 580 Watt 
  hide details  
Reply
post #2 of 13
usually it is perl "path_to_program1.pl" If the path has spaces you will have to use the quotes.
Main Rig
(15 items)
 
  
Reply
Main Rig
(15 items)
 
  
Reply
post #3 of 13
Thread Starter 
So the interpreter's extention should be .pl? I downloaded active perl so if anyone knows can you tell where the interpretor is in the folder that was installed by activeperl?
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD X2 4800 Brisbane Gigabyte GA-M55Plus-s3g EVGA 7600GS 1gb 
Hard DriveOSMonitorPower
1x160, 1x120, 1x40 1x20 Win Vista Ultimate sceptre 20 inch widescreen Orion 580 Watt 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD X2 4800 Brisbane Gigabyte GA-M55Plus-s3g EVGA 7600GS 1gb 
Hard DriveOSMonitorPower
1x160, 1x120, 1x40 1x20 Win Vista Ultimate sceptre 20 inch widescreen Orion 580 Watt 
  hide details  
Reply
post #4 of 13
I don't think you can run it in windows, there a a few dependencies, for example e-mailing stuff, they use a unix utility. just get a cheap computer, and install Ubuntu on it, or use your current computer and dual boot with ubuntu. I did that because I was sick of remoting into a linux server for a college class.

http://video.stumbleupon.com/#p=f8bn85t8kr

that should be the one. It is very helpful, and the process is easy and not very dangerous.

running perl in windows will be a pain in the.. ahh butt, just go with running it on ubuntu, which is very easy.
    
CPUMotherboardGraphicsRAM
C2D T7100 1.8 ghz (undervolted) ummm... Dell Intel X3100 2 x 1gb 667mhz 
Hard DriveOptical DriveOSMonitor
Fujitsu 7200 RPM 120gb CD-RW/DVD dual boot Vista business 1440x900 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
C2D T7100 1.8 ghz (undervolted) ummm... Dell Intel X3100 2 x 1gb 667mhz 
Hard DriveOptical DriveOSMonitor
Fujitsu 7200 RPM 120gb CD-RW/DVD dual boot Vista business 1440x900 
  hide details  
Reply
post #5 of 13
Thread Starter 
I am away and i just have my laptop here and alot of free time, so i dont want to dual boot this but will python require anything to use in windows?
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD X2 4800 Brisbane Gigabyte GA-M55Plus-s3g EVGA 7600GS 1gb 
Hard DriveOSMonitorPower
1x160, 1x120, 1x40 1x20 Win Vista Ultimate sceptre 20 inch widescreen Orion 580 Watt 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD X2 4800 Brisbane Gigabyte GA-M55Plus-s3g EVGA 7600GS 1gb 
Hard DriveOSMonitorPower
1x160, 1x120, 1x40 1x20 Win Vista Ultimate sceptre 20 inch widescreen Orion 580 Watt 
  hide details  
Reply
post #6 of 13
i dont know for sure but seriously, boot with a knoppix live cd. you dont have to install ANYTHING, just boot from the cd, and run your perl scrips in there.

i would install ubuntu but you said you dont want to, therefore the knoppix suggestion
    
CPUMotherboardGraphicsRAM
E6400 @ 3.6 GHz (450X8) GA P965 S3 7600GT 2GB OCZ Gold @ DDR 2 900 5-5-5-15 
Hard DriveOptical DriveMonitorPower
320GB Maxtor SATA2, 160 for XP, 160 for Slackware DVD+-RW EIDE 21" CRT by Sun Microsystems 680W Echostar 22A on 12V rail 
CaseMouse
Rosewill Black small Mid-T G5 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
E6400 @ 3.6 GHz (450X8) GA P965 S3 7600GT 2GB OCZ Gold @ DDR 2 900 5-5-5-15 
Hard DriveOptical DriveMonitorPower
320GB Maxtor SATA2, 160 for XP, 160 for Slackware DVD+-RW EIDE 21" CRT by Sun Microsystems 680W Echostar 22A on 12V rail 
CaseMouse
Rosewill Black small Mid-T G5 
  hide details  
Reply
post #7 of 13
Thread Starter 
Yeah i had a knoppix live cd at home but this isnt even my computer and i only have 20 gig of hard disk space so i have to work with what i have. so does python require anything in windows?
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD X2 4800 Brisbane Gigabyte GA-M55Plus-s3g EVGA 7600GS 1gb 
Hard DriveOSMonitorPower
1x160, 1x120, 1x40 1x20 Win Vista Ultimate sceptre 20 inch widescreen Orion 580 Watt 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD X2 4800 Brisbane Gigabyte GA-M55Plus-s3g EVGA 7600GS 1gb 
Hard DriveOSMonitorPower
1x160, 1x120, 1x40 1x20 Win Vista Ultimate sceptre 20 inch widescreen Orion 580 Watt 
  hide details  
Reply
post #8 of 13
You'll have to install Python in Windows.
$265 MacBook Pro
(13 items)
 
  
CPUMotherboardGraphicsRAM
2.8GHz Core 2 Duo POS GeForce 9400M/9600GT M 4GB 1066MHz DDR3 
Hard DriveOptical DriveOSMonitor
500GB Western Digital Slot-loading thing OS X Snow Leopard 1440x900 glossy thing 
KeyboardPowerCase
Broken-backlit chiclet-type Awkwardly-shaped wall wart Aluminum block 
  hide details  
Reply
$265 MacBook Pro
(13 items)
 
  
CPUMotherboardGraphicsRAM
2.8GHz Core 2 Duo POS GeForce 9400M/9600GT M 4GB 1066MHz DDR3 
Hard DriveOptical DriveOSMonitor
500GB Western Digital Slot-loading thing OS X Snow Leopard 1440x900 glossy thing 
KeyboardPowerCase
Broken-backlit chiclet-type Awkwardly-shaped wall wart Aluminum block 
  hide details  
Reply
post #9 of 13
Thread Starter 
Is there a free compiler that can turn the script to an executable for free? If i use that i wont need to install python on it right?
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD X2 4800 Brisbane Gigabyte GA-M55Plus-s3g EVGA 7600GS 1gb 
Hard DriveOSMonitorPower
1x160, 1x120, 1x40 1x20 Win Vista Ultimate sceptre 20 inch widescreen Orion 580 Watt 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD X2 4800 Brisbane Gigabyte GA-M55Plus-s3g EVGA 7600GS 1gb 
Hard DriveOSMonitorPower
1x160, 1x120, 1x40 1x20 Win Vista Ultimate sceptre 20 inch widescreen Orion 580 Watt 
  hide details  
Reply
post #10 of 13
You don't have to install anything - just download and install the Active Perl like you have. Browse to the directory your program is located, and type in the following in quotes, replacing your program name -> "perl your_name_here" and let it run. Assuming it has no compilation issues, you should have a running Perl program. And you don't have to have Linux to run Perl. Perl is like Java in that it is platform-independent.
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
i5 3570K Asrock Z77 Gigabyte 6850 G.Skill F3-12800CL9 
Hard DriveOptical DriveOSMonitor
WD Caviar Black Asus 24x DVD-RW Multi Win 7, CentOS, BT 5.0 RC2, Mac OSX 10.7.4 Dual Asus VH236H 
KeyboardPowerCaseMouse
Saitek Eclipse PC P&C 610 KingWin Logitech Optical TracBall 
Mouse Pad
A drug company generic black pad 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
i5 3570K Asrock Z77 Gigabyte 6850 G.Skill F3-12800CL9 
Hard DriveOptical DriveOSMonitor
WD Caviar Black Asus 24x DVD-RW Multi Win 7, CentOS, BT 5.0 RC2, Mac OSX 10.7.4 Dual Asus VH236H 
KeyboardPowerCaseMouse
Saitek Eclipse PC P&C 610 KingWin Logitech Optical TracBall 
Mouse Pad
A drug company generic black pad 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › How to run a perl program in windows?