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

Re: [MacPerl] Can't 'print;' with '<' (or '>') ???



On Sat, 11 May 1996, Jeff Shepherd wrote:

> I'm just trying to do a simple 'Print contents of file to stdout'.
> Unfortunately, it looks like the format of my input file can affect the
> output. Here is my program:
> 
> #!/user/local/bin/perl
> # Print the contents of a file to STDOUT
> require "StandardFile.pl";
> print "\Running '$#ARGV'\n";
> if ($#ARGV <= 0) {
>       $file = &StandardFile'GetFile("rtf file:","TEXT");
> } else {
>       $file = $ARGV[0];
> }
> open (F, $file) || die "Could not open $file: $!\n";
> while( <F> ) {
>    print;
> }
> close( F );
> print "Done.\n";
> 
> 
> When I run the program, it errors out on the first line with:
> 
> # syntax error, next 2 tokens "bobparks@wired"
> File 'js:Programming:Perl:Majordomo'; Line 1
> # Illegal octal digit, next char ^?
> File 'js:Programming:Perl:Majordomo'; Line 26
> # Execution of js:Programming:Perl:Majordomo aborted due to compilation errors.
> 
> 
> and the line that is causing the problem is:
> 
> "Bob Parks" <bobparks@wired.com> has been added to serial-quotes-digest.
> 
> 
> Any clues?  I'm running MacPerl 4.1.8 on a Centris 650, Sys 7.5.3
> 
> - Jeff -
> 
> _______
> <jeff@trg.saic.com> (Jeff Shepherd)         Dance
> ShepWeb: <http://trg2.saic.com/~jeff/>     to Live!

This may be silly, but are you perhaps running the text file instead of 
the script.  Your code looks fine.

John Peterson -- University Networking Services -- Brigham Young University
Internet: John_Peterson@byu.edu                       Phone: (801) 378-5007