in reply to Re: Use of uninitialized value
in thread Use of uninitialized value

Erm . . . ouch.

Replies are listed 'Best First'.
Re^3: Use of uninitialized value
by TGI (Parson) on Feb 28, 2007 at 19:00 UTC
    If want a specific subset of elements, then you can use a slice:
    my $item = join( ".", @code[0..2] ); my $not_item = join( ".", @code[9,7,0,3] );


    TGI says moo

Re^3: Use of uninitialized value
by andye (Curate) on Feb 28, 2007 at 16:45 UTC
    Fletch, agreed that it's untidy as it is, but  $code[0].$code[1].$code[2] ne join( ".", @code ).

    Best,

    andye

    Update: Anno is right, I did overlook a pair of quotes. Ignore me. :)

      You overlooked a pair of quotes. Assuming that @code contains three elements, "$code[0].$code[1].$code[2]" is indeed the same as join '.', @code.

      Anno

        Did I?

        Surely if @code = qw(foo bar baz)

        then $code[0].$code[1].$code[2] eq "foobarbaz"

        whereas  (join '.', @code) eq "foo.bar.baz"

        ?

        All the best,

        andye

        Update: You're completely right, I overlooked a pair of quotes. :)