Synchronicity. I just wrote this idea into some code an hour ago for a stock account package. I used the idiom from mysql. A config file in the user's home. So, something like-
use YAML (); my $config = YAML::LoadFile("$ENV{HOME}/.twitter.cnf"); # Where the file in question is only readable by the user- cow@moo[1607]~>sl .twitter.cnf -rw------- 1 cow staff 0 Jul 3 23:08 .twitter.cnf # And the config file looks like (YAML) this- --- username: MooseQueen password: twitterLuser
Then, presumably, all together-
use Net::Twitter; use YAML (); my $config = YAML::LoadFile("$ENV{HOME}/.twitter.cnf"); my $twit = Net::Twitter->new( traits => [qw/API::REST/], %{$config}, );
In reply to Re: best way to store login information for a perl script?
by Your Mother
in thread best way to store login information for a perl script?
by keiusui
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |