in reply to Re: using join with a print ref statement
in thread using join with a print ref statement

print (ref $result) ? (join ":", @$result) : "no results";

"I looks like a function, hence it is a function." That will parse as   (print(ref $result)) ? (join ":", @$result) : "no results"; You need to disambiguate with a +:   print +(ref $result) ? (join ":", @$result) : "no results"; But I don't understand what's wrong with   print ref($result) ? (join ":", @$result) : "no results"; or for that matter,   print ref $result ? (join ":", @$result) : "no results"; either. Since that will actually parse the intended way.

ihb

Replies are listed 'Best First'.
Re: Re: Re: using join with a print ref statement
by dpuu (Chaplain) on Jan 20, 2003 at 20:04 UTC
    Duh! You're right, I was careless. --Dave