#!/usr/bin/perl eval{alir tsuj} ; while($b[$j++ ]=chop($@)){;}; open(L, "<".$0) ;while(<L>){#eu. $a[$i++]= $1 if /#([^\(|^!].*)$ /;}foreach(sort @a) { print $b[ $_=split //]}#q.. #vem vamos embora que esperar nao e saber, quem sabe faz a hora, nao e +spera acontecer... #tatu cutia nao paca tatu cotia nao paca tatu cotia nao paca tatu coti +a nao paca #diferente estou tao tranquil #chorando e foi entao que eu #aquele gosto amargo do... #but i realy dont know if . #por toda a minha vida eu . + #foi assim como ver o #viemos do egito, com #mas nao sou mas tao #lago da memoria #nada nada . + #uva maca #uva mac #gita. #oioi #sabi #vom . + #vum . #xuxa #r . #zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz +zzzzzzzzzz

Replies are listed 'Best First'.
Re: All in one
by smokemachine (Hermit) on Jan 09, 2006 at 14:15 UTC
    in order of this to work, one should save it as obs4.pl and execute it with ./
    since it gets the error message from the eval, the name of the file alters what it prints.

    thanks for your patience!
      darren@barney:~/perlmonks$ ./obs4.pl jut" ae/ her.pe" pmackerdarren@barney:~/perlmonks$

      Closer, but still no cigar ;)

      smokemachine,
      This pretty much precludes Windows then. I tried a few tricks to get it to work and still nothing. Perhaps you want to try and modify not to depend on your personal environment so much?

      Cheers - L~R

Re: All in one
by McDarren (Abbot) on Jan 09, 2006 at 14:02 UTC
    Running perl 5.8.4 on Debian Linux (2.4.19), with the original version of your code I get:
    ?)us2 eitle)..el pt e

    And with the modified version:

    )?ju aen ev.hei phaeeev

    So I guess something isn't quite right :)

Re: All in one
by Limbic~Region (Chancellor) on Jan 09, 2006 at 13:25 UTC
    smokemachine,
    I am not sure what the output is supposed to be, but what I get on AS Perl 5.8.7 on Windows is:
    ts d2?e )les..eal m? e

    Cheers - L~R

      sorry, i'd forgotten the page would ignore the whitespaces in the end of the lines, but it's all fixed now.
      #!/usr/bin/perl eval{alir tsuj} ; while($b[$j++ ]=chop($@)){;}; open(L, "<".$0) ;while(<L>){#eu. $a[$i++]= $1 if /#([^\(|^!].*)$ /;}foreach(sort @a) { print $b[ $_=split //]}#q.. #vem vamos embora que esperar não é saber, quem sabe faz a hora, não e +spera acontecer... #tatu cutia não paca tatu cotia não paca tatu cotia não paca tatu coti +a não paca #diferente estou tão tranquil #chorando e foi então que eu #aquele gosto amargo do... #but i realy dont know if . #por toda a minha vida eu + . #foi assim como ver o #viemos do egito, com #mas não sou mas tão #lago da memória #nada nada + . #uva maçã #uva maç #gita. #oioi #sabi #vom + . #vum . #xuxa #r . #zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz +zzzzzzzzzz
        smokemachine,
        That's not any better. I am using the download link and copy/pasting exactly. Now I get:
        t" d ?e )mea."eal m? pe

        Cheers - L~R

Re: All in one
by smokemachine (Hermit) on Jan 09, 2006 at 15:03 UTC
    it was an accentuation problem....
    please, tell me if it works now - it should.

    (original post updated)
      darren@barney:~/perlmonks$ ./obs4.pl just another perl hackerdarren@barney:~/perlmonks$

      yay!!!
      (although a newline would be nice :)

      smokemachine,
      Sorry - still not working. I am using Cygwin so I can use ./obs4.pl and I get. I am tiring of this "try it now" game. Good luck!
      ust"e i/atnie(ni lt ocni

      Cheers - L~R

      Update: After changing line endings I got it to work.
Re: All in one
by turo (Friar) on Jan 10, 2006 at 19:52 UTC

    You use a technique seems like the one used on the previous post, but I like very much your lambada ;)
    I can't see the results, but I'll track your code while i singing ...

    perl -e 'eval{alir tsuj}; 1 while($b[$j++]=chop($@)); print @b;'
    Interesting. You put part for $@ in reversed form, character by character on the array @b:
    .1 enil e- ta )?"just" daol ot togrof uoy spahrep( "just" egakcap aiv +"rila" doh
    And then print the indexed elements
    turo@indus:/tmp$ perl -ne 'print $_,"\n" for ((/#([^\(|^\!].*)$/))' p. +pl | sort | perl -ne 'print (scalar(split //),", ")'
    26, 27, 28, 29, 4, 21, 6, 16, 20, 88, 5, 80, 4, 57, 5, 80, 8, 9, 88, 2 +1, 103, 70, 5, 80
    and the magic:
    perl -e 'eval{alir tsuj}; 1 while($b[$j++]=chop($@)); for ((26, 27, 28 +, 29, 4, 21, 6, 16, 20, 88, 5, 80, 4, 57, 5, 80, 8, 9, 88, 21, 103, 7 +0, 5, 80)){ print "$b[$_]"; }
    Jesus!, nothing!!!
    ol oeti?sjnhe"nh ejtC nh
    ufff, pretty obfuscate!! :-P ...
    26 J 27 u 28 s 29 t 4, ' ' 21, a 6, n 16, o 20, t 88, h 5, e 80, r 4, ' ' 57, P 5, e 80, r 8, l 9, ' ' 88, h 21, a 103, c 70, k 5, e 80 r
    ;) ...

    Chorando se foi ... lalalala lala la lala

    turo

    perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'
      My @b:
      .2 enil lp.4sbo/. ta )?"just" daol ot togrof uoy spahrep( "just" egakc +ap aiv "rila" dohtem tcejbo etacol t'naC

        I didn't notice that the node "Simple, but i liked too much..." was yours ^_^ ...

        Okay, i suppose that was my fault ...

        perl -e '; eval{alir tsuj}; 1 while($b[$j++]=chop($@)); print @b;'
        that prints out the same as you...
        .2 enil e- ta )?"just" daol ot togrof uoy spahrep( "just" egakcap aiv +"rila" dohtem tcejbo etacol t'naC
        Wait a minute, I've got what was the problem, we must call the file exactly as 'obs4.pl' and call it by put the './obs4.pl' to obtain the result ...
        but ... buff ... :'( ... and I was thinking that the result was an homophonic cipher ... to be decoded

        cheers

        perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'