semifor / net-twitter-lite

A lighter weight (non-Moose) Perl interface to the Twitter API
Other
26 stars 11 forks source link

Allow specifying optional arguments. #20

Closed dracos closed 8 years ago

dracos commented 8 years ago

(Sorry if I've misunderstood this, but I just tried to call verify_credentials(skip_status => 1) and received an error caused by this.)

@$arg_names is the number of required parameters, so we want to error if we have fewer than that, not more.

semifor commented 8 years ago

Hi, @dracos. Give this a try: verify_credentials({ skip_status => 1 }). Options can always be passed as a hashref. Methods with required parampters can take them positionally for convenience, e.g., update('Hello world!'), which is equivalent to: update({ status => 'Hello world!' }). verify_credentials has no required parameters, so the hashref is necessary.

Hope that helps.

dracos commented 8 years ago

Dur, like it says in the docs. Don't know how I misread that, apologies!