fork download
  1. #!/usr/bin/perl
  2. sub f { sort shift =~ /(\w+)/g }
  3. # test main
  4. @a = f(<>);
  5. use Data::Dumper; print Dumper \@a;
Success #stdin #stdout 0.02s 6616KB
stdin
Animals are happy so long as they have health and enough to eat. Human beings, one feels, ought to be, but in the modern world they are not, at least in a great majority of cases.
stdout
$VAR1 = [
          'Animals',
          'Human',
          'a',
          'and',
          'are',
          'are',
          'as',
          'at',
          'be',
          'beings',
          'but',
          'cases',
          'eat',
          'enough',
          'feels',
          'great',
          'happy',
          'have',
          'health',
          'in',
          'in',
          'least',
          'long',
          'majority',
          'modern',
          'not',
          'of',
          'one',
          'ought',
          'so',
          'the',
          'they',
          'they',
          'to',
          'to',
          'world'
        ];