On Tue, Sep 24, 2013 at 8:23 AM, Harry Putnam <rea...@newsguy.com> wrote:

> The way in use in script below works... quotations around "@_", so the
> content is passed rather than the element count.  And the ways that
> are commented out also work.
>

Yeah, that's a bit of a fragile idiom - inside dbl quotes, arrays are
stringified to be a list, separated by the current $LIST_SEPARATOR (aka $"
) which is, by default, a space. So
my @eg = qw(foo fie fum);
print "eg: @eg\n";
print "eg: ", @eg, "\n";

prints
eg: foo fie fum
eg: foofiefum

so your -f "@_" works if there's just one element. I prefer
my ($fname) = @_;

as it's easy to expand to add more params
my ($fname, $fsize_max) = @_;



-- 

a

Andy Bach,
afb...@gmail.com
608 658-1890 cell
608 261-5738 wk

Reply via email to