[reposting with correct e-mail address, sorry for any inconvenience]
----- Original Message -----
To: [EMAIL PROTECTED]; "Steve Horn" <[EMAIL PROTECTED]>;
[EMAIL PROTECTED]; [email protected]
Sent: Sunday, September 16, 2007 1:21 PM
Steve, It's your extra quotation marks. You may have copied a example of the
the form
type "..........some example........" without the surrounding
quotation marks,
but left in the surrounding quotation marks.
print "("Hello World.\n");"; # not correct; two superfluous quotes; the
superfluous semi-colon is effectively a null statement
^ ^^
print ("Hello World.\n"); # correct -- function form
print "Hello World.\n"; # simpler -- operator form
"An alternative way to look at functions is to say that they are all
either named unary operators (taking a single argument) or
named list operators (taking a list of arguments). How we describe them
then becomes a case of how we use them: if we use parentheses, they are
functions, and
if we do not, they are (or at least, resemble) operators" Chapter 4 -
Operators
--Professional PERL Programming, Simon Cozens, Arthur Corliss et al. Apress
(c)2004
---------- example:
C:\!!!!perl>type whatWrongDoingHere.pl
print ("Hello World.\n");
C:\!!!!perl> whatWrongDoingHere.pl
Hello World.
C:\!!!!perl>type whatWrongDoingHere2.pl
print "("Hello World.\n");";
C:\!!!!perl> whatWrongDoingHere2.pl
Bareword found where operator expected at C:\!!!!perl\whatWrongDoingHere2.pl
line 1, near ""("Hello"
(Missing operator before Hello?)
String found where operator expected at C:\!!!!perl\whatWrongDoingHere2.pl
line1, near "n");""
syntax error at C:\!!!!perl\whatWrongDoingHere2.pl line 1, near ""("Hello World"
Execution of C:\!!!!perl\whatWrongDoingHere2.pl aborted due to compilation
errors.
regards, gerry
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Steve Horn" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[email protected]>
Sent: Thursday, August 30, 2007 6:27 AM
Subject: RE: What am I doing wrong here?
> Try
>
> print "Hello World.\n";
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Steve
> Horn
> Sent: Thursday, August 30, 2007 6:11 AM
> To: [EMAIL PROTECTED]; [email protected]
> Subject: What am I doing wrong here?
>
> On Windows Active State perl whenever I try to run the program "print
> ("Hello World.\n");"; I keep getting the error messages "Bareword found
> where operator expected at - line 1 near "print (Hello"" (missing
> operator before Hello?), String found where operator expected at - line
> 1 near ""print ("" (Missing semicolon on previous line?), and String
> found where operator expected at - line near "n");"". What am I doing
> wrong here and how do I fix this? TIA Steve
> --
> Steve Horn
> [EMAIL PROTECTED]
>
> --
> http://www.fastmail.fm - The professional email service
>
> _______________________________________________
> ActivePerl mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> _______________________________________________
> ActivePerl mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs