http://qs1969.pair.com?node_id=917589


in reply to Re: Issue splitting in while Loop
in thread Issue splitting in while Loop

Nice input GrandFather, however, I'm a little perplexed about your example ..

open my $ranIn, '<', $logFileName or die "Open '$logFileName' failed: $!\n";..

Where is the filehandle that's being created, is that in a variable ($ranIn) as well as the file name ($logfilename)? The syntax is a bit off as to what I'm used to, but that part I'm figuring out, for instance my open statement would look like this...

open (IN, "$logfilename") || die "Open '$logfilename' failed: $!\n";

So, I'm thinking the only real difference is that you've got the filehandle, IN, in $ranIn, and you're explicitly using "<" to mean input file rather than rely on default, am I correct about that, and if so, what are the benefits of opening the file this way?

By the way, I know you explained some of why you did it this way in the post, but I'm just not really understanding exactly what your reasons are, sorry, not too quick on the uptake some times...:)