Perl command error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl command error
# 8  
Old 11-21-2014
Well... Do you have perl installed? Where is it installed? Is it in PATH?
# 9  
Old 11-21-2014
I have perl installed here:
Code:
 C:\cygwin\bin\perl.exe

So in the VB do I need to change the
Code:
 Set plink_object = WshShell.Run("C:\cygwin\bin\mintty.exe C:\cygwin\home\cmccabe\windows_annovar.pl 66 ""50602_15:56:31_15:56:11_15:56:21;50602_15:57:07_15:56:47_15:56:57""", 1)
    On Error GoTo 0
End Sub

to

Code:
 Set plink_object = WshShell.Run("C:\cygwin\bin\perl.exe C:\cygwin\home\cmccabe\windows_annovar.pl 66 ""50602_15:56:31_15:56:11_15:56:21;50602_15:57:07_15:56:47_15:56:57""", 1)
    On Error GoTo 0
End Sub

Thank you Smilie.
# 10  
Old 11-21-2014
Yes, if it is a perl script. You run shell code using shell; you run perl code using perl.
# 11  
Old 11-22-2014
Wont that cause the bash not to run? Do I need to include both in the VB??

Code:
 Set plink_object = WshShell.Run("C:\cygwin\bin\mintty.exe C:\cygwin\bin\perl.exe C:\cygwin\home\cmccabe\windows_annovar.pl 66 ""50602_15:56:31_15:56:11_15:56:21;50602_15:57:07_15:56:47_15:56:57""", 1)

Thank you Smilie.
# 12  
Old 11-23-2014
What bash?
# 13  
Old 11-24-2014
If I run the script from the command line using:
Code:
 bash ~/windows_annovar.pl

the menu options work but the perl commands do no run.

If I use VB:
Code:
 Private Sub CommandButton1_Click()
    Dim cmd As String
    Dim ret As Double
    Dim WshShell As Object
    Dim plink_object As Object
    ' Run Linux Commands
    Set WshShell = CreateObject("WScript.Shell")
    On Error Resume Next
    Set plink_object = WshShell.Run("C:\cygwin\bin\perl.exe C:\cygwin\home\cmccabe\windows_annovar.pl 66 ""50602_15:56:31_15:56:11_15:56:21;50602_15:57:07_15:56:47_15:56:57""", 1)
    On Error GoTo 0
End Sub

The cygwin terminal opens and closes right away.

VB:
Code:
 Private Sub CommandButton1_Click()
    Dim cmd As String
    Dim ret As Double
    Dim WshShell As Object
    Dim plink_object As Object
    ' Run Linux Commands
    Set WshShell = CreateObject("WScript.Shell")
    On Error Resume Next
    Set plink_object = WshShell.Run("C:\cygwin\bin\mintty.exe C:\cygwin\home\cmccabe\windows_annovar.pl 66 ""50602_15:56:31_15:56:11_15:56:21;50602_15:57:07_15:56:47_15:56:57""", 1)
    On Error GoTo 0
End Sub

The menu runs
Code:
 
Welcome to annovar, please make a selection
==================================
 
1 Match patient
2 Sanger analysis
3 Batch analysis
4 Individual analysis
5 Supplemental analysis
6 Exit
 
==================================
Your choice: 1
 
DEBUG INFO: VALUE OF $id: , VALUE OF $panel:
What is the id of the patient to be matched : H64548
What panel: Marfan20

, but the perl commands do not.

Code:
 
C:\cygwin\home\cmccabe\windows_annovar.pl: line 36: perl: command not found 

There seems to be something that the VB needs in order to make both the menu shell and perl work or is there a better way? Thank you Smilie.
# 14  
Old 11-24-2014
Quote:
Originally Posted by cmccabe
If I run the script from the command line using:
Code:
 bash ~/windows_annovar.pl

the menu options work but the perl commands do no run.
Then the code you have been showing is not the code you have been running.

Add Perl to your PATH or use an absolute path.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Perl error : perl: warning: Setting locale failed.

This's my problem perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LC_ALL = "en_US.UTF-8", LC__FASTMSG = "true", LC_MESSAGES = "", LC_CTYPE = "en_US.UTF-8", LC_TYPE = "en_US.UTF-8", LANG = "EN_US"... (1 Reply)
Discussion started by: bobochacha29
1 Replies

2. Shell Programming and Scripting

Perl error in batch command but works one at a time

In the below perl executes if one file is processed perfect. However, when multiple files are processed in batch which is preferred I get the below error that I can not seem to fix it as the '' necessary for the command to execute, but seem to only work for one -arg option. Thank you :). ... (2 Replies)
Discussion started by: cmccabe
2 Replies

3. Shell Programming and Scripting

perl/unix: script in command line works but not in perl

so in unix this command works works and shows me a list of directories find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt but when i try running a perl script to run this command my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';... (2 Replies)
Discussion started by: kpddong
2 Replies

4. Shell Programming and Scripting

Perl & Sed command -- Out of Memory Error

Experts, We used to receive our source files with '~^' as row delimiter. This file contains 2500K records and two of the columns having value in HTML formats within the file. While running the below commands against the file, we are encountering out of memory, could you please help to... (3 Replies)
Discussion started by: srivijay81
3 Replies

5. Shell Programming and Scripting

Perl command error...

Good morning! Imtrying to run: #!/usr/bin/perl perl -nle 'print if /\var\/log/' /etc/syslog.confBut I keep getting error: Do you need to predeclare -nle.Im trying to create a script that read the contents of /etc/syslog.conf and print out every line that contains /var/log. (1 Reply)
Discussion started by: bigben1220
1 Replies

6. Shell Programming and Scripting

Convert Sed command to perl command

Hello, Can any perl experts help me convert my sed string to perl. I am unsuccessful with this. I have to remove this string from html files OAS_AD('Top'); I have come up with this. However the requirement is in perl. for find in $(find . -type f -name "file1.html") ; do cat $find |... (2 Replies)
Discussion started by: abacus
2 Replies

7. Shell Programming and Scripting

combine two perl lines into a single perl command

Hi Everyone, i have a string 00:44:40 so: $tmp=~ s/://gi; $tmp=~s/({2})({2})({2})/$1*3600+$2*60+$3/e; the output is 2680. Any way to combine this two lines into a single line? Thanks (4 Replies)
Discussion started by: jimmy_y
4 Replies

8. Shell Programming and Scripting

Error executing shell command from a perl script

Hi Gurus, I've a find command that gets the list of files from a source directory where the extension is not html, xml, jsp, shtml or htaccess. The below find command runs fine from the command prompt or in a shell script. I need to eventually run it in a PERL script and am getting the... (5 Replies)
Discussion started by: voorkey
5 Replies

9. Shell Programming and Scripting

[Perl] Accessing array elements within a sed command in Perl script

I am trying to use a script to replace the header of each file, whose filename are stored within the array $test, using the sed command within a Perl script as follows: $count = 0; while ( $count < $#test ) { `sed -e 's/BIOGRF 321/BIOGRF 332/g' ${test} > 0`; `cat 0 >... (2 Replies)
Discussion started by: userix
2 Replies

10. Shell Programming and Scripting

Perl Script Error with find command

Guys, I need to find all the files ending with either dmp or dmp.Z. This command is giving me error. @files =`find $path \(-name "*.dmp" -o -name "*.dmp.Z"\) -mtime +30`; sh: 0403-057 Syntax error at line 1 : `(' is not expected. Thanks in advance (4 Replies)
Discussion started by: MKNENI
4 Replies
Login or Register to Ask a Question