Skip to content
Back to formatted view

Raw Message

Message-ID: <4D9F9CF7.8050507@gmail.com>
Date: 2011-04-08T23:40:39Z
From: Duncan Murdoch
Subject: Runing perl script from R
In-Reply-To: <21F8BC94BE49B44991277FD863F2779787061DFC3E@EX06.net.ucsf.edu>

On 11-04-08 4:56 PM, Rice, Terri wrote:
> Hi. I am trying to run perl script from R. Here's what happens.
>
>> setwd("C:\\Terri\\perl")
>> getwd()
> [1] "C:/Terri/perl"
>> list.files()
> [1] "hello.pl"      "lines1_10.txt" "try_my.pl"     "try_my.txt"
>> system("hello.pl")
> Warning message:
> In system("hello.pl") : Impossible to run C:\Terri\perl\hello.pl
>
> Does anyone know what I am doing wrong?

Perl scripts are not generally executable on their own.  The shell will 
automatically run something like "perl hello.pl", but you went to a 
lower level.

To get what you want in Windows, try

shell('hello.pl') # Windows only

or

system('perl hello.pl')

Duncan Murdoch