in reply to Re: Spotting an empty array as argument
in thread Spotting an empty array as argument

> It makes it impossible to specify more than one argument, though:

I think you are confusing @ with \@ . The former will swallow the whole list

DB<40> sub my_say (;\@$$$) { dd \@_ } DB<41> my_say @a [["a1", "a2", "a3"]] DB<42> my_say @a,$a [["a1", "a2", "a3"], "A"] DB<43> sub tst (@) { dd @_ } DB<44> tst @a ("a1", "a2", "a3") DB<45> tst @a,2 ("a1", "a2", "a3", 2)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^3: Spotting an empty array as argument
by choroba (Cardinal) on Mar 25, 2021 at 22:11 UTC
    > I think you are confusing @ with \@.

    No, I mean what you can try by uncommenting the last line.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
      Oh, I see.

      I just experimented with the newer prototypes like + and _ but it's still a PITA. :/

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery