// $Id: reversefile.ici,v 1.0 2003/01/03 12:14:00 dada Exp $ // http://dada.perl.it/shootout // // contributed by Tim Long f = smash(getfile(), #[^\n]*\n#, "\\&"); r = array(); forall (l in f) rpush(r, l); put(implode(r)); /* * This is probably more natural, but slower... */ /* f = smash(getfile(), #[^\n]*\n#, "\\&"); while (nels(f)) put(pop(f)); */