List Info

Thread: What am I doing wrong here?




What am I doing wrong here?
country flaguser name
United States
2007-08-30 05:30:14

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 Horn
kcom1989%40fastmail.fm">kcom1989fastmail.fm

--
http://www.fastmail.fm - Access your email from home and the web

__._,_.___
Recent Activity
Visit Your Group
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Need traffic?

Drive customers

With search ads

on Yahoo!

Yoga Groups

Find Enlightenment

& exchange insights

with other members

Re: What am I doing wrong here?
country flaguser name
United States
2007-08-30 05:46:24

Interesting. Could you please send the whole code? Is there something
else in the file? It usually is a problem regarding to interpolation.

Gergely.

--- In perl-beginner%40yahoogroups.com">perl-beginneryahoogroups.com, "Steve Horn" <kcom1989...> wrote:
&gt;
> On Windows Active State perl whenever I try to run the program
> "print("Hello World.n&quot;);"; I keep getting the error messages "Bareword
> found where operator expected at - line 1 near "print (Hello&quot;" (missing
> operator before Hello?), String found where operator expected at - line
>; 1 near "&quot;print ("&quot; (Missing semicolon on previous line?), and String
&gt; found where operator expected at - line near "n&quot;);"". What am I doing
&gt; wrong here and how do I fix this? TIA
> --
> Steve Horn
>; kcom1989...
>
> --
> http://www.fastmail.fm - Access your email from home and the web
>

__._,_.___
.

__,_._,___
Re: What am I doing wrong here?
country flaguser name
United States
2007-08-30 05:47:26

--- In perl-beginner%40yahoogroups.com">perl-beginneryahoogroups.com, "Steve Horn" <kcom1989...>
wrote:
>
&gt; On Windows Active State perl whenever I try to run the program
> "print("Hello World.n&quot;);"; I keep getting the error messages
"Bareword
&gt; found where operator expected at - line 1 near "print
(Hello&quot;" (missing
> operator before Hello?), String found where operator expected at -
line
> 1 near "&quot;print ("&quot; (Missing semicolon on previous line?), and
String
> found where operator expected at - line near "n&quot;);"". What am I
doing
> wrong here and how do I fix this? TIA
> --
> Steve Horn
>; kcom1989...
>
> --
> http://www.fastmail.fm - Access your email from home and the web
>

You don't need the quotes around the print statement, so change

"print("Hello World.n&quot;);";

to

print("Hello World.n&quot;);

I also suggest that you use the 'strict', 'warnings' and
'diagnostics' pragmas, so your program should be like this:

#!c:/perl/bin/perl.exe

use warnings;
use strict;
use diagnostics;

print("Hello World.n&quot;);

__._,_.___
.

__,_._,___
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )