#!/usr/bin/perl print "Entrez votre ip :"; $ip=; @t=split(/(.)/,$ip); # Surround the delimiter in (), then the # regexp matches become array elements print scalar @t,"\n"; # Don't waste a variable print "[$_]\n" for @t; # Surround each match by brackets, # print each match on its own line. #### Entrez votre ip :21.23 11 [] [2] [] [1] [] [.] [] [2] [] [3] [ ] #### Entrez votre ip :21.23 3 [21] [.] [23 ] #### #!/usr/bin/perl print "Entrez votre ip :"; $ip=; @t=split(/[.\n]/,$ip); # Don't need \. for period in [ ] print scalar @t,"\n"; print "[$_]\n" for @t; #### Entrez votre ip :21.23 2 [21] [23]