G4143 has asked for the wisdom of the Perl Monks concerning the following question:
Now I read and experimented and arrived at the simple subroutine below which reproduces the above but it makes me raise a simple question - What kind of Perl voodoo is happening when you pass my $num to a subroutine parameter list?Readonly::Hash my %hash => (data => $data); const my $min => 1; const my $max => 10; open (my $infile, '<', "datafile"); chomp(my $line = <STDIN>);
So what is happening with the @_?sub doIt { $_[0] = $_[1]; } doIt my $num => 4143;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The @_ array and the lexical variables
by choroba (Cardinal) on Apr 16, 2018 at 10:40 UTC | |
by G4143 (Novice) on Apr 16, 2018 at 11:15 UTC | |
by choroba (Cardinal) on Apr 16, 2018 at 11:52 UTC | |
by G4143 (Novice) on Apr 16, 2018 at 12:08 UTC | |
by ikegami (Patriarch) on Apr 16, 2018 at 13:27 UTC | |
|
Re: The @_ array and the lexical variables
by LanX (Saint) on Apr 16, 2018 at 10:48 UTC |