in reply to Re^2: blank lines up to a point
in thread blank lines up to a point
I get an error from this unless I alter the tell line to my $discard=tell(STDIN); then indeed it gives the advertised output (I am on an old perl version here, client requirements)
./flipflop Useless use of tell in void context at ./flipflop line 14. perl -v This is perl, version 5.005_03 built for sun4-solaris ...after the above edit.... root@tivpre-master:/home/robinp # ./fixedflop flipflipflipflop
that aside how does this work ? the docco says tell normaly returns -1 against STDIN, what dark juju is going on to make 0 true and what else could I use that I can trust never to be true ?
sub logit { local $.=1; my $line = shift @_; $line =~ s/\0//g; return unless (/\S/..0); print $line }
Many Thanks,
R.
|
|---|