in reply to Nested subs - inherently evil?
Note that the filehandle is "local" and not "my". Call this as ReadBytes(*BINFILE, 12); You could also localize a typeglob and then use the filehandle directly.sub ReadBytes { local $file = shift; my $num = shift; my $input; read($file, $input, $num); return unpack("C$num", $input); }
HTH, --traveler
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Nested subs - inherently evil?
by chromatic (Archbishop) on Feb 11, 2002 at 21:05 UTC | |
by traveler (Parson) on Feb 11, 2002 at 22:17 UTC |