[SP-pm] Separar o primeiro do resto

Tiago Peczenyj tiago.peczenyj at gmail.com
Wed May 1 07:09:40 PDT 2013


Sem problemas.

There is more than..
Em 01/05/2013 10:57, "André Walker" <andre at andrewalker.net> escreveu:

> Ops, desculpe, não tinha lido a thread inteira!
>
> On Wed, May 01, 2013 at 10:53:31AM -0300, André Walker wrote:
>
>> On Tue, Apr 30, 2013 at 07:37:41PM -0300, Tiago Peczenyj wrote:
>>
>>> Seguinte: tenho X bytes como
>>>
>>> $x="12345"
>>>
>>> E quero pegar o primeiro e o resto:
>>>
>>> ($a,$b) = magica $x;
>>>
>>> $a = 1
>>> $b = 2345
>>>
>>> Comofas?
>>>
>>
>> Se eu entendi bem o que você tá perguntando:
>>
>>    sub magica {
>>        substr($_[0], 0, 1), substr($_[0], 1)
>>    }
>>
>>
> =begin disclaimer
>   Sao Paulo Perl Mongers: http://sao-paulo.pm.org/
> SaoPaulo-pm mailing list: SaoPaulo-pm at pm.org
> L<http://mail.pm.org/mailman/**listinfo/saopaulo-pm<http://mail.pm.org/mailman/listinfo/saopaulo-pm>
> >
> =end disclaimer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/saopaulo-pm/attachments/20130501/612b1d07/attachment.html>


More information about the SaoPaulo-pm mailing list