🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #9383

Operaci�n en un array en Perl

#9383
From: Eva Riart
Date: Tue, 23 Jul 2002 16:50
28 lines
1728 bytes
Hola,

 Como puedo hacer, de la forma m�s simple posible la siguiente operaci�n en
Perl?

             Dado un array de enteros:

                                          my @array_de_enteros;

             y un string como el siguiente:

                                          $string="10,20,40-45,50";

             Obtener en @array_de_enteros=[10,20,40,41,42,43,44,45,50];

              He pensado en utilizar la instrucci�n split:

                                          @array_de_enteros =
split(/,/,$string);

             con lo que obtengo:


@array_de_enteros=[10,20,40-45,50]

                  Como deber�a continuar?

                         Gracias!
Technical Details
Message-ID: <ahk1f8$8j2$1@news.wanadoo.es>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!newsfeed.comtenidos.com!newsfeeder.wanadoo.es!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,692681992ffe7fbf,start
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-07-23 10:01:56 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!newsfeed.comtenidos.com!newsfeeder.wanadoo.es!not-for-mail
From: "Eva Riart" <evariart@hotmail.com>
Newsgroups: es.comp.os.linux.programacion
Subject: Operaci�n en un array en Perl
Date: Tue, 23 Jul 2002 18:50:56 +0200
Organization: Wanadoo
Lines: 32
Message-ID: <ahk1f8$8j2$1@news.wanadoo.es>
NNTP-Posting-Host: 62-37-173-44.dialup.uni2.es
X-Trace: news.wanadoo.es 1027442985 8802 62.37.173.44 (23 Jul 2002 16:49:45 GMT)
X-Complaints-To: usenet@wanadoo.es
NNTP-Posting-Date: Tue, 23 Jul 2002 16:49:45 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000