develooper Front page | perl.beginners | Postings from February 2002

Illegal character error for blank line.

Thread Next
From:
Student of Perl
Date:
February 6, 2002 02:17
Subject:
Illegal character error for blank line.
Message ID:
20020206101844.7650.qmail@mailFA2.rediffmail.com

Hi there,

i have very strange problem.
I have a simple script which I run 
on Windows98 (PC) and it 
executed properly. But when I
sent it to someboday by email
who uses Unix ; it give error.


The first 3 lines of the script are
comments in following format.

# comment1
# comment2
# comment3 ..

"the script starts here"

the two dots after 3rd comments are AS IT IS in
the script. After the 3rd line ; there is one blank
line. And after that blank line the sctual script
starts. So the error given by Perl is that

"Illegal character \015 (carriage return) at sample.pl line 4."

In fact the line number 4 is blank(and yes it is carriage
return). But then why should it give error? By the way
sample.pl is the name of the script file. The script runs
properly on my Windows98 but gives above error on
Unix machine. By the way on my Windows98 machine
I use ActivePerl ; I dont know about what Perl interpreter
is used on that remote Unix machine. But anyway I
am surprised to see that just because I left a blank line
the Perl should give error? On the contrary Perl is said
to be quite flexible and forgiving language. And also
I have never come across such an error before myself.
Also the "#" is the first character in all the 3 comments

Pls answer. Its very confusing situation. Once again ;
I have Win98 and using ActivePerl of ActiveState.
I typed my script in simple DOS editor.
Thanks
-Jim
 


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About