in reply to My first JAPH (a project to learn more perl)

I suppose trying to reduce this too far will end up with a single print statement. However, here's a more concise version:
perl(); sub perl { $h = "hacker"; @j = qw(Perl Just Rocks); $j[$#j+1]=("another"); print "\n@j[1, 3, 0] $h;\n"; }
Well... concise with a little more punctuation.

Replies are listed 'Best First'.
RE: RE: My first JAPH (a project to learn more perl)
by Coplan (Pilgrim) on Sep 28, 2000 at 16:34 UTC
    Wouldn't the pound sign (#) in the second line make the rest of that line a remark?
      No.

      $# returns the subscript of the last element in an array. So if you'd have an array called @array with six elements, $#array would return 5:
      qw(one two three four five six); print $array[$#array]; # prints "six"
      $j[$#j+1] = ("another");
      is actually just obfuscation for this:
      push @j, "another";

      [~]