in reply to what is bad about this?

Define "works".

use strict; use warnings; my ($IP_ADDRESS, @REALM1); @REALM1 = qw(alpha beta gamma); $IP_ADDRESS = @REALM1; print "$IP_ADDRESS\n"; @REALM1 = qw(alpha); $IP_ADDRESS = @REALM1; print "$IP_ADDRESS\n"; my $REALM1; $REALM1 = q{alpha}; $IP_ADDRESS = $REALM1; print "$IP_ADDRESS\n";

Replies are listed 'Best First'.
Re^2: what is bad about this?
by Fletch (Bishop) on Feb 06, 2006 at 22:08 UTC

    Not that you're not correct, you've misunderstood the OP's question. Because they didn't use <code> tags their []s got eaten. They're actually trying to ask what's wrong with using a one-element array slice @array[0] versus accessing the element directly $array[0].