http://qs321.pair.com?node_id=742331


in reply to Re^2: Creating an index on a string-collection
in thread Creating an index on a string-collection

Hey, reverse() on a scalar doesn't reverse it! I wonder why I thought it did. Fixed code will go in the original node in a moment. I'm sure there are other bugs though - this was just example code!

-sam

  • Comment on Re^3: Creating an index on a string-collection

Replies are listed 'Best First'.
Re^4: Creating an index on a string-collection
by AnomalousMonk (Archbishop) on Feb 09, 2009 at 08:00 UTC
    It does in  scalar context:
    >perl -wMstrict -le "my $s = 'foobar'; print reverse $s, 'zot'; print scalar reverse $s, 'zot'; " zotfoobar tozraboof
      Ah, thanks. Someday, when Perl is long gone, I'm not going to miss caring about what context my function calls are in!

      -sam