[SP-pm] Ler o stdin para uma string

Daniel de Oliveira Mantovani daniel.oliveira.mantovani at gmail.com
Mon Jul 19 19:32:41 PDT 2010


Ops, esqueci do ";",

$/=$\;$a=<>

11 caracteres se eu não contei errado.

2010/7/19 Daniel de Oliveira Mantovani <daniel.oliveira.mantovani em gmail.com>:
> Você pode reduzir para 10 caracteres abusando das variáveis especiais.
>
> $/=$\$a=<>
>
> []'s
>
> 2010/7/19 Eden Cardim <edencardim em gmail.com>:
>>>>>>> "Thiago" == Thiago Glauco Sanchez <thiagoglauco em ticursos.net> writes:
>>
>>    Thiago> Menor que isso...  @t=<>
>>
>> Acho que ele quer colocar num escalar. Teria que ser algo como
>>
>> $_=join'',<>
>>
>> Que tem os mesmos 12 chars de
>>
>> $t.=$_ for<>
>>
>> e
>>
>> map$t.=$_,<>
>>
>>    Thiago> $t = <> Mas a segunda fica limitada a apenas uma linha de
>>    Thiago> entrada.
>>
>> É mas ele quer o STDIN todo.
>> _______________________________________________
>> SaoPaulo-pm mailing list
>> SaoPaulo-pm em pm.org
>> http://mail.pm.org/mailman/listinfo/saopaulo-pm
>
>
>
> --
> http://www.danielmantovani.com
>
> "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."
>



-- 
http://www.danielmantovani.com

"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."


More information about the SaoPaulo-pm mailing list