Pages

Showing posts with label split integer values. Show all posts
Showing posts with label split integer values. Show all posts

Tuesday, May 15, 2012

split integer value from others character



  #!/usr/bin/perl

  use strict;


  my $data = '2323424: 2434324, 3455543543';
  my @ftr =();
  my @values = ();
 
   @values = split(/(\d+)/, $data);

  foreach my $val (0 ..  $#values) {

unless ( $values[$val] =~/^[0-9]+$/)
{
splice(@values, $val, 1);

}

  }

  print " @values\n";
  exit 0;

 

site weekly hits