John W. Krahn wrote:
[snip]
>>
>> example of my Subroutine declarations:
>>
>> # Get the Data Number
>> &get_number;
>>
>> # Get Form Information
>> &parse_form;
>>
[snip]
>
> You are running the subroutines. These are all equivalent (note that
> the third example only works if the sub has been declared earlier):
>
> &get_number;
> &get_number();
> get_number;
> get_number();
>
no they are not the same:
#!/usr/bin/perl -w
use strict;
@_ = (1..5);
sub get_number{
print "@_\n";
}
print "&get_number:\t"; &get_number;
print "&get_number():\t"; &get_number();
print "get_number:\t"; get_number;
print "get_number():\t"; get_number();
__END__
print:
&get_number: 1 2 3 4 5
&get_number():
get_number:
get_number():
the first call really pass @_ implicitly to the function while the others do
not. one more reason why the '&' calling convention shouldn't be used.
david
--
$_=q,015001450154015401570040016701570162015401440041,,*,=*|=*_,split+local$";
map{~$_&1&&{$,<<=1,[EMAIL PROTECTED]||3])=>~}}0..s~.~~g-1;*_=*#,
goto=>print+eval
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]