in reply to Split on whitespace or other criteria
How about adding a blank before the '-'sign.#!/usr/bin/perl use strict; use warnings; use Data::Dumper; while(<DATA>) { chomp; s/-/ -/g; print Dumper [split(/\s+/, $_)]; } __DATA__ 123.45 345.3 234.67 34.56 234.1 123.87 897.34 567.32-100.90
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Split on whitespace or other criteria
by Anonymous Monk on Jan 30, 2005 at 20:42 UTC | |
by sh1tn (Priest) on Jan 30, 2005 at 21:01 UTC | |
by Anonymous Monk on Jan 30, 2005 at 21:12 UTC |