view release on metacpan or search on metacpan
mason/execute_sql.mhtml view on Meta::CPAN
</td>
<%args>
$s
$user => undef
$password => undef
$host => undef
$port => undef
</%args>
<%init>
eval
{
$s->create( user => $user,
password => $password,
host => $host,
port => $port,
);
$s->save_to_file;
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alzabo/Create/Schema.pm view on Meta::CPAN
parameter.
=back
In addition, this method takes any parameters that can be used when
connecting to the RDBMS, including "user", "password", "host", and
"port".
Returns a new C<Alzabo::Create::Schema> object.
=head2 Other Methods
lib/Alzabo/Create/Schema.pm view on Meta::CPAN
schema to be marked as instantiated.
Wherever possible, existing data will be preserved.
This method takes any parameters that can be used when connecting to
the RDBMS, including "schema_name", "user", "password", "host", and
"port".
If a "schema_name" parameter is given, then this will be the name
given to the schema in the RDBMS.
lib/Alzabo/Create/Schema.pm view on Meta::CPAN
Drops the database/schema from the RDBMS. This will cause the schema
to be marked as not instantiated. This method does not delete the
Alzabo files from disk. To do this, call the C<delete()> method.
This method takes any parameters that can be used when connecting to
the RDBMS, including "schema_name", "user", "password", "host", and
"port".
Throws: L<C<Alzabo::Exception::Driver>|Alzabo::Exceptions>
=head2 sync_backend
lib/Alzabo/Create/Schema.pm view on Meta::CPAN
immediately after running this method, running it again may still
cause it to execute SQL commands. Fortunately, the SQL it generates
will not cause anything to break.
This method takes any parameters that can be used when connecting to
the RDBMS, including "schema_name", "user", "password", "host", and
"port".
Throws: L<C<Alzabo::Exception::Driver>|Alzabo::Exceptions>
=head2 sync_backend_sql
If there is no corresponding schema in the RDBMS backend, then this
method returns the SQL necessary to create the schema from scratch.
This method takes any parameters that can be used when connecting to
the RDBMS, including "schema_name", "user", "password", "host", and
"port".
Throws: L<C<Alzabo::Exception::Driver>|Alzabo::Exceptions>
=head2 delete
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/Dash/Button.pm view on Meta::CPAN
=item in the mobile app you would find a menu "Your Dash Button" -> "Settings" then "Set up a new device".
=item choose your dash device, then follow the instructions: long press on the button until it discovery mode (blue light)
=item provide the wifi password of your network
=item but do not select the exact product linked to your button exit from there !
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
=head1 SYNOPSIS
my $agent = Amazon::MWS::Uploader->new(
db_dsn => 'DBI:mysql:database=XXX',
db_username => 'xxx',
db_password => 'xxx',
db_options => \%options
# or dbh => $dbh,
schema_dir => '/path/to/xml_schema',
feed_dir => '/path/to/directory/for/xml',
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
=item db_dsn
=item db_username
=item db_password
=item db_options
E.g.
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
AutoCommit and RaiseError are set by us.
=cut
has db_dsn => (is => 'ro');
has db_password => (is => 'ro');
has db_username => (is => 'ro');
has db_options => (is => 'ro',
isa => AnyOf[Undef,HashRef],
);
has dbh => (is => 'lazy');
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
die "Missing dns" unless $dsn;
my $options = $self->db_options || {};
# forse raise error and auto-commit
$options->{RaiseError} = 1;
$options->{AutoCommit} = 1;
my $dbh = DBI->connect($dsn, $self->db_username, $self->db_password,
$options) or die "Couldn't connect to $dsn!";
return $dbh;
}
=item purge_missing_products
view all matches for this distribution
view release on metacpan or search on metacpan
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/SendToKindle.pm view on Meta::CPAN
file_name => $_[1],
address => $_[2],
smtp_server => $_[3],
smtp_port => $_[4],
smtp_user => $_[5],
smtp_password => $_[6]
};
bless $self, $class;
return $self;
}
lib/Amazon/SendToKindle.pm view on Meta::CPAN
# Setup Net::SMTP.
my $email = new Net::SMTP::TLS(
$self->{smtp_server},
Port => $self->{smtp_port},
User => $self->{smtp_user},
Password => $self->{smtp_password},
Timeout => 60);
$email->mail($self->{address});
$email->to($account);
$email->data();
lib/Amazon/SendToKindle.pm view on Meta::CPAN
"document.pdf",
"your@email.com",
"smtp.server.com",
$port,
"username",
"password);
$kindle->send("amazon_username", 0); # Do not include the @kindle.com
=head1 DESCRIPTION
This is my first module for the Perl community. It was created to be used in one of my projects called Whisper: https://github.com/nathanpc/whisper
view all matches for this distribution
view release on metacpan or search on metacpan
bin/amberdb_cli.pl view on Meta::CPAN
$opt_token = $ARGV[++$arg_idx];
}
elsif ( ( $curr =~ /^--(?:user|username)$/i || $curr =~ /^-u$/i ) && $arg_idx + 1 < @ARGV && $ARGV[$arg_idx + 1] !~ /^-/ ) {
$opt_user = $ARGV[++$arg_idx];
}
elsif ( ( $curr =~ /^--(?:pass|password|passwd)$/i || $curr =~ /^-p$/i ) && $arg_idx + 1 < @ARGV && $ARGV[$arg_idx + 1] !~ /^-/ ) {
$opt_pass = $ARGV[++$arg_idx];
}
elsif ( ( $curr =~ /^--(?:format)$/i || $curr =~ /^-f$/i ) && $arg_idx + 1 < @ARGV && $ARGV[$arg_idx + 1] !~ /^-/ ) {
$opt_format = lc($ARGV[++$arg_idx]);
}
bin/amberdb_cli.pl view on Meta::CPAN
$method_args{data} = $val;
}
elsif ( $k eq 'user' || $k eq 'username' ) {
$opt_user = $val;
}
elsif ( $k eq 'pass' || $k eq 'password' || $k eq 'passwd' ) {
$opt_pass = $val;
}
elsif ( $k eq 'database' || $k eq 'dbname' ) {
$opt_database = $val;
$adb->{_connect}->{database} = $val;
bin/amberdb_cli.pl view on Meta::CPAN
my $token = eval {
$adb->connect(
database => $conn_db,
username => $conn_user,
( defined $conn_pass && length $conn_pass ? ( password => $conn_pass ) : () ),
);
};
if ( $@ || !$token ) {
my $err = $@ || $adb->last_error() || "Authentication failed";
$err =~ s/ at .* line \d+.*//s;
bin/amberdb_cli.pl view on Meta::CPAN
print "-" x 60, "\n";
for my $u (@users) {
printf( "%-20s %-15s %-15s\n",
$u->{username},
$u->{role},
$u->{has_password} ? "Yes (Shadow)" : "No (Passwordless)"
);
}
print "-" x 60, "\n";
}
exit 0;
}
elsif ( $subcmd eq 'add' ) {
my $u = shift @pos_args // $opt_user;
my $p = shift @pos_args // $opt_pass // '';
my $role = shift @pos_args // 'user';
die "[AMBERDB_ERROR] Usage: amberdb user add <username> [password] [role]\n" unless defined $u && length $u;
$adb->user_add( $u, $p, role => $role );
output_result( { status => 'ok', action => 'user_add', username => $u, role => $role }, $opt_format );
exit 0;
}
elsif ( $subcmd eq 'passwd' ) {
my $u = shift @pos_args // $opt_user;
my $p = shift @pos_args // $opt_pass // '';
die "[AMBERDB_ERROR] Usage: amberdb user passwd <username> <new_password>\n" unless defined $u && length $u;
$adb->user_passwd( $u, $p );
output_result( { status => 'ok', action => 'user_passwd', username => $u }, $opt_format );
exit 0;
}
elsif ( $subcmd eq 'del' || $subcmd eq 'delete' ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ambrosia/Addons/Accessor.pm view on Meta::CPAN
unless ( $level )
{#Authorization is not required
return new Ambrosia::Addons::Accessor::Result()->SET_PERMIT;
}
#If no username or password then prohibit
return new Ambrosia::Addons::Accessor::Result()->SET_DENIED unless $login && $passwd;
#check username and password
return $self->check_password($login, $passwd, $level);
}
sub exit :Abstract
{
}
sub remember_authorize_info :Abstract
{
}
sub check_password
{
my $self = shift;
my $login = shift || '';
my $passwd = shift || '';
my $level = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
Amethyst/Brain/Infobot/Module/Excuse.pm view on Meta::CPAN
secretary plugged hairdryer into UPS
terrorist activities
not enough memory, go get system upgrade
interrupt configuration error
spaghetti cable cause packet failure
boss forgot system password
bank holiday - system operating credits not recharged
virus attack, luser responsible
waste water tank overflowed onto computer
Complete Transient Lockout
bad ether in the cables
Amethyst/Brain/Infobot/Module/Excuse.pm view on Meta::CPAN
Smell from unhygenic janitorial staff wrecked the tape heads
Little hamster in running wheel had coronary; waiting for replacement to be Fedexed from Wyoming
Evil dogs hypnotized the night shift
Plumber mistook routing panel for decorative wall fixture
Electricians made popcorn in the power supply
Groundskeepers stole the root password
high pressure system failure
failed trials, system needs redesigned
system has been recalled
not approved by the FCC
need to wrap system in aluminum foil to fix problem
view all matches for this distribution
view release on metacpan or search on metacpan
eg/Hello/config/development.pl view on Meta::CPAN
+{
'DBIx::Skinny' => {
dsn => 'dbi:SQLite:dbname=test.db',
username => '',
password => '',
},
'Text::Xslate' => {
path => ['tmpl/'],
},
view all matches for this distribution
view release on metacpan or search on metacpan
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
view all matches for this distribution
view release on metacpan or search on metacpan
this function understand array input, id[1], id[2],id[3]...
=head2 salt()
Return randomic string, used for generate password
=head2 escape(string)
URL encode
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Database/MySQL.pm view on Meta::CPAN
The IP address of the computer where the MySQL B<DATABASE> is hosted. A value
of B<127.0.0.1> is used by default.
=item PASSWORD I<(String, Optional)>
The password of the B<USERNAME> that is accessing the MySQL database. A value
of B<undef> is used by default.
=item PORT I<(String, Optional)>
The IP address port number of the computer where the MySQL B<DATABASE> is
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Database/Oracle.pm view on Meta::CPAN
The IP address of the computer where the Oracle B<DATABASE> is hosted. A value
of B<127.0.0.1> is used by default.
=item PASSWORD I<(String, Optional)>
The password of the B<USERNAME> that is accessing the Oracle database. A value
of B<undef> is used by default.
=item PORT I<(String, Optional)>
The IP address port number of the computer where the Oracle B<DATABASE> is
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Database/PostgreSQL.pm view on Meta::CPAN
Either the content of the I<PGHOST> environment variable or a value of
B<127.0.0.1> is used by default.
=item PASSWORD I<(String, Optional)>
The password of the B<USERNAME> that is accessing the PostgreSQL database. The
content of the I<PGPASSWORD> environment variable is used by default.
=item PORT I<(String, Optional)>
The IP address port number of the computer where the PostgreSQL B<DATABASE> is
view all matches for this distribution
view release on metacpan or search on metacpan
lib/util.pm view on Meta::CPAN
my $filtered = omit(\%hash, @keys);
Returns a new hashref with the specified keys removed.
Opposite of C<pick>.
my $safe = omit(\%user, 'password', 'secret_token');
=head2 pluck
my @ids = pluck(\@users, 'id');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Android/Build.pm view on Meta::CPAN
"echo $keyStorePwd |".
"jarsigner $alg -keystore $keyStoreFile $apkFile $keyAlias";
my $s = zzz($c);
$s =~ /reference a valid KeyStore key entry containing a private key/s and
confess "Invalid keystore password: $keyStorePwd ".
"for keystore:\n$keyStoreFile\n".
"Specify the correct password via the keyStorePwd() method\n";
$s =~ /jar signed/s or confess "Unable to sign $apkFile\n";
if ($android->verifyApk) # Optional verify
{my $v = zzz("jarsigner -verify $apkFile");
view all matches for this distribution
view release on metacpan or search on metacpan
t/t-data/example-screen-layout.xml view on Meta::CPAN
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><hierarchy rotation="0"><node index="0" text="" resource-id="" class="android.widget.FrameLayout" package="com.huawei.android.launcher" content-desc="" checkable="false" checked="false" clickabl...
view all matches for this distribution
view release on metacpan or search on metacpan
Annelidous/Search/Ubersmith.pm view on Meta::CPAN
# Authentication per-service
# I.E. sub-accounts
sub auth_service {
my $self=shift;
my $username=shift;
my $password=shift;
my $c=$self->find("and username=? and password=?", $username,$password);
# Return the single authorized package/service.
return [$c->{id}];
}
# Authentication per-account
# I.E. master accounts
sub auth_account {
my $self=shift;
my $username=shift;
my $password=shift;
my @cl=$self->db_fetch("select clientid from CLIENT where clientid=? and password=? limit 1",$username,$password);
if ($#cl > -1) {
return $self->authorized_services($cl[0]->{clientid});
}
return 0;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnnoCPAN/Control.pm view on Meta::CPAN
}
=item $obj->Create_user
Coming from the New_user form, create a new account. Uses the login, passwd,
passwd2, and email CGI parameters. Checks that the login and password are not
blank, that the passwords match, and that the login is not already taken.
=cut
sub Create_user {
my ($self) = @_;
lib/AnnoCPAN/Control.pm view on Meta::CPAN
my $passwd = $self->param('passwd');
my $passwd2 = $self->param('passwd2');
my $email = $self->param('email');
my %vars = (login => $login, email => $email);
return ({%vars, error => "missing password"}, "new_user")
unless (length $passwd);
return ({%vars, error => "missing login"}, "new_user")
unless (length $login);
lib/AnnoCPAN/Control.pm view on Meta::CPAN
if (AnnoCPAN::DBI::User->retrieve(username => $login)) {
return ({%vars, error => 'login already taken'}, "new_user");
}
if ($passwd ne $passwd2) {
return ({%vars, error => "passwords don't match"}, "new_user");
}
my $user = AnnoCPAN::DBI::User->create({
username => $login,
password => crypt($passwd, $login),
email => $email,
member_since => time,
privs => 1,
});
$self->set_login_cookies($user);
lib/AnnoCPAN/Control.pm view on Meta::CPAN
sub Login {
my ($self) = @_;
my $passwd = $self->param('passwd');
my $user = eval { $self->param_obj('User', 'username') };
unless ($user and crypt($passwd, $user->password) eq $user->password) {
return $self->Main({error => 'invalid login/password'});
}
$self->set_login_cookies($user);
my $from = $self->param('from');
$self->redirect($from =~ /logout/ ? '/' : $from);
return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ansible/Util/Roles/Constants.pm view on Meta::CPAN
version 0.001
=cut
use constant {
ARGS_VAULT_PASS_FILE => '--vault-password-file',
CACHE_NS_VARS => 'ansible-vars',
CACHE_KEY => 'default',
CMD_ANSIBLE_PLAYBOOK => 'ansible-playbook',
DEFAULT_CACHE_EXPIRE_SECS => 60 * 10, # 10 mins
};
view all matches for this distribution
view release on metacpan or search on metacpan
SECURITY.md view on Meta::CPAN
issues.**
Privately report vulnerabilities to the maintainers listed at the end
of this document. Include as many details as possible to reproduce the
issue, including code samples or test cases. Check that your report
does not expose any of your sensitive data, such as passwords, tokens,
or other secrets.
You do not need to have a solution or fix. Depending on the issue,
CPANSec may be notified. Depending on the issue, CPANSec may be
notified.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyData.pm view on Meta::CPAN
# read a remote file and access it via a tied hash
#
my $table = adTie( 'XML', 'http://www.foo.edu/bar.xml' );
# same with username/password
#
my $table = ( 'XML', 'ftp://www.foo.edu/pub/bar.xml', 'r'
{ user => 'me', pass => 'x7dy4'
);
view all matches for this distribution
view release on metacpan or search on metacpan
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/ClickHouse.pm view on Meta::CPAN
my %_param = (
host => '127.0.0.1',
port => 8123,
database => 'default',
user => undef,
password => undef
);
foreach my $_key ( keys %_param ) {
unless ($param->{$_key}){
$param->{$_key} = $_param{$_key};
}
}
unless ($param->{uri}) {
my $_uri = URI->new(sprintf ("http://%s:%d/",$param->{host},$param->{port}));
$_uri->query_param('user' => $param->{user}) if $param->{user};
$_uri->query_param('password' => $param->{password}) if $param->{password};
$_uri->query_param('database' => $param->{database});
$param->{uri} = $_uri;
}
return $param;
lib/AnyEvent/ClickHouse.pm view on Meta::CPAN
clickhouse_select
{ # connection options
host => '127.0.0.1',
port => 8123,
user => 'Harry',
password => 'Alohomora',
database => 'Hogwarts'
},
'select * from test FORMAT Pretty', # query
sub { # callback function if status ok 200
my $data = shift;
lib/AnyEvent/ClickHouse.pm view on Meta::CPAN
clickhouse_select
{
host => '127.0.0.1',
user => 'Harry',
password => 'Alohomora'
},
'select * from test',
sub { # callback function if status ok 200
my $data = shift;
lib/AnyEvent/ClickHouse.pm view on Meta::CPAN
use URI;
use URI::QueryParam;
my $uri = URI->new(sprintf ("http://%s:%d/",'127.0.0.1',8123)); # host and port
$uri->query_param('user' => 'Harry');
$uri->query_param('password' => 'Alohomora');
$uri->query_param('database' => 'default');
clickhouse_select
{
uri => $uri
lib/AnyEvent/ClickHouse.pm view on Meta::CPAN
clickhouse_do
{
host => '127.0.0.1',
user => 'Harry',
password => 'Alohomora'
},
"INSERT INTO test (id, f1, f2) VALUES",
sub { # callback function if status ok 200
my $data = shift;
# do something
lib/AnyEvent/ClickHouse.pm view on Meta::CPAN
clickhouse_select_array
{
host => '127.0.0.1',
user => 'Harry',
password => 'Alohomora'
},
'select * from test',
sub { # callback function if status ok 200
my $data = shift;
lib/AnyEvent/ClickHouse.pm view on Meta::CPAN
clickhouse_select_hash
{
host => '127.0.0.1',
user => 'Harry',
password => 'Alohomora'
},
'select * from test',
sub { # callback function if status ok 200
my $data = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/CouchDB.pm view on Meta::CPAN
$db = couchdb('database');
$db = couchdb('http://somewhere.com:7777/database/');
With authentication:
# user is the username and s3cret is the password
$db = couchdb('http://user:s3cret@somewhere.com:7777/database');
Work with individual CouchDB documents;
my $user = $db->open_doc('~larry')->recv;
view all matches for this distribution
view release on metacpan or search on metacpan
t/superfluous_warning.t view on Meta::CPAN
local *STDERR;
open STDERR, '>', \my $stderr or die $!;
# failed connect (because of wrong port 3307) will add undefined $dbh into {CachedKids}
AnyEvent::DBI::MySQL->connect($h->dsn.';port=3307', $h->username, $h->password,
{RaiseError=>0,PrintError=>0});
# passed connect shouldn't print warnings because of undefined $dbh in {CachedKids}
AnyEvent::DBI::MySQL->connect($h->connection_info,
{RaiseError=>0,PrintError=>0});
# work around warning in EV because ./Build test run `perl -w`
view all matches for this distribution
view release on metacpan or search on metacpan
t/fake-mysql view on Meta::CPAN
specific queries to specific DSNs. If you do not want non-matching queries to
be forwarded, either create a match-all rule at the bottom of your last
configuration file or omit the C<--dsn> option. If you omit the option, an
error message will be sent to the client.
C<--dsn_user> and C<--dsn_password> can be used to specify username and
password for DBI drivers where those can not be specified in the DSN string.
=head1 RULES
Rules to be executed are contained in configuration files. The configuration
files are actually standard perl scripts and are executed as perl
t/fake-mysql view on Meta::CPAN
on the command line.
C<dsn> behaves identically, however a database handle is contructed from the
C<dsn> provided and an attempt is made to connect to the database. If C<dsn> is
a reference to an array, the first item from the array is used as a DSN, the
second one is used as username and the third one is used as password.
C<before> this can be a reference to a subroutine that will be called after a
matching query has been encountered but before any further processing has taken
place. The subroutine will be called with the text of the query as the first
argument, followed by extra arguments containing the strings matched from any
t/fake-mysql view on Meta::CPAN
specific rule has its own C<dsn>, the value of those variables will always
refer to the default C<dbh> and C<dsn>. If you change the <dsn> variable, the
system will attempt to connect to the new dsn string and will produce a new
C<dbh> handle from it. If you set C<dsn> to an array reference, the first item
will be used as a DSN, the second one as a username and the third one as a
password. C<dsn_user> and C<dsn_password> can be used for the same purpose.
C<args> contains a reference to the C<@ARGV> array, that is, the command line
options that evoked myserver.pl
C<remote_dsn>, C<remote_dsn_user> and C<remote_dsn_password> are convenience
variables that can also be specified on the command line. It is not used by
C<myserver.pl> however you can use it in your rules, the way
C<remotequery.conf> does.
=head1 SECURITY
t/fake-mysql view on Meta::CPAN
temporary table on the default server and substitute the C<REMOTE_SELECT> part
in the orignal query with a reference to the temoporary table. The following
scenarios are possible:
# Standalone usage
mysql> SELECT REMOTE * FROM mysql.user ON 'dbi:mysql:host=remote:user=foo:password=bar'
# CREATE ... SELECT usage
mysql> CREATE TABLE local_table SELECT REMOTE * FROM remote_table ON 'dbi:mysql:host=remote'
# Non-correlated subquery
mysql> SELECT *
mysql> FROM (SELECT REMOTE * FROM mysql_user ON 'dbi:mysql:host=remote:user=foo:password=bar')
mysql> WHERE user = 'mojo'
# Specify remote dsn on the command line
shell> ./myserver.pl --config=remotequery.conf --dsn=dbi:mysql: --remote_dsn=dbi:mysql:host=host2
mysql> select remote 1;
t/fake-mysql view on Meta::CPAN
$SIG{CHLD} = 'IGNORE';
my $start_dsn;
my $start_dsn_user;
my $start_dsn_password;
my $remote_dsn;
my $remote_dsn_user;
my $remote_dsn_password;
my $port = '23306';
my $interface = '127.0.0.1';
my $debug;
my @config_names;
t/fake-mysql view on Meta::CPAN
my @args = @ARGV;
my $result = GetOptions(
"dsn=s" => \$start_dsn,
"dsn_user=s" => \$start_dsn_user,
"dsn_password=s" => \$start_dsn_password,
"remote_dsn=s" => \$remote_dsn,
"remote_dsn_user=s" => \$remote_dsn_user,
"remote_dsn_password=s" => \$remote_dsn_password,
"port=i" => \$port,
"config=s" => \@config_names,
"if|interface|ip=s" => \$interface,
"debug" => \$debug
) or die;
t/fake-mysql view on Meta::CPAN
@ARGV = @args;
my $start_dbh;
if (defined $start_dsn) {
print localtime()." [$$] Connecting to DSN $start_dsn.\n" if $debug;
$start_dbh = DBI->connect($start_dsn, $start_dsn_user, $start_dsn_password);
}
$storage{dbh} = $start_dbh;
$storage{dsn} = $start_dsn;
$storage{dsn_user} = $start_dsn_user;
$storage{dsn_password} = $start_dsn_password;
$storage{remote_dsn} = $remote_dsn;
$storage{remote_dsn_user} = $remote_dsn_user;
$storage{remote_dsn_password} = $remote_dsn_password;
foreach my $config_name (@config_names) {
my $config_sub;
open (CONFIG_FILE, $config_name) or die "unable to open $config_name: $!";
read (CONFIG_FILE, my $config_text, -s $config_name);
t/fake-mysql view on Meta::CPAN
if (ref($rule->{dsn}) eq 'ARRAY') {
print localtime()." [$$] Connecting to DSN $rule->{dsn}->[0].\n" if $debug;
$myserver->setDbh(DBI->connect(@{$rule->{dsn}}));
} else {
print localtime()." [$$] Connecting to DSN $rule->{dsn}.\n" if $debug;
$myserver->setDbh(DBI->connect($rule->{dsn}, get('dsn_user'), get('dsn_password')));
}
}
if (not defined get('dbh')) {
error("No --dbh specified. Can not forward query.",1235, 42000);
} elsif ($command == DBIx::MyServer::COM_QUERY) {
t/fake-mysql view on Meta::CPAN
if (ref($value) eq 'ARRAY') {
print localtime()." [$$] Connecting to DSN $value->[0].\n" if $debug;
$dbh = DBI->connect(@{$value});
} else {
print localtime()." [$$] Connecting to DSN $value.\n" if $debug;
$dbh = DBI->connect($value, get('dsn_user'), get('dsn_password'));
}
$storage{myserver}->setDbh($dbh);
$storage{dbh} = $dbh;
} else {
$storage{myserver}->setDbh(undef);
view all matches for this distribution
view release on metacpan or search on metacpan
example/fget.pl view on Meta::CPAN
{
say STDERR "only FTP URLs are supported";
exit 2;
}
unless(defined $remote->password)
{
$remote->password(prompt('p', 'Password: ', '', ''));
say '';
}
do {
my $from = $remote->clone;
$from->password(undef);
say "SRC: ", $from;
};
my @path = split /\//, $remote->path;
example/fget.pl view on Meta::CPAN
say sprintf "SERVER: [ %d ] %s", $res->code, $_ for @{ $res->message };
}
});
$ftp->connect($remote->host, $remote->port)->recv;
$ftp->login($remote->user, $remote->password)->recv;
$ftp->type('I')->recv;
$ftp->cwd(join '/', '', @path)->recv;
my $remote_size;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/TLS.pm view on Meta::CPAN
The idea behind being able to specify a string is to avoid blocking in
I/O. Unfortunately, Net::SSLeay fails to implement any interface to the
needed OpenSSL functionality, this is currently implemented by writing to
a temporary file.
=item cert_password => $string | $callback->($tls)
The certificate password - if the certificate is password-protected, then
you can specify its password here.
Instead of providing a password directly (which is not so recommended),
you can also provide a password-query callback. The callback will be
called whenever a password is required to decode a local certificate, and
is supposed to return the password.
=item dh_file => $path
Path to a file containing Diffie-Hellman parameters in PEM format, for
use in servers. See also C<dh> on how to specify them directly, or use a
lib/AnyEvent/TLS.pm view on Meta::CPAN
if length $ENV{PERL_ANYEVENT_TLS_DEBUG};
$self->{debug} = $arg{debug}
if exists $arg{debug};
my $pw = $arg{cert_password};
Net::SSLeay::CTX_set_default_passwd_cb ($ctx, ref $pw ? $pw : sub { $pw });
if ($self->{verify_mode}) {
if (exists $arg{ca_file} or exists $arg{ca_path} or exists $arg{ca_cert}) {
# either specified: use them
view all matches for this distribution