Illegal character in prototype Perl error in AIX server

HI All ,
I am using AIX version 6 . having issue with below perl code,

sub Article ($procudure, @params) {
    my ($procudure, @params) = @_;
    #Get handle TO Dataware House DATABASE
    try {
    my $dbHandle = &Cobol::DBAccess::getDBDwConnection();
    ,,,,,,,,,,,,,
    ,,,,,,,,,,,,
      $ex = "SPException: Unable to execute Stored Procedure \[Passed: $procudure\] "."$ex";
            throw Cobol::SPException($ex);
    };
Error received : 

Illegal character in prototype for Cobol  $procudure, @params  at line 1
\( Highlighted in red\)
I am new to perl , please can someone help me understand as this script worked fine in Hp-Unix but throwing above error 
in IBM-AIX -6 . Any help appreciated

Where did you edit this script? Might it have ended up with carriage returns in it?

Hi.
I took below code from perl module.
The script is used to generate many files like filename.txt format
when ran through perl script,it refers perlmodule as I referred below.
Though all files are generated successfully,it shows up error at line one.
I also observe files having carrier as ^M characters at end of file.
Is that the issue ? But it worked fine in unix sever.
Only Aix is having issue and throwing error.please guide

thanks

UNIX doesn't use \r\n to terminate lines, just \n, so the carriage return is being taken as part of the string and not as whitespace. I don't know why some systems didn't have a problem, but this is a very very common thing when blithely copying in text files edited with Microsoft Notepad and the like.

# Remove carriage returns from a file
tr -d '\r' < wingarbage > unixtext
1 Like