HI,
I want to save all number between -100 and 100 in file,but I get error in line 11
line 11
open IN,"text" or die "Can't open input file: $!\n";
regards
#!/usr/bin/perl -w
# with a for loop
for ( my $count= -100; $count<=100; $count++ ) {
print $count++,"\n";
}
print "give a file name: ";
$count = <STDIN>
open IN,"text" or die "Can't open input file: $!\n";
while ($count = <IN>) {
print OUT $count;
}
close IN or warn "Errors while closing filehandle: $!";
exit;
I want to save all number between -100 and 100 in file,but I get error in line 11
line 11
open IN,"text" or die "Can't open input file: $!\n";
regards
#!/usr/bin/perl -w
# with a for loop
for ( my $count= -100; $count<=100; $count++ ) {
print $count++,"\n";
}
print "give a file name: ";
$count = <STDIN>
open IN,"text" or die "Can't open input file: $!\n";
while ($count = <IN>) {
print OUT $count;
}
close IN or warn "Errors while closing filehandle: $!";
exit;