in reply to read through \x0a in data piped via STDIN
Try adding:
$/ = undef;
after your 'use' statements:
#!/usr/bin/perl use strict; use warnings; $/ = undef; my $s1 = <STDIN>; print("\$s1= <$s1> \n"); if (<STDIN>) { my $s2 = <STDIN>; print("\$s2= <$s1> \n") }
By not defining (undef) the input record separator (default newline), it will read to EOF.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: read through \x0a in data piped via STDIN
by How09 (Novice) on Dec 09, 2010 at 18:23 UTC |