mardi 4 août 2015

How can I group sequential numbers in a perl array?

I am trying to write a perl script in which if I have a sample array which looks like below :

@array = (0,1,2,3,4,8,9,10,12,14,16,17,19)

then I need to convert/format this array in way so that I get the output in a format which looks like below :

output_bus[0-4, 8-10, 12, 14, 16-17, 19]



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire