On Sun, Jan 18, 2015 at 07:24:21PM -0500, Shawn H Corey wrote:
>     my @line = (
>                  @first[rand(@first)],
>                  @second[rand(@second)],
>                  @third[rand(@third)],
>                );

Sorry to beat on you, Shawn, but I missed this the first time
around. Those should probably be:

my @line = (
    $first[rand @first)],
    $second[rand @second)],
    $third[rand @third)]]
);

The use of the @ sigil for dereferencing an array is meant to
grab a slice of the array, not a single element. The warnings
pragma will warn you about this:

perl -Mwarnings -e 'my @x = (1..10); print @x[4], "\n";' said:
> Scalar value @x[4] better written as $x[4] at -e line 1.
> 5

And with that, it should be emphasized to always use the strict
and warnings pragmas. :)

Regards,


-- 
Brandon McCaig <bamcc...@gmail.com> <bamcc...@castopulence.org>
Castopulence Software <https://www.castopulence.org/>
Blog <http://www.bambams.ca/>
perl -E '$_=q{V zrna gur orfg jvgu jung V fnl. }.
q{Vg qbrfa'\''g nyjnlf fbhaq gung jnl.};
tr/A-Ma-mN-Zn-z/N-Zn-zA-Ma-m/;say'

Attachment: signature.asc
Description: Digital signature

Reply via email to