Student Of Perl wrote:
> 
> Hi there,

Hello,

> 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.

On Unix there is a utility called dos2unix (IIRC) that can convert DOS
text to Unix text, if not then s/he can use the tr program:

tr -d '\015' < sample.pl > newsample.pl

On the Windows side you could use a programming editor (like UltraEdit)
that can save files in the Unix text format.  AFAIK Perl can run files
on Windows in this format.



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to