Because $in_arg is scalar my $in_arg=@_;
I would say, if I really wanted to say that,
my $in_arg=scalar @_;
but then I would just say that @array evaluated in scalar context returns the number of elements in @array and that assignment to a scalar imposes scalar context. Or something like that...
Update: since this was downvoted, why don't you actually try?
$ perl -e 'scalar my $in_arg=@_' Can't modify scalar in scalar assignment at -e line 1, at EOF Execution of -e aborted due to compilation errors.
Update2: I read Re: My first module once again and now I realize I read it uncorrectly. I use a theme in which occasionally inline code is not visually distinctive enough, and GrandFather didn't put a suitable interpunction sign, so this added to my confusion and misreading. Sorry, my apologies...
In reply to Re^2: My first module
by blazar
in thread My first module
by tamaguchi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |