in reply to Learning to *really* love references
Maybe it's just me, but I find reading function arguments with shift is usually pointless since you can just declare the works in a single line. It's also nice to have the function argument declaration in a similar format to how you call it, so you can see if things match up.process($data_ref, \@set_up, $template, $fd_out); sub process { my ($data, $set_up, $template, $fd_out) = @_; foreach my $record (@$data) { # ... } }
Or, of course, there is always IO::File:my $fd_out; open($fd_out, $what_file); while (<$fd_out>) { # ... }
These filehandles are a lot easier to pass back and forth than the regular globs. If you're even thinking about using them as function arguments, don't use globs.my $fd_out = IO::File->new($what_file, 'r'); while (<$fd_out>) { # ... }
|
|---|