I'm getting an error message whenever I try to use the variable $/. The error message that Perl spits out is:
syntax error at Z:/Workspace/PN/PN.pl line 64, near "}continue"
the code I'm using is basically the following:
Line 64 would be the last line (}). The odd thing is that if I use the following code then it works:
I used the EPIC debugger for Eclipse and I see that the $/ isn't listed anywhere, so it appears that it is not getting initialized, but even if I try to manually initialize it, it still does not work. I'm sure I'm just missing something obvious, but I can not seem to be able to figure it out. Can anyone offer any insight as to why this might be happening?
Thanks.
-Zipper
syntax error at Z:/Workspace/PN/PN.pl line 64, near "}continue"
the code I'm using is basically the following:
Code:
sub doThings(){
$oldDelim = $/;
undef $/;
slurp things;
$/ = $oldDelim;
return;
}
Code:
sub doThings(){
$inFileHandle->open($filename) or die "Could not open file: " . $filename;
while (<$inFileHandle>){
$oldDelim = $/;
undef $/;
print things;
$/ = $oldDelim;
}
return;
}
Thanks.
-Zipper