Re: file handle as a sub arg in perl

2002-12-21 Thread R. Joseph Newton
Hi Christopher, I just dealt with a corrolary issue--how NOT to pass a file handle, which seems to happen by default if I declare the handle inline without scalar notation: open(MY_FILE, $FileName). In a recursive routine such as: sub ListFilesContainingText { #... variable declareations et al

Re: file handle as a sub arg in perl

2002-12-14 Thread christopher j bottaro
nm, figured it out. you can pass open a scalar like this: open($myfile, "blah"); ParseOneItem($myfile); and use it in the sub like this: sub ParseOneItem() { my $fh = shift(); my $line = <$fh>; } =) -- christopher On Saturday 14 December 2002 03:10 am, christopher j botta