in reply to sort after split

@fields = sort { $a cmp $b } split /\t/, $entry;

sort


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: sort after split
by lakeTrout (Scribe) on Dec 05, 2007 at 20:08 UTC
    Thanks Dragonchild,
    I read that in perldoc, however, my output is just the parens, like so:
    • ()
    • ()
    • ()
    Any idea why? Thanks!

    Thanks!
      Check to make sure $entry has what you think it does. That sounds like $entry is "\t\t" (or somesuch). Try adding the -w flag.

      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
        Hi DC

        The -w has never given me any warnings, sorry :(