in reply to Re: sending data thru a sub routine
in thread sending data thru a sub routine

... all as a single element, in which case, you need to (for one example) split @ARGV and push its arguments ...

This seems needlessly confusing advice to offer a novice Perler. Literally calling split on  @ARGV e.g.:
    my @array = split @ARGV;
is likely to produce (unpleasantly) surprising results. Can you be more clear?

Replies are listed 'Best First'.
Re^3: sending data thru a sub routine
by ww (Archbishop) on May 12, 2014 at 00:16 UTC
    Good point: clarification herewith:

    Some processing is required; it's definitely not a matter of simply splitting @ARGV, because split expects to work on a string, not an array.

    C:\>perl -E "my ($input) = @ARGV; my @input = split / /, $input; for $ +_(@input) {say $_;}" "trez zwei uno" trez zwei uno

    parenthesize the $input to stringify the content of @ARGV rather than count its (single here) element(s).

    Quibble: AnomalousMonk could improve on this 'clarification' and probably would have done it better the first time.


    Come, let us reason together: Spirit of the Monastery

    Quis custodiet ipsos custodes. Juvenal, Satires