Reputation: 43
I have written a sub routine and when I run my program, I am getting the error message : "syntax error at line74, near 'open' " Is it possible the error is because I've used my to declare the content array?
my @content = do{
local $/ = \$width;
<$fh>;
}
open(OUT, ">", $outfile) or die "cannot open \n"; #this is line 74
binmode(OUT);
foreach ( @content ){
print OUT $_;
}
close(OUT);
Upvotes: 0
Views: 162
Reputation: 50637
You're missing semicolon in line before that,
my @content = do{
local $/ = \$width;
<$fh>;
}; # semicolon
Upvotes: 3