yitzle schreef:

> while ( my $line =  <> ) {
>     $line =~ /cluster\[(\d)+\] = {([\d ]+)}/ or die;
>     my @vals = split( / +/, "$1 $2" );
>     print join(",", @vals) . "\n";
> }

Less strict alternative:

  while (<>) {
      my @vals = /([0-9]+)/g or die;
      print join(",", @vals) . "\n";
  }

or even:

  { local ($\, $,) = ("\n", ",");
    print /([0-9]+)/g while <>;
  }

-- 
Affijn, Ruud

"Gewoon is een tijger."

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to