DB<1> sub tst ($) { print @_} # primitive approach DB<2> @a=qw/a b c/ DB<3> tst @a # NO! I don't want to force scalar context on other datatypes 3 DB<4> sub tst2 (\$) { print @_} # Restrict to scalars starting with sigil "$" DB<5> tst2 @a # YES! at least there is no scalar context Type of arg 1 to main::tst2 must be scalar (not array dereference) at (eval 11)[/usr/share/perl/5.10/perl5db.pl:638] line 2, at EOF
DB<6> tst2 "1" # NO! Constants are not allowed ... sigh
Type of arg 1 to main::tst2 must be scalar (not constant item) at (eval 9)[/usr/share/perl/5.10/perl5db.pl:638] line 2, at EOF
####
DB<9> print ref \"1"
SCALAR
####
DB<13> @a=qw/a b c/
DB<14> print join ":",@a # RIGHT
a:b:c
DB<15> print join @a,":" # NONSENSE (at least in 99.9% of the cases) but no error message
:
DB<16> # What if I REALLY want the length as delimiter?
DB<17> print join scalar @a,":" # well, in <0.1% of the usecases, you can afford to be explicit
: