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

both WWW::Curl::Easy::CURLOPT_HEADER or WWW::Curl::CURLOPT_HEADER couldn't work. I'm not sure where they got defined, may be it's inside the xs library? Any ideas? (btw, sorry for the node title, didn't know that would be a problem)

Replies are listed 'Best First'.
Re^3: why this couldn't work?
by Corion (Patriarch) on Jul 01, 2011 at 17:12 UTC

    If it is defined in the XS library, it will be available just the same as if it were defined in Perl space. I'm not sure what exactly you tested, and whether you get errors now, and what errors you get when using strict. It seems that WWW::Curl::Easy does something fancy with AUTLOAD, so you might want to inspect %WWW::Curl:: for interesting constant names.

    A helpful node title would include "WWW::Curl", btw, and describe the problem, instead of asking a general question that could just as well apply to growing tomatoes on the moon.

Re^3: why this couldn't work?
by Anonymous Monk on Jul 01, 2011 at 17:19 UTC
    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.

      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!