in reply to Script ignoring while loop on Mountain Lion and Mavericks
it only takes the first line of input, as if it is ignoring the while loop
Nope, your file only contains one line :)
You can use
to find out what kind of line endings your files are in, then you can set $/ appropriately and there will be more than one line to readuse Path::Tiny qw/ path /; dd( path( shift )->slurp_raw ); sub dd { use Data::Dumper; print Data::Dumper->new([@_])->Sortkeys(1) ->Indent(1)->Useqq(1)->Dump . "\n"; }
Your other alternative is to readline n-bytes at a time, see perlvar#$/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Script ignoring while loop on Mountain Lion and Mavericks (newline)
by maklujkar (Initiate) on Feb 13, 2014 at 02:45 UTC |