Re: Question from perl newbie
- From: "Jürgen Exner" <jurgenex@xxxxxxxxxxx>
- Date: Fri, 16 Feb 2007 04:07:13 GMT
Roy Jaffray wrote:
am a newbie as well .. with exactly the same problem.
I have a file called "helloworld.pl". When it wouldnt put out any
output using <stdin> I decided to try to create and open a file and
write to that.
____helloworld.pl________________________________
You are missing
use strict;
use warnings;
open(geo,">perltest.txt") or die ("Cannot Open perltest.txt");
It would be better to include the reason why the open failed.
.... or die ("Cannot Open perltest.txt because $!");
for ($loop_index =1; $loop_index <=5; $loop_index++)
What's wrong with
for $loop_index (1..5)
Much easier to read
{
Print geo "hello world!\n"
Where to you define the funtion Print()?
}
Print "there!\n\n\n"
Where do you define the function Print()?
close (geo);
print "Press <enter> to continue" ;
<stdin>;
_____________________________________________
I then double clicked on the name and got the dos flicker .. but no
file was created.
Well, yeah, sure. Why don't you fix that syntax error that perl is telling
you about?
String found where operator expected at C:\tmp\t.pl line 8, near "Print
"there!\
n\n\n""
(Do you need to predeclare Print?)
syntax error at C:\tmp\t.pl line 8, near "Print "there!\n\n\n""
Execution of C:\tmp\t.pl aborted due to compilation errors.
so problem continues ... (new computer Windows XP .. and newly
downloaded ActivePerl seemingly sucessfully installed. )
Irrelevant. Your Perl code has a syntax error. Of course it doesn't produce
anything because it never even passed the syntax check.
jue
.
- References:
- Re: Question from perl newbie
- From: Roy Jaffray
- Re: Question from perl newbie
- Prev by Date: Re: Question from perl newbie
- Next by Date: Re: Question from perl newbie
- Previous by thread: Re: Question from perl newbie
- Next by thread: Re: Question from perl newbie
- Index(es):
Relevant Pages
|
|