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
In reply to Re: Split on whitespace or other criteria
by neniro
in thread Split on whitespace or other criteria
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |