in reply to Re^2: why this couldn't work?
in thread why this couldn't work?

I tried both, came up with this:
Bareword "WWW::Curl::CURLOPT_HEADER" not allowed while "strict subs" in use at t.cgi line 16.
Bareword "WWW::Curl::Easy::CURLOPT_TIMEOUT" not allowed while "strict subs" in use at t.cgi line 17.

Replies are listed 'Best First'.
Re^4: why this couldn't work?
by chromatic (Archbishop) on Jul 01, 2011 at 17:33 UTC

    You can fix that in one of two ways. Either use use (which is the simplest) or write instead WWW::Curl::CURLOPT_HEADER() and WWW::Curl::Easy::CURLOPT_TIMEOUT() to disambiguate them from barewords to function calls.

    Because use performs importing at compilation time, the parser knows that those functions are functions even without the parentheses. If you can't import those functions at compilation time, you'll have to disambiguate yourself or disable strict subs. (Don't disable strict subs.)

      you are the man, chromatic!