fork download
  1. #!/usr/bin/perl
  2. # need 5.010 to use say; instead of print;
  3. use 5.010;
  4. # http://c...content-available-to-author-only...e.com/questions/91797/hate-love-conundrum
  5.  
  6. #@_=(hat,lov);$x.=" I ".$_[$_%2]."e that"for 1..<>;$_=$x;s/that$/it./;say
  7.  
  8. for$x(1..<>){$_.=' I '.($x%2?hat:lov).'e that'}s/\w+$/it./;say
Success #stdin #stdout 0s 6056KB
stdin
3
stdout
 I hate that I love that I hate it.