in reply to Re^2: split problem...
in thread split problem...

Perhaps I should have read a little closer, although the cause of his issue is not immediately evident. I agree it is an unusual idiom. While the use in the loop could be rationalised the use in the two splits on ^ seems pretty dubious at first glance. This would be pretty usual sort of syntax assuming the data is in blocks as you suggest.

local $/ = ""; # set paragraph mode to read one record at a time while (my $record = <DATA>) { for ( split /[\n\r]+/, $record ) { my ($Num, $Qt, $_trashit) = split /\^/, $_; print "$Num || $Qt || $_trashit\n"; } } __DATA__ 22009^1^52.90 22010^1^42.90 22011^1^32.90 22009^1^52.90 22010^1^42.90 22011^1^32.90

cheers

tachyon