P
Peng Yu
I think that $_[0] should give me 'a' in the following example. But it
doesn't. Could you help understand why? How to get the first argument?
$ ./main.pl
ab
b
$ cat main.pl
#!/usr/bin/env perl
use strict;
use warnings;
sub mysub {
print @_, "\n";
print $_[0], print $_[1], "\n";
}
mysub 'a', 'b';
doesn't. Could you help understand why? How to get the first argument?
$ ./main.pl
ab
b
$ cat main.pl
#!/usr/bin/env perl
use strict;
use warnings;
sub mysub {
print @_, "\n";
print $_[0], print $_[1], "\n";
}
mysub 'a', 'b';