in reply to Re^2: syntax error near print
in thread syntax error near print

I guess this is a 'permission denied' message, in Italian. Ensure that the value you have for $outfile is what you think it should be and that you can create this file manually. If you have permissions issues check with your sysadmin, perhaps you don't have access to write files to the directory in question.

Replies are listed 'Best First'.
Re^4: syntax error near print
by mariannapac (Initiate) on Jul 24, 2012 at 11:08 UTC

    I created the outfile with sudo command. So I'm sure the 429F04 file is present in /usr/bin....

      Are you sure you want to put data files in to /usr/bin? See http://www.linfo.org/usr_bin.html. Consider running this script in your home directory (or a sensibly named sub directory of your home directory).

      As you've discovered you can't create files in directory in which you don't have permissions without using sudo, so unless you run your perl script in the same manner, this isn't going to work. I advise against creating these files in /usr/bin anyway. Please consider my suggestion above.

        Thanks a lot!!! Now the script is running correctly. I'll follow your suggestion. Ciao ciao Marianna

Re^4: syntax error near print
by mariannapac (Initiate) on Jul 24, 2012 at 14:13 UTC

    Martoooo!!! My problems are not finished!!! :-( While the script was running I see this error: print() on unopened filehandle OUTFILE at blast.parsing.pl line 53, <GEN1> line 3985842. print() on unopened filehandle OUTFILE at blast.parsing.pl line 55, <GEN1> line 3985842. and I realized that in the output is loosed the "accession number" column... Is there a solution?

      In a couple of places you have:

      print OUTFILE "\t" if ($count > 0);

      When you don't have a file handle called OUTFILE. Previously in your code you have:

      open (OUT, ">$outfile" ) or die "Cannot open $outfile :$!";

      And print quite happily to it later in the code. If you are happy for the output to go to the existing file change the two occurrences of OUTFILE to OUT.