[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] What am I not seeing?



Note here that I am NOT asking for help finding the syntax errors. I did
that ageas ago. What's weird is that the Syntax Error message changes
radically when I remove and replace a single (commented!) line of code. Why?

The following code Generates a complex multiline error message under MacPerl

 #!/usr/bin/perl

 use strict;
 use Getopt::Long;

 # $USAGE="Usage: $Prog [-verbose] [-help] [-cutoff <value>]
fasta-format-file";

 use vars qw{$Help $Verbose $Cutoff};

 #
 # main
 #
 {
     my (@qualscores)

  	 # Get and validate the input options

	 GetOptions (
	       'h'              => \$Help,
	       'help'           => \$Help,
	       'v'              => \$Verbose,
	       'verbose'        => \$Verbose,
	      ) ;

     } # while ($next_record = <FH>)
 }


Syntax Errors:

  # Bareword found where operator expected, near ")

  	 # Get and validate the input options

	 GetOptions"
  File 'Untitled #2'; Line 18
  # 	(Missing operator before GetOptions?)
  # syntax error, near ")

  	 # Get and validate the input options

	 GetOptions "
  File 'Untitled #2'; Line 18
  # Unmatched right bracket, at end of line
  File 'Untitled #2'; Line 26
  # syntax error, near "}"
  File 'Untitled #2'; Line 26
  # Untitled #2 had compilation errors.


However, when I remove this one (commented!) line

 # $USAGE="Usage: $Prog [-verbose] [-help] [-cutoff <value>]
fasta-format-file";


the syntax error message becomes:

  # Bareword found where operator expected, near "GetOptions"
  File 'Untitled #2'; Line 17
  # 	(Missing operator before GetOptions?)
  # syntax error, near "GetOptions "
  File 'Untitled #2'; Line 17
  # Unmatched right bracket, at end of line
  File 'Untitled #2'; Line 25
  # syntax error, near "}"
  File 'Untitled #2'; Line 25
  # Untitled #2 had compilation errors.


Under Unix (Perl 5.005_02), with or without the commented line, the syntax
errors are the same.

-- --
       |\      _,,,---,,_       Vicki Brown <vlb@cfcl.com>
 ZZZzz /,`.-'`'    -.  ;-;;,_   Journeyman Sourceror: Scripts & Philtres
      |,4-  ) )-,_. ,\ (  `'-'  P.O. Box 1269  San Bruno  CA  94066
     '---''(_/--'  `-'\_) http://www.cfcl.com/~vlb  http://www.macperl.com

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org