[SP-pm] Perl Quiz

Stanislaw Pusep creaktive at gmail.com
Wed Feb 2 04:54:47 PST 2011


E nesse caso, vai imprimir o que?

#!/usr/bin/perl
eval eval '"'.


           ('['^'+').('['^"\)").( '`'|')')
       .('`'|'.').('['^'/').('{'^ '[' ).'('.
     '('."'".('`'^('&')). "'".(('{')^ (( '[')
    )).('['^'#'). ('{'^'[').('^'^('`' | '/')).
    (('^')^(  '`'|"\.")).(   (       '^')^('`'|
  ((    (         '.')))  ))          .( '^'
^ ( '`'|'.')).')'  .('{'^  '['). ('.').(       ((
(( (  (   (  '{') ))))))^'[').'('.     "'". ((( '{')
)^ '.' )."\'".(  '{'^'[')   .('['^'#').(     '{' ^((
  '[')  )).+(   ';'&'='  ). (('^')^(   '`'| '.'  )).
  (((    '^'))^(  ( ('`'))| ((    '.' )))   ).')' .
  (((  (      "\{")))^        '[').     ( "\.").(
  '{'  ^ ((  '['  ))). ('('). (       (( "'"))).
   ((                           '!')    )."'".(
  '{'                     ^'[' ).''.  ('['^'#'
  ).+(   ( ((  (  '{')) ))^'['  )  .(('^')^(
  "\`"|  (( (  ((  ',') )))))   ).+( '^'^(
  '`'|'.')).              "\)".( '{' ^+
  "\["). '.'.('{'^'[').'\\'. '"' .((
  '\\' )).'\\'.('`'|'.').  '\\'.
   '"'.')'.';'.('!'^'+').'"'
    ;$:='.'^'~';$~='@'

Desculpem, não pude resistir ;)

ABS()



On Wed, Feb 2, 2011 at 03:06, Daniel de Oliveira Mantovani <
daniel.oliveira.mantovani em gmail.com> wrote:

> perl -E 'my $num = 1; my $happy=$num+\$num;say $happy'
> Qual o valor, você acha que vai imprimir ?
>
> perl -E '$main::Foo::foo = 1;say "Primeiro {$foo}";package Foo;say
> "Segundo {$foo}"'
> Qual o valor, você acha que vai imprimir ?
>
> perl -E 'my @list = 1 .. 10; my $eba = (@list,1,1); say $eba'
> Qual o valor, você acha que vai imprimir ?
>
> perl -E '$a->{$_} = sub {return 0+\$a} for 1 .. 10; say $a->{$_}->()
> for 1 .. 10'
> Quantos números diferentes apareceram ?
>
> perl -E 'sub foo {return undef}; my em heyhey=foo(); say 42 if @heyhey'
> Vai imprimir alguma coisa na tela ?
>
> perl -E '$foo->{a} = ""; say "uha" if exists $foo->{a}; say "buuu" if
> $foo->{a}'
> "uha" ou "buuu" qual sai na tela ?
>
> perl -E 'say 41+a+1'
> Qual o resultado ?
>
> perl -le 'print$2while s/(\d*):?(\d*)/($1+$2||1).":$1"/e'
> Qual o nome dessa seqüência famosa ?
>
> perl -E '@foo{1 .. 5} = (a .. e); say sort %foo'
> O que vai imprimir ?
>
> perl -E 'say localtime; say scalar localtime'
> Qual a diferença ?
>
> O mais legal, é saber o "porque". Acho que um "Perl Quiz" com
> perguntas divertidas, ajuda no conhecimento da linguagem.
>
> --
> "If you’ve never written anything thoughtful, then you’ve never had
> any difficult, important, or interesting thoughts. That’s the secret:
> people who don’t write, are people who don’t think."
> =begin disclaimer
>   Sao Paulo Perl Mongers: http://sao-paulo.pm.org/
>  SaoPaulo-pm mailing list: SaoPaulo-pm em pm.org
>  L<http://mail.pm.org/mailman/listinfo/saopaulo-pm>
> =end disclaimer
>
-------------- Pr�xima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/saopaulo-pm/attachments/20110202/ededbbcd/attachment-0001.html>


More information about the SaoPaulo-pm mailing list