If you figured there was no difference, you're in for a surprise. With a regular subroutine, this is what happens, but prototype declaration makes things quite different.#!/usr/bin/perl -w use strict; sub foo($) { print "$_[0]\n"; } my $foo = 'foo'; my @foo = ($foo); foo($foo); foo(@foo); foo($foo[0]);
In reply to Function Prototype Context Conversion by tadman
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |