Newbiez has asked for the wisdom of the Perl Monks concerning the following question:

Greeting monks,

I am new to Perl and Padre.

I wish to use TargetScan locally on my computer. So, I downloaded TargetScan ( http://www.targetscan.org/cgi-bin/ta...cgi?db=vert_50), which comprise several text files and a perl script (i downloaded targetscan_70 folder, which consists of a perl script and several text files).

In the "README_70" text file, it stated to run the script with input filenames and output file, please key in the following:

./targetscan_70.pl miR_Family_info_sample.txt UTR_Sequences_sample.txt targetscan_70_output.txt.

I am using Padre software to run the script and also the input and output files.

Syntax error at targetscan_70.pl, near "." was obtained when I executed the script together with the above command.

Can anyone please tell me what is the main problem for causing the syntax error and the way to solve it?

Your help is greatly appreciated.

Thank you and have a nice day.

Best regards,

NewBiez

Replies are listed 'Best First'.
Re: Syntax error "."
by poj (Abbot) on Dec 24, 2017 at 19:10 UTC

    The script works for me. How exactly are you running the script using Padre and what is your OS and perl version ?

    poj
      Dear poj,

      I am running the script by opening the script using Padre. The script works fine for me. According to the script, it takes two input files. Then, I key in the following command (according to the README_70.txt file) into the script and executed the script:

      ./targetscan_70.pl miR_Family_info_sample.txt UTR_Sequences_sample.txt targetscan_70_output.txt

      However, only syntax error was obtained.

      My OS is Microsoft Window vista and perl version 5.12.3

      Thank you so much and Merry Christmas.

      Best regards,

      Newbiez

        Don't make any changes to the script.

        If you want to use Padre open the script targetscan_70.pl using File->Open... Then using Tools->Preferences->Language - Perl 5 set the Script Arguments to miR_Family_info_sample.txt UTR_Sequences_sample.txt targetscan_70_output.txt and Save.

        Now run script (F5)

        If you get message Line 89: Using a | char in open without a | at the beginning or end is usually a typo. Do you want to continue ? press Yes.

        If you get message Should I over-write targetscan_70_output.txt [yes/no]? enter Yes and you should see

        Processing CDC2L6
        Processing FNDC3A
        Processing LIN28B
        Processing LPHN1
        Processing NLRP1
        Processing ZNF197
        Press any key to continue . . .>
        

        poj
Re: Syntax error "."
by Happy-the-monk (Canon) on Dec 24, 2017 at 19:10 UTC

    ./targetscan_70.pl ... I am using Padre software to run the script

    I have to admit that I don't use Padre (yet?) but I understand it expects to run a script in Perl.

    There's nothing wrong with that yet, only the ./ part in the beginning looks like the scrpt should be run from the unix shell prompt. Again, I might be wrong, but maybe it has something to do with the environment being different on the unix shell prompt than in Padre.

    So try to run it from the shell if you trust it, or examine the script and see what it expects.

    Cheers, Sören

    Créateur des bugs mobiles - let loose once, run everywhere.
    (hooked on the Perl Programming language)

      Dear Soren,

      Thank you for the suggestions.

      Merry Christmas.

      Best regards, Newbiez

        Thank you for the suggestions.

        did it any good?

        Frohe Weihnachten! Joyeux Noël! God Jul! Merry Christmas! Buon Natale! ˇFeliz Navidad! Prettige Kerstdagen! Feliz Natal! Good Yule! Glćdelig jul! Hyvää joulua! Wesołych Świąt! Gleđileg jól! Happy Hogswatch! Jontef! Jovel Bambonum! Lebedik nitl! Veselé Vánoce! Sretan Božić! Crăciun fericit! Happy Festivus! Feliĉan Kristnaskon! Καλά Χριστούγεννα! Весела Коледа! חַג מוֹלָד שָׂמֵח メリークリスマス!Laeti dies natalis Christi!

        Sören

        Créateur des bugs mobiles - let loose once, run everywhere.
        (hooked on the Perl Programming language)

Re: Syntax error "."
by Anonymous Monk on Dec 25, 2017 at 09:29 UTC

    ./targetscan_70.pl miR_Family_info_sample.txt UTR_Sequences_sample.txt targetscan_70_output.txt
    I do get the same error if I try to run this as Perl code. This is not Perl.

    You're supposed to run this command using your shell (you do know how to use bash and Terminal.app, right?). cd to where you downloaded the files and then type in something like perl targetscan_70.pl miR_Family_info_sample.txt UTR_Sequences_sample.txt targetscan_70_output.txt. Otherwise (if you require Padre to work with the script for some reason), open targetscan_70.pl itself in Padre and find a way to change directory from within Padre and pass the opened script some command line arguments.