Mailing List Archive

print woes
Is this behaviour justified anyhow?

monk:~->perl -e '$a->print 1'
Number found where operator expected at -e line 1, near "->print 1"
(Missing operator before 1?)
syntax error at -e line 1, near "->print 1"
Execution of -e aborted due to compilation errors.
Exit 2

monk:~->perl -e '$a=new A; print $a 1; sub A::new {bless [],A} sub A::print {}'
Not a GLOB reference at -e line 1.
Exit 2

Imagine a package that takes a glob ref to print to. If the above
restrictions would not apply, we could just give it an object of Term::Pager
class to get a paged output!

Any thoughts?

Ilya