Result:
found more than 440 distributions - search limited to the first 2001 files matching your query ( run in 1.274 )


Acme-Alien-DontPanic

 view release on metacpan or  search on metacpan

alienfile  view on Meta::CPAN

  test [ '%{make} check' ];

  ffi {
  
    build [
      # TODO: under windows, dll is installed in bin.  setting --bindir doesn't seem to work for the .dll
      # only the .exe.
      '%{configure} --enable-shared --disable-static --libdir=%{.install.autoconf_prefix}/dynamic',
      '%{make}',
      '%{make} install',
    ];

 view all matches for this distribution


Acme-Alien-DontPanic2

 view release on metacpan or  search on metacpan

alienfile  view on Meta::CPAN

  test [ '%{make} check' ];

  ffi {
  
    build [
      # TODO: under windows, dll is installed in bin.  setting --bindir doesn't seem to work for the .dll
      # only the .exe.
      '%{configure} --enable-shared --disable-static --libdir=%{.install.autoconf_prefix}/dynamic',
      '%{make}',
      '%{make} install',
    ];

 view all matches for this distribution


Acme-CPANModules-NewDistributions-202001

 view release on metacpan or  search on metacpan

lib/Acme/CPANModules/NewDistributions/202001.pm  view on Meta::CPAN

                     summary     => "select the right font for rendering",
                   },
                   {
                     description => "Distribution Geo-Coder-DAMS first released by BOKUTIN at 2020-01-04T19:00:11Z.",
                     module      => "Geo::Coder::DAMS",
                     summary     => "Perl bindings for Japanese Geocoder DAMS",
                   },
                   {
                     description => "Distribution HarfBuzz-Shaper first released by JV at 2020-01-25T20:50:26Z.",
                     module      => "HarfBuzz::Shaper",
                     summary     => "Use HarfBuzz for text shaping",

lib/Acme/CPANModules/NewDistributions/202001.pm  view on Meta::CPAN

=item * L<Font::Selector> - select the right font for rendering

Distribution Font-Selector first released by VANHOESEL at 2020-01-21T08:20:21Z.


=item * L<Geo::Coder::DAMS> - Perl bindings for Japanese Geocoder DAMS

Distribution Geo-Coder-DAMS first released by BOKUTIN at 2020-01-04T19:00:11Z.


=item * L<HarfBuzz::Shaper> - Use HarfBuzz for text shaping

 view all matches for this distribution


Acme-CPANModulesBundle-Import-MojoliciousAdvent-2018

 view release on metacpan or  search on metacpan

devdata/https_mojolicious.io_blog_2018_12_08_authenticating-with-ldap_  view on Meta::CPAN

}
</code></pre>

<p>with the database connection and handle <code>$dbh</code> left as an exercise to the reader.
And yes, you should prepare the SQL outside of the sub.
The <code>?</code> in the SQL statement are bind parameters, placeholders that make the database call faster and safer.</p>

<h4>Did you spot the HUGE mistake I made?</h4>

<p>Never, never, NEVER store passwords in plain text!  (Blame it on Friday afternoon)
You should encrypt the password before storing it with an algorithm like AES or SHA-2.

devdata/https_mojolicious.io_blog_2018_12_08_authenticating-with-ldap_  view on Meta::CPAN

<li><strong>Bind</strong> as the user with their password</li>
<li>Check the result code from the server</li>
</ol>

<p>First, you need to make a network connection to the LDAP server.
Next, you <a href="https://metacpan.org/pod/Net::LDAP#METHODS">bind</a> to the server.
&quot;Bind&quot; is the term used in LDAP for connecting to a particular location
in the LDAP tree.
The LDAP server has a setting on whether it allows binding anonymously
and determines whether you can search directory without a password
as I&#39;ve done in the example.
Then you search LDAP for the user (because the identifiers are <em>loooong</em>)
and then you bind as the user with the password they&#39;ve provided.
If this connection as the user with their password succeeds,
then you must have used the correct password.
LDAP hands you back a result from the <code>bind</code> as a
<a href="https://metacpan.org/pod/distribution/perl-ldap/lib/Net/LDAP/Message.pod">Net::LDAP::Message</a>
object on either success or failure,
so check the Message <code>code</code> to find out whether you should authenticate the user.</p>

<p>Here&#39;s the code</p>

devdata/https_mojolicious.io_blog_2018_12_08_authenticating-with-ldap_  view on Meta::CPAN

  my ($username, $password) = @_;
  return unless $username;

  my $ldap = Net::LDAP-&gt;new( $LDAP_server )
        or warn(&quot;Couldn&#39;t connect to LDAP server $LDAP_server: $@&quot;), return;
  my $message = $ldap-&gt;bind( $base_DN );

  my $search = $ldap-&gt;search( base =&gt; $base_DN,
                              filter =&gt; join(&#39;=&#39;, $user_attr, $username),
                              attrs =&gt; [$user_id],
                            );
  my $user_id = $search-&gt;pop_entry();
  return unless $user_id;                     # does this user exist in LDAP?

  # this is where we check the password
  my $login = $ldap-&gt;bind( $user_id, password =&gt; $password );

  # return 1 on success, 0 on failure with the ternary operator
  return $login-&gt;code == LDAP_INVALID_CREDENTIALS ? 0
                                                  : 1;
}

 view all matches for this distribution


Acme-CPANModulesBundle-Import-PerlDancerAdvent-2018

 view release on metacpan or  search on metacpan

devdata/http_advent.perldancer.org_2018_21  view on Meta::CPAN

    &lt;input type="text" name="subject" id="subject" placeholder="Nature of inquiry?"&gt;
        
    &lt;label for="message"&gt;Message&lt;/label&gt;
    &lt;textarea name="message" id="message" placeholder="Message text"&gt;&lt;/textarea&gt;

    &lt;label class="visuallyhidden"&gt;Don't fill this in!&lt;input type="text" name="spam_one" tabindex="-1"&gt;&lt;/label&gt;
    &lt;input type="hidden" name="spam_two"&gt;

    &lt;input type="submit"&gt;Send Request&lt;/input&gt;
&lt;/form&gt;</pre>

<p>For the most part, it's a standard HTML form with a couple of notable exceptions:</p>
<pre class="prettyprint">&lt;label class="visuallyhidden"&gt;Don't fill this in!&lt;input type="text" name="spam_one" tabindex="-1"&gt;&lt;/label&gt;</pre>

<p>This uses a special CSS class, <code>visuallyhidden</code>, to make this form field invisible to the user. By giving it 
a <code>tabindex="-1"</code>, we make sure the user cannot accidentally tab to the field. There are still a few ways that 
field could accidentally get focus however, so we help the user here by giving it a label that says "Don't fill 
this in!"</p>
<p>What does <code>visuallyhidden</code> look like?</p>
<pre class="prettyprint">.visuallyhidden {
    border: 0;

 view all matches for this distribution


Acme-Cavaspazi

 view release on metacpan or  search on metacpan

t/05_bin.t  view on Meta::CPAN

use_ok 'Acme::Cavaspazi';
use FindBin qw($RealBin);
use File::Spec;

my $data = File::Spec->catfile( $RealBin, "..", "data" );
my $bind  = File::Spec->catfile( $RealBin, "..", "bin" );

ok(-d $data, "Data dir found in $RealBin: $data");
ok(-d $bind, "Bin dir found in $RealBin: $bind");

my $bin  = File::Spec->catfile($bind, 'cavaspazi');

my $cmd = qq($^X $bin  -r -n "$data"/*);
ok(defined $cmd, "Running: $cmd");
my @out = `$cmd`;

 view all matches for this distribution


Acme-DependOnEverything

 view release on metacpan or  search on metacpan

lib/Acme/DependOnEverything.pm  view on Meta::CPAN

use DBIx::Async;
use DBIx::Aurora;
use DBIx::AutoReconnect;
use DBIx::BabelKit::tgz;
use DBIx::BatchChunker;
use DBIx::bind_param_inline;
use DBIx::BlackBox;
use DBIx::BLOB::Handle;
use DBIx::Brev;
use DBIx::Broker;
use DBIx::Browse;

lib/Acme/DependOnEverything.pm  view on Meta::CPAN

use Tk::AbstractCanvas::tgz;
use Tk::ACH;
use Tk::Action;
use Tk::ActivityBar;
use Tk::ApplicationNest;
use Tk::autobind;
use Tk::Autoscroll;
use Tk::BarberPole;
use Tk::Bounded;
use Tk::Calculator::RPN::HP;
use Tk::CanvasDirTree;

lib/Acme/DependOnEverything.pm  view on Meta::CPAN

use XML::AutoWriter;
use XML::Axk;
use XML::Bare;
use XML::Bare::SAX::Parser;
use XML::Beautify;
use xml::binddata;
use XML::Bits::v;
use XML::BMEcat;
use XML::Builder;
use XML::Canonical;
use XML::CanonicalizeXML;

 view all matches for this distribution


Acme-Devel-Hide-Tiny

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally

 view all matches for this distribution


Acme-Locals

 view release on metacpan or  search on metacpan

lib/Acme/Locals.pm  view on Meta::CPAN

        $call_class = shift->[0];
        $peek_level++;
    }
    $call_class ||= caller 0;

    my ($fmt, %bind_vars) = @_;

    my @binds;
    my $map_bind_var = sub {
        my ($bind_var_name, $format_char) = @_;
        local *__ANON__ = 'map_bind_var'; ## no critic

        my $internal_name = $bind_var_name;
        if (exists $bind_vars{$internal_name}) {
            # pass
        }
        elsif (exists $bind_vars{q{$}.$internal_name}) {
            $internal_name = q{$}.$internal_name;
        }
        else {
            croak "No such bind var: $bind_var_name";
        }

        my $value_ref = $bind_vars{$internal_name};
        croak 'Bind var must be scalar'
            if not _SCALAR($value_ref);

        push @binds, ${ $value_ref };

        return defined $format_char ? q{%} . $format_char
                                    : $DEFAULT_FORMAT;
    };

    my $mode = $mode_for_class{$call_class} || $DEFAULT_MODE;
    my $re   = $MODES{ $mode };

    if ($mode eq '-ruby' && !scalar keys %bind_vars) {
        %bind_vars = %{ PadWalker::peek_my($peek_level) };
    }
    
    $fmt =~ s/$re/$map_bind_var->($1, $2)/xmseg;

    return sprintf $fmt, @binds;
}

sub lexicals {
    goto &locals;
}

 view all matches for this distribution


Acme-MITHALDU-BleedingOpenGL

 view release on metacpan or  search on metacpan

test.pl  view on Meta::CPAN


    ($VertexObjID,$NormalObjID,$ColorObjID,$TexCoordObjID,$IndexObjID) =
      glGenBuffersARB_p(5);

    #glBindBufferARB(GL_ARRAY_BUFFER_ARB, $VertexObjID);
    $verts->bind($VertexObjID);
    glBufferDataARB_p(GL_ARRAY_BUFFER_ARB, $verts, GL_STATIC_DRAW_ARB);
    glVertexPointer_c(3, GL_FLOAT, 0, 0);

    if (DO_TESTS)
    {

test.pl  view on Meta::CPAN

      my $ords = join('/',@test);
      print "  glGetBufferSubDataARB_p: $ords\n";
    }

    #glBindBufferARB(GL_ARRAY_BUFFER_ARB, $NormalObjID);
    $norms->bind($NormalObjID);
    glBufferDataARB_p(GL_ARRAY_BUFFER_ARB, $norms, GL_STATIC_DRAW_ARB);
    glNormalPointer_c(GL_FLOAT, 0, 0);

    #glBindBufferARB(GL_ARRAY_BUFFER_ARB, $ColorObjID);
    $colors->bind($ColorObjID);
    glBufferDataARB_p(GL_ARRAY_BUFFER_ARB, $colors, GL_DYNAMIC_DRAW_ARB);
    $rainbow->assign(0,@rainbow);
    glBufferSubDataARB_p(GL_ARRAY_BUFFER_ARB, $rainbow_offset, $rainbow);
    glColorPointer_c(4, GL_FLOAT, 0, 0);

    #glBindBufferARB(GL_ARRAY_BUFFER_ARB, $TexCoordObjID);
    $texcoords->bind($TexCoordObjID);
    glBufferDataARB_p(GL_ARRAY_BUFFER_ARB, $texcoords, GL_STATIC_DRAW_ARB);
    glTexCoordPointer_c(2, GL_FLOAT, 0, 0);

    #glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, $IndexObjID);
    $indices->bind($IndexObjID);
    glBufferDataARB_p(GL_ELEMENT_ARRAY_BUFFER_ARB, $indices, GL_STATIC_DRAW_ARB);
  }
  else
  {
    print "Using classic Vertex Buffers\n";

 view all matches for this distribution


Acme-MITHALDU-XSGrabBag

 view release on metacpan or  search on metacpan

inc/Inline.pm  view on Meta::CPAN

}

#==============================================================================
# Run time version of import (public method)
#==============================================================================
sub bind {
    local ($/, $") = ("\n", ' '); local ($\, $,);

    my ($code, @config);
    my $o;
    my ($pkg, $script) = caller;
    my $class = shift;
    croak M03_usage_bind() unless $class eq 'Inline';

    $CONFIG{$pkg}{template} ||= $default_config;

    my $language_id = shift or croak M03_usage_bind();
    croak M03_usage_bind()
      unless ($language_id =~ /^\S+$/ and $language_id !~ /\n/);
    $code = shift or croak M03_usage_bind();
    @config = @_;

    my $next = 0;
    for (@config) {
        next if $next++ % 2;
        croak M03_usage_bind() if /[\s\n]/;
    }
    $o = bless {}, $class;
    $o->{INLINE}{version} = $VERSION;
    $o->{API}{pkg} = $pkg;
    $o->{API}{script} = $script;

inc/Inline.pm  view on Meta::CPAN


END
    return $usage;
}

sub M03_usage_bind {
    my $usage = <<END;
Invalid usage of the Inline->bind() function. Valid usages are:
    Inline->bind(language => "source-string", config-pair-list);
    Inline->bind(language => "source-file", config-pair-list);
    Inline->bind(language => [source-line-list], config-pair-list);
END

    $usage .= <<END if defined $Inline::languages;

Supported languages:

 view all matches for this distribution


Acme-MUDLike

 view release on metacpan or  search on metacpan

lib/Acme/MUDLike.pm  view on Meta::CPAN

		// For whatever reason, IE has trouble passing the window object
		// around, causing it to be cloned in the process
		if ( jQuery.browser.msie && element.setInterval != undefined )
			element = window;

		// if data is passed, bind to handler
		if( data ) 
			handler.data = data;

		// Make sure that the function being executed has a unique ID
		if ( !handler.guid )

lib/Acme/MUDLike.pm  view on Meta::CPAN

		}

		// Add the function to the element's handler list
		handlers[handler.guid] = handler;

		// And bind the global event handler to the element
		element["on" + type] = this.handle;

		// Remember the function in a global list (for triggering)
		if (!this.global[type])
			this.global[type] = [];

lib/Acme/MUDLike.pm  view on Meta::CPAN

		return event;
	}
};

jQuery.fn.extend({
	bind: function( type, data, fn ) {
		return this.each(function(){
			jQuery.event.add( this, type, fn || data, data );
		});
	},
	one: function( type, data, fn ) {
		return this.each(function(){
			jQuery.event.add( this, type, function(event) {
				jQuery(this).unbind(event);
				return (fn || data).apply( this, arguments);
			}, data);
		});
	},
	unbind: function( type, fn ) {
		return this.each(function(){
			jQuery.event.remove( this, type, fn );
		});
	},
	trigger: function( type, data ) {

lib/Acme/MUDLike.pm  view on Meta::CPAN


	jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
		"mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + 
		"submit,keydown,keypress,keyup,error").split(","), function(i,o){
		
		// Handle event binding
		jQuery.fn[o] = function(f){
			return f ? this.bind(o, f) : this.trigger(o);
		};
			
	});
	
	// If Mozilla is used

lib/Acme/MUDLike.pm  view on Meta::CPAN

	loadIfModified: function( url, params, callback ) {
		this.load( url, params, callback, 1 );
	},
	load: function( url, params, callback, ifModified ) {
		if ( jQuery.isFunction( url ) )
			return this.bind("load", url);

		callback = callback || function(){};

		// Default to a GET request
		var type = "GET";

lib/Acme/MUDLike.pm  view on Meta::CPAN


// Attach a bunch of functions for handling common AJAX events

jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
	jQuery.fn[o] = function(f){
		return this.bind(o, f);
	};
});

jQuery.extend({
	get: function( url, data, callback, type, ifModified ) {

 view all matches for this distribution


Acme-MetaSyntactic-Themes

 view release on metacpan or  search on metacpan

lib/Acme/MetaSyntactic/nobel_prize.pm  view on Meta::CPAN

 1912   Medicine    Alexis Carrel
 1912   Peace       Elihu Root
 1912   Physics     Gustaf Dalén

 1913   Chemistry   Alfred Werner
 1913   Literature  Rabindranath Tagore
 1913   Medicine    Charles Richet
 1913   Peace       Henri La Fontaine
 1913   Physics     Heike Kamerlingh Onnes

 1914   Chemistry   Theodore W. Richards

lib/Acme/MetaSyntactic/nobel_prize.pm  view on Meta::CPAN

 1967   Medicine    Ragnar Granit
 1967   Physics     Hans Bethe

 1968   Chemistry   Lars Onsager
 1968   Literature  Yasunari Kawabata
 1968   Medicine    H. Gobind Khorana
 1968   Medicine    Marshall W. Nirenberg
 1968   Medicine    Robert W. Holley
 1968   Peace       René Cassin
 1968   Physics     Luis Alvarez

 view all matches for this distribution


Acme-MetaSyntactic-dune

 view release on metacpan or  search on metacpan

lib/Acme/MetaSyntactic/dune.pm  view on Meta::CPAN


__DATA__
# default
:all
# names bene_gesserit
abomination accadia acolyte alma_mavis_taraza aloana_streggi anirul archives_mother aver_yohsa awareness_spectrum azhar_book baram bellonda bene_gesserit_training breeding_program burzmali calissa carlana cassius_ida_treac chapterhouse cienna clairby...
# names creatures
blackbird bristleback burrhorse butterfish butterfish centipede desert_hare desert_hawk desert_mouse desert_owl eagle elecran futar gaze_hound hawk heart_scallop kangaroo_mouse kulon laccifera_arctica laza_tiger leech_bat milkbug panther_fish qaraa r...
# names events
arbelough arrakis_revolt ascension_of_house assault_on_poritrin assault_on_rossak battle_at_ularda battle_of_arrakeen battle_of_bela_tegeuse battle_of_caladan battle_of_corrin battle_of_earth battle_of_ellram battle_of_englichannel battle_of_giedi_pr...
# names fremen_culture

lib/Acme/MetaSyntactic/dune.pm  view on Meta::CPAN

# names individuals ixians
bronso_of_ix cammar_pilru ctair_pilru davee_rogo dmurr_pilru dominic_vernius gaylord_vernius handon hwi_noree jehanne_butler kailea_vernius miral_alchem norma_cevna rhombur_vernius shando_vernius shayama_sen stina_pilru suboid tessia_vernius tio_holt...
# names individuals league_of_nobles_members
bovko_manresa brevin_okukovich chiry emil_tantor faykan_butler fredo_butler hosten_fru jaymes_powder jimbay_whit jool_noret keats lauderdale lucille_tantor manion_butler nivny_omura pinquer_jibb quentin_butler rajid_suk rell_arkov rico rikov_butler s...
# names individuals males
abdel abulurd_rabban achilleus agamemnon agamemnon aimilianos ajax aken_hesban akrab al_baz albe alberto_ginaztera albertus alexander alexandros alexios aliid alkman ammon anton_miche aquim aristeteles_aigisthodes armand_ecaz arn_eklo aaudrii avelard...
# names individuals mentats
ammon bellonda cyril gilbertus_albans grodon_orpar_playt_iii miles_teg noree_moneo paul piter_de_vries radnor rhajia thufir_hawat twisted_mentat
# names individuals new_sisterhood
archives_mother caree_debrak doria gianne_idaho iriel janess_idaho kiria laera mother_commander rinya_idaho tanisia_idaho valkyries wikki_aztin
# names individuals religious_figures

 view all matches for this distribution


Acme-MetaSyntactic-legolotr

 view release on metacpan or  search on metacpan

lib/Acme/MetaSyntactic/legolotr.pm  view on Meta::CPAN

=head1 DESCRIPTION

Characters from the LEGO Lord of the Rings game as gleaned from
the L<http://www.gamefaqs.com/> walkthroughs.

I<And in the darkness bind them>

=encoding utf8

=head1 SEE ALSO

 view all matches for this distribution


Acme-MetaSyntactic-vim

 view release on metacpan or  search on metacpan

lib/Acme/MetaSyntactic/vim.pm  view on Meta::CPAN

stselect
sunhide
sunmap
suspend
sview
syncbind
t
tab
tabclose
tabdo
tabedit

lib/Acme/MetaSyntactic/vim.pm  view on Meta::CPAN

rightleftcmd
ruler
rulerformat
runtimepath
scroll
scrollbind
scrolljump
scrolloff
scrollopt
sections
secure

 view all matches for this distribution


Acme-MotorcycleGang

 view release on metacpan or  search on metacpan

_build/build_params  view on Meta::CPAN

    'verbose' => undef,
    'dist_suffix' => undef,
    'PL_files' => {},
    'pollute' => undef,
    'metafile2' => 'META.json',
    'bindoc_dirs' => [
      'blib/script'
    ],
    'conflicts' => {},
    'scripts' => undef,
    'recommends' => {},

 view all matches for this distribution


Acme-Parataxis

 view release on metacpan or  search on metacpan

lib/Acme/Parataxis.pm  view on Meta::CPAN

    our @IPC_BUFFER;
    my $lib;
    my @SCHEDULER_QUEUE;
    my $IS_RUNNING = 0;

    sub _bind_functions ($l) {
        affix $l, 'init_system',                       [],                             Int;
        affix $l, 'create_fiber',                      [ Pointer [SV], Pointer [SV] ], Int;
        affix $l, 'coro_call',                         [ Int, Pointer [SV] ],          Pointer [SV];
        affix $l, 'coro_transfer',                     [ Int, Pointer [SV] ],          Pointer [SV];
        affix $l, 'coro_yield',                        [ Pointer [SV] ],               Pointer [SV];

lib/Acme/Parataxis.pm  view on Meta::CPAN

                $lib = Affix::load_library($path);
                last if $lib;
            }
        }
        die 'Could not find or load ' . $lib_name unless $lib;
        _bind_functions($lib);
    }

    # API aliases and wrappers
    sub fiber : prototype(&) ($code) { spawn( 'Acme::Parataxis', $code ) }

 view all matches for this distribution


Acme-Pointer

 view release on metacpan or  search on metacpan

lib/Acme/ppport.h  view on Meta::CPAN

ax|||n
backup_one_SB|||
backup_one_WB|||
bad_type_gv|||
bad_type_pv|||
bind_match|||
block_end||5.004000|
block_gimme||5.004000|
block_start||5.004000|
blockhook_register||5.013003|
boolSV|5.004000||p

 view all matches for this distribution


Acme-Sort-Sleep

 view release on metacpan or  search on metacpan

local/lib/perl5/IO/Async/Handle.pm  view on Meta::CPAN


   my $sock = IO::Async::OS->socket( $family, $socktype, $protocol );
   $self->set_handle( $sock );
}

=head2 bind

   $handle = $handle->bind( %args )->get

Performs a C<getaddrinfo> resolver operation with the C<passive> flag set,
and then attempts to bind a socket handle of any of the return values.

=head2 bind (1 argument)

   $handle = $handle->bind( $ai )->get

When invoked with a single argument, this method is a convenient shortcut to
creating a socket handle and C<bind()>ing it to the address as given by an
addrinfo structure, and setting it as the read and write handle for the
object.

C<$ai> may be either a C<HASH> or C<ARRAY> reference of the same form as given
to L<IO::Async::OS>'s C<extract_addrinfo> method.

The returned future returns the handle object itself for convenience.

=cut

sub bind
{
   my $self = shift;

   if( @_ == 1 ) {
      my ( $ai ) = @_;

      $self->socket( $ai );
      my $addr = ( IO::Async::OS->extract_addrinfo( $ai ) )[3];

      $self->read_handle->bind( $addr ) or
         return Future->fail( "Cannot bind - $!", bind => $self->read_handle, $addr, $! );

      return Future->done( $self );
   }

   $self->loop->resolver->getaddrinfo( passive => 1, @_ )->then( sub {
      my @addrs = @_;

      try_repeat {
         my $ai = shift;

         $self->bind( $ai );
      } foreach => \@addrs,
        until => sub { shift->is_done };
   });
}

 view all matches for this distribution


Acme-Sub-Parms

 view release on metacpan or  search on metacpan

examples/bench-parm-parsers-ci-novalid.pl  view on Meta::CPAN

use Params::Validate qw (validate);
use Benchmark qw(cmpthese);
$Params::Validate::NO_VALIDATION = 1;
print "Bench case insensitive parameter parsing without validation\n";
cmpthese(500000, {
            'bindparms'     => sub { sub_parms_bind_parms( handle => 'Test', 'thing' => 'something')},
#            'std_args'            => sub { standard_args( handle => 'Test', 'thing' => 'something')},
            'caseflat_std_args'   => sub { caseflat_standard_args( handle => 'Test', 'thing' => 'something')},
#            'one_step_args'    => sub { one_step_args( handle => 'Test', 'thing' => 'something')},
            'positional_args'  => sub { positional_args( 'Test', 'something')},
            'null_sub'         => sub { null_sub( handle => 'Test', 'thing' => 'something')},

examples/bench-parm-parsers-ci-novalid.pl  view on Meta::CPAN


sub params_validate {
    my ($handle, $thing) = @{(validate(@_, { handle => 1, thing => 1 }))}{'handle','thing'};
}

sub sub_parms_bind_parms {
    BindParms : (
        my $handle : handle;
        my $thing  : thing;
    )
}

 view all matches for this distribution


Acme-TestDist-Cpp-EUMM-EUCppGuess

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

ax|||n
backup_one_SB|||
backup_one_WB|||
bad_type_gv|||
bad_type_pv|||
bind_match|||
block_end||5.004000|
block_gimme||5.004000|
block_start||5.004000|
blockhook_register||5.013003|
boolSV|5.004000||p

 view all matches for this distribution


Acme-W

 view release on metacpan or  search on metacpan

lib/Acme/W.pm  view on Meta::CPAN

    s/([^\$\w\d])eval([^\w\d])/$1WWWww$2/g;
    s/([^\$\w\d])else([^\w\d])/$1WWwWW$2/g;
    s/([^\$\w\d])each([^\w\d])/$1WWwWw$2/g;
    s/([^\$\w\d])dump([^\w\d])/$1WWwwW$2/g;
    s/([^\$\w\d])chop([^\w\d])/$1WWwww$2/g;
    s/([^\$\w\d])bind([^\w\d])/$1WwWWW$2/g;
    s/([^\$\w\d])INIT([^\w\d])/$1WwWWw$2/g;
    s/([^\$\w\d])CORE([^\w\d])/$1WwWwW$2/g;
    s/([^\$\w\d])xor([^\w\d])/$1WwWww$2/g;
    s/([^\$\w\d])vec([^\w\d])/$1WwwWW$2/g;
    s/([^\$\w\d])use([^\w\d])/$1WwwWw$2/g;

lib/Acme/W.pm  view on Meta::CPAN

    s/([^\$\w\d])WWWww([^\w\d])/$1eval$2/g;
    s/([^\$\w\d])WWwWW([^\w\d])/$1else$2/g;
    s/([^\$\w\d])WWwWw([^\w\d])/$1each$2/g;
    s/([^\$\w\d])WWwwW([^\w\d])/$1dump$2/g;
    s/([^\$\w\d])WWwww([^\w\d])/$1chop$2/g;
    s/([^\$\w\d])WwWWW([^\w\d])/$1bind$2/g;
    s/([^\$\w\d])WwWWw([^\w\d])/$1INIT$2/g;
    s/([^\$\w\d])WwWwW([^\w\d])/$1CORE$2/g;
    s/([^\$\w\d])WwWww([^\w\d])/$1xor$2/g;
    s/([^\$\w\d])WwwWW([^\w\d])/$1vec$2/g;
    s/([^\$\w\d])WwwWw([^\w\d])/$1use$2/g;

 view all matches for this distribution


Acme-YAPC-Okinawa-Bus

 view release on metacpan or  search on metacpan

lib/Acme/YAPC/Okinawa/ppport.h  view on Meta::CPAN

ax|||n
backup_one_SB|||
backup_one_WB|||
bad_type_gv|||
bad_type_pv|||
bind_match|||
block_end||5.004000|
block_gimme||5.004000|
block_start||5.004000|
blockhook_register||5.013003|
boolSV|5.004000||p

 view all matches for this distribution


Acme-require-case

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally

 view all matches for this distribution


Acrux-DBI

 view release on metacpan or  search on metacpan

lib/Acrux/DBI.pm  view on Meta::CPAN


    my $res = $dbi->query('select * from test');
    my $res = $dbi->query('insert into test values (?, ?)', @values);

Execute a blocking statement and return a L<Acrux::DBI::Res> object with the results.
You can also append a 'bind_callback' to perform binding value manually:

    my $res = $dbi->query('insert into test values (?, ?)', {
        bind_callback => sub {
            my $sth = shift;
            $sth->bind_param( ... );
          }
      });

=head2 rollback

lib/Acrux/DBI.pm  view on Meta::CPAN

sub query { # SQL, { args }
    my $self = shift;
    my $sql = shift // '';
    my $args = @_
      ? @_ > 1
        ? {bind_values => [@_]}
        : ref($_[0]) eq 'HASH'
          ? {%{$_[0]}}
          : {bind_values => [@_]}
      : {};
    $self->{error} = '';
    return unless my $dbh = $self->dbh;
    unless (length($sql)) {
        $self->error("No statement specified");

lib/Acrux/DBI.pm  view on Meta::CPAN


    # HandleError
    local $sth->{HandleError} = sub { $_[0] = Carp::shortmess($_[0]); 0 };

    # Binding params and execute
    my $bind_values = $args->{bind_values} || [];
    unless (is_array_ref($bind_values)) {
        $self->error("Invalid list of binding values. Array ref expected");
        return;
    }
    my $rv;
    my $argb = '';
    if (scalar @$bind_values) {
        $argb = sprintf(" with bind values: %s",
            join(", ", map {defined($_) ? sprintf("'%s\'", $_) : 'undef'} @$bind_values));

        $rv  = $sth->execute(@$bind_values);
    } elsif (my $cb = $args->{bind_callback} || $args->{bind_cb}) {
        unless (is_code_ref($cb)) {
            $self->error("Invalid binding callback function. Code ref expected");
            return;
        }
        $cb->($sth); # Callback! bind params
        $rv = $sth->execute;
    } else {
        $rv = $sth->execute; # Without bindings
    }
    unless (defined $rv) {
        $self->error(sprintf("Can't execute statement \"%s\"%s: %s", $sql, $argb,
            $sth->errstr || $dbh->errstr || $DBI::errstr || 'unknown error'));
        return;

 view all matches for this distribution


Acrux

 view release on metacpan or  search on metacpan

lib/Acrux/Const.pm  view on Meta::CPAN

#
# See http://www.gnu.org/software/autoconf/manual/html_node/Installation-Directory-Variables.html
# See https://www.pathname.com/fhs/pub/fhs-2.3.html
#
my $prefix          = $Config::Config{'prefix'} // '';
my $bindir          = $Config::Config{'bin'} // File::Spec->catdir($prefix, 'bin');
my $localstatedir   = $prefix eq '/usr' ? '/var' : File::Spec->catdir($prefix, 'var');
my $sysconfdir      = $prefix eq '/usr' ? '/etc' : File::Spec->catdir($prefix, 'etc');
my $srvdir          = $prefix eq '/usr' ? '/srv' : File::Spec->catdir($prefix, 'srv');

# Root dirs

lib/Acrux/Const.pm  view on Meta::CPAN

*LOCALSTATEDIR = sub { $localstatedir };    # localstatedir       /var
*SYSCONFDIR = sub { $sysconfdir };          # sysconfdir          /etc
*SRVDIR = sub { $srvdir };                  # srvdir              /srv

# Prefix related dirs
*BINDIR = sub { $bindir };                                                              # bindir    /usr/bin
*SBINDIR = sub { state $sbindir = File::Spec->catdir($prefix, 'sbin') };                # sbindir   /usr/sbin
*DATADIR = sub { state $datadir = File::Spec->catdir($prefix, 'share') };               # datadir   /usr/share
*DOCDIR = sub { state $docdir = File::Spec->catdir($prefix, 'share', 'doc') };          # docdir    /usr/share/doc
*LOCALEDIR = sub { state $localedir = File::Spec->catdir($prefix, 'share', 'locale') }; # localedir /usr/share/locale
*MANDIR = sub { state $mandir = File::Spec->catdir($prefix, 'share', 'man') };          # mandir    /usr/share/man
*LOCALBINDIR = sub { state $localbindir = File::Spec->catdir($prefix, 'local', 'bin') };# localbindir  /usr/local/bin

# Local State related Dirs
*CACHEDIR = sub { state $cachedir = File::Spec->catdir($localstatedir, 'cache') };      # cachedir  /var/cache
*LOGDIR = sub { state $logdir = File::Spec->catdir($localstatedir, 'log') };            # logdir    /var/log
*SPOOLDIR = sub { state $spooldir = File::Spec->catdir($localstatedir, 'spool') };      # spooldir  /var/spool

 view all matches for this distribution


Activator

 view release on metacpan or  search on metacpan

lib/Activator/DB.pm  view on Meta::CPAN

    Activator::Exception::DB->throw('alias', 'invalid', $self->{cur_alias} )
}

# explode args for a db query sub
sub _explode {
    my ( $pkg, $bindref, $args ) = @_;

    my $bind = $bindref || [];
    my $self = $pkg;
    my $connect_to = $args->{connect};

     # handle static calls
    if ( !( Scalar::Util::blessed($self) && $self->isa( 'Activator::DB') ) ) {

lib/Activator/DB.pm  view on Meta::CPAN

					  'failure',
					  "_explode couldn't get connection for alias '$self->{cur_alias}'");

    my $attr        = $args->{attr} || {};

    return ( $self, $bind, $attr );
}

# This can never die, so we jump through hoops to return some valid scalar.
#     * replace undef values with NULL, since this is how dbi will do it
#     * If $bind is of wrong type, don't do substitutions.
#     * shift @vals to handle the case of '?' in the bind values
#     * @vals? in the regexp is to handle fewer args on the right than the left
# TODO: support attrs in debug
sub _get_sql {
    my ( $pkg, $sql, $bind ) = @_;
    $sql  ||= '';
    $bind ||= [];

    if ( ref( $bind ) eq 'ARRAY' ) {
	my @vals = @$bind;
 	map {
 	    if ( !defined($_) ) {
 		$_ = 'NULL';
 	    }
 	    else {

lib/Activator/DB.pm  view on Meta::CPAN

 	$sql =~ s/\?/@vals? (shift @vals) : '?'/egos;

	return $sql;
    }
    else {
	if ( $bind ) {
	    return "[SQL] ${sql} [BIND VARS] $bind";
	}
	return $sql;
    }
}

# returns sth, unless you want the result of the execute,
sub _get_sth {
    my ( $self, $sql, $bind, $attr, $want_exec_result ) = @_;

    my $conn = $self->_get_cur_conn();
    my $sth;

    try eval {

lib/Activator/DB.pm  view on Meta::CPAN

	};
	if ( catch my $e ) {
	    Activator::Exception::DB->throw( 'sth',
					     'prepare',
					     $e . " SQL: " .
					     $self->_get_sql( $sql, $bind )
					   );
	}
    }

    my $res;
    try eval {
	$res = $sth->execute( @$bind );
    };
    if ( catch my $e ) {
	Activator::Exception::DB->throw( 'sth',
					 'execute',
					 $e . " SQL: " .
					 $self->_get_sql( $sql, $bind )
				       );
    }

    if ( $want_exec_result ) {
	$sth->finish();

lib/Activator/DB.pm  view on Meta::CPAN

# Note that we jump through some hoops ( return array of everything )
# to consolidate these 3 functions, and still log from the appropriate
# function.
#
sub getrow {
    my ($self, $sql, $bind, $args, @ret) = &_fetch( 'getrow', @_);
    return @ret;
}

sub getrow_arrayref {
    my ($self, $sql, $bind, $args, $ret) = &_fetch( 'getrow_arrayref', @_);
    return $ret;
}

sub getrow_hashref {
    my ($self, $sql, $bind, $args, $ret) = &_fetch( 'getrow_hashref', @_);
    return $ret;
}

sub getall {
    my ($self, $sql, $bind, $args, $ret) = &_fetch( 'getall', @_);
    return $ret;
}

sub getall_arrayrefs {
    my ($self, $sql, $bind, $args, $ret) = &_fetch( 'getall_arrayrefs', @_);
    return $ret;
}

sub getall_hashrefs {
    my ($self, $sql, $bind, $args, $ret) = &_fetch( 'getall_hashrefs', @_);
    return $ret;
}

sub _fetch {
    my ( $fn, $pkg, $sql, $bindref, %args ) = @_;
    my ( $self, $bind, $attr ) = $pkg->_explode( $bindref, \%args );

    $self->_start_timer();

    my $conn = $self->_get_cur_conn();

    my ( $sth, $e );
    try eval {
	$sth = $self->_get_sth( $sql, $bind, $attr );
    };
    if ( catch my $e ) {
	$e->rethrow;
    }

lib/Activator/DB.pm  view on Meta::CPAN


    if ( catch my $e ) {
	Activator::Exception::DB->throw( 'sth',
					 'fetch',
					 $e .
					 $self->_get_sql( $sql, $bind )
				       );
    }


    # clean up return value for total consistency.

lib/Activator/DB.pm  view on Meta::CPAN

	}
	else {
	    $row = [];
	}
    }
    $self->_debug_sql( 5, $sql, $bind, \%args);

    if ( $fn eq 'getrow' ) {
	return ( $self, $sql, $bind, \%args, @row );
    }

    return ( $self, $sql, $bind, \%args, $row );
}

sub do_id {
    my ( $pkg, $sql, $bindref, %args ) = @_;
    my ( $self, $bind, $attr ) = $pkg->_explode( $bindref, \%args );
    my $conn = $self->_get_cur_conn();

    $self->_start_timer();

    my $res;
    try eval {
	$res = $self->_get_sth( $sql, $bind, $attr, 'want_exec_result' );
    };
    if ( catch my $e ) {
	$e->rethrow;
    }

    $self->_debug_sql( 4, $sql, $bind, \%args );

    if ( $res == 1 ) {
	if ( $conn->{engine} eq 'mysql' ) {
	    return $conn->{dbh}->{mysql_insertid};
	}

lib/Activator/DB.pm  view on Meta::CPAN

	    return @$row[0];
	}
    } else {
	Activator::Exception::DB->throw('execute',
					'failure',
					$self->_get_sql( $sql, $bind ) .
					" did not cause an insert"
				       );
    }
}

sub do {
    my ( $pkg, $sql, $bindref, %args ) = @_;
    my ( $self, $bind, $attr, $alt_error ) = $pkg->_explode( $bindref, \%args );
    my $conn = $self->_get_cur_conn();

    $self->_start_timer();

    my $res;
    try eval {
	$res = $conn->{dbh}->do( $sql, $attr, @$bind );
    };
    if ( catch my $e ) {
	$e->rethrow;
    }

    $self->_debug_sql( 4, $sql, $bind, \%args );

    if ( $res eq '0E0' ) {
	return 0;
    }
    return $res;

lib/Activator/DB.pm  view on Meta::CPAN

        $e->rethrow;
    }
}

sub as_string {
    my ( $pkg, $sql, $bind ) = @_;
    return Activator::DB->_get_sql( $sql, $bind );
}

sub _start_timer {
    my ( $self ) = @_;
    $self->{debug_timer} = [gettimeofday];
}

sub _debug_sql {
    my ( $self, $depth, $sql, $bind, $args ) = @_;

    if ( $sql =~ /foo/ ) {
	warn Dumper( $args );
    }
    my $conn = $self->_get_cur_conn();
    if ( $args->{debug} ||
	 $self->{config}->{debug} ||
	 $conn->{config}->{debug} ) {
	local $Log::Log4perl::caller_depth;
	$Log::Log4perl::caller_depth += $depth;
	my $str = $self->_get_sql( $sql, $bind );
	DEBUG( tv_interval( $self->{debug_timer}, [ gettimeofday ] ). " $str".
	       ( $self->{config}->{debug_attr} ? "\n\t" .
	       Data::Dumper->Dump( [ $conn->{attr} ], [ 'attr' ] ) : '' )
	     );
    }

lib/Activator/DB.pm  view on Meta::CPAN


=item *

Get a single row:

    my @row     = $db->getrow( $sql, $bind, @args );
    my $rowref  = $db->getrow_arrayref( $sql, $bind, @args );

=item *

Get hashref of col->value pairs:

    my $hashref = $db->getrow_hashref( $sql, $bind, @args );

=item *

Get all rows arrayref (these are identical):

    my $rowsref = $db->getall( $sql, $bind, @args );
    my $rowsref = $db->getall_arrayrefs( $sql, $bind, @args );

=item *

Get all rows ref: with each row a hashref of cols->value pairs:

    my $rowsref = $db->getall_hashrefs( $sql, $bind, @args );

=item *

C<do> any query ( usually INSERT, DELETE, UPDATE ):

    my $id = $db->do( $sql, $bind, @args );

=item *

C<do> query, but return id instead of success.:

    my $id = $db->do_id( $sql, $bind, @args );
   ( NOTE: this is very mysql dependant at the moment)

=item *

Get data from a different db for a while:

lib/Activator/DB.pm  view on Meta::CPAN

=over

=item ## pseudo-OO example:

  my $db = Activator::DB->connect( 'db_alias' );
  $db->query_method( $sql, $bind, @args );
  $db->connect( 'alt_db_alias' );
  $db->query_method( $sql, $bind, @args );
  $db->connect( 'db_alias' );
  $db->query_method( $sql, $bind, @args );

=item ## Static formatted calls require that you dictate the connection for
every request. So, the above can also be done as:

  Activator::DB->query_method( $sql, $bind, connect => 'db_alias', @args );
  Activator::DB->query_method( $sql, $bind, connect => 'alt_db_alias', @args );
  Activator::DB->query_method( $sql, $bind, connect => 'db_alias', @args );

=item ## However, the common use case for this module is:

  my $db = Activator::DB->connect( 'db_alias' );
  $db->query_method( $sql, $bind, @args );
    ### do some perl
  $db->query_method( $sql, $bind, @args );
    ### do some perl
  $db->query_method( $sql, $bind, @args );
    ### do some perl
  ... etc.

=back

lib/Activator/DB.pm  view on Meta::CPAN


Note that C<connect()> always returns the singleton object, which in some
usage patterns could cause some confusion:

  my $db1->connect('db1');           # connect to db1
  $db1->query( $sql, $bind, @args ); # acts on db1
  my $db2->connect('db2');           # connect to db2
  $db2->query( $sql, $bind, @args ); # acts on db2
  $db1->query( $sql, $bind, @args ); # still acts on db2!

For this reason, it is highly recommended that you always use the same
variable name (probably C<$db>) for the Activator::DB object.

=head2 Query Methods Usage

Every query function takes named arguments in the format of:

  Activator::DB->$query_method( $sql, $bind, opt_arg => <opt_value> );

Mandatory Arguments:

 sql   : sql statement string
 bind  : bind values arrayref

Optional Arguments:
 conn  => alias of the db connection (default is 'default')
          NOTE: this changes the connection alias for all future queries
 attr  => hashref of attributes to use for ONLY THIS QUERY

lib/Activator/DB.pm  view on Meta::CPAN


    my @row = $db->getrow( $sql );

=item ## Needy query:

    my $res = $db->do( $sql, $bind,
          connect => 'altdb', # changes the alias for future connections!
          attr => { AutoCommit => 0, },
          debug => 1,
     );

lib/Activator/DB.pm  view on Meta::CPAN

=head2 Query Failures & Errors

All query methods die on failure, and must be wrapped in a try/catch block.

  eval {
    Activator::DB->query_method( $sql, $bind, @args );
  };
  if ($@) {
    # catch the error
  }

We highly recommend (and use extensively)
L<Exception::Class::TryCatch> which allows this syntactic sugar:

  try eval {
    Activator::DB->query_method( $sql, $bind, @args );
  };
  if ( catch my $e ) {
     # rethrow, throw a new error, print something, AKA: handle it!
  }

lib/Activator/DB.pm  view on Meta::CPAN

empty array/arrayref/hashref (like DBI::fetchall_arrayref does,
instead of undef) when there are no results.

Usage:

  my @row     = $db->getrow( $sql, $bind, @args )
  my $rowref  = $db->getrow_arrayref( $sql, $bind, @args )
  my $hashref = $db->getrow_hashref( $sql, $bind, @args )

=head2 getall

=head2 getall_arrayrefs

lib/Activator/DB.pm  view on Meta::CPAN

                { col1 => val, col2 => val },
              ];

=back

  my $rowref = $db->getall( $sql, $bind, @args )
  my $rowref = $db->getall_arrayrefs( $sql, $bind, @args )
  my $rowref = $db->getall_hashrefs( $sql, $bind, @args )

=head2 do

Execute a SQL statement and return the number of rows affected. Dies
on failure.

Usage:

  my $res = $db->do( $sql, $bind, @args )

=head2 do_id

Execute a SQL statement that generates an id and return the id. Dies
on failure.

Usage:

  my $id = $db->do_id( $sql, $bind, @args )

=cut

1;

lib/Activator/DB.pm  view on Meta::CPAN

__END__

################################################################################
## begin legacy

## =item B<getcol_arrayref>($sql, $bind, $colsref)
##
## Prepare and Execute a SQL statement on the default database, and
## get an arrayref of values back via DBI::selectcol_arrayref()
##
## Args:
##   $sql => sql statement
##   $bind => optional bind values arrayref for the sql statement
##   $colsref => optional arrayref containing the columns to return
##
## Returns:
##   an arrayref of values for each specified col of data from the query (default is the first column).  So each row of data from the query gives one or more sequential values in the output arrayref.
##   reference to an empty array when there is no matching data

lib/Activator/DB.pm  view on Meta::CPAN

##   dbi.failure - on failure of DBI::selectcol_arrayref
##
## =cut
##
## sub getcol_arrayref {
##     my ( $sql, $bind, $colsref ) = @_;
##
##     $self->{debug_start} = [ gettimeofday ];
##
##     my $colref;
##
##     my $dbh = &get_dbh();    # may throw connect.failure
##
##     eval {
## 	$colref
## 	    = $dbh->selectcol_arrayref( $sql, { Columns => $colsref },
## 	    @$bind );
##     };
##     if ( $@ ) {
## 	Activator::Exception::DB->throw( 'dbi', 'failure', $dbh->errstr || $@);
##     }
##
##     $self->_get_query_debug( 'getcol_arrayref', @_ );
##
##     return $colref;
## }
##
## =item B<getall_hr>($sql, $bind, $key_field)
##
## Prepare and Execute a SQL statement on the default database, and
## call DBI::fetchall_hashref(),
## returning a reference to a hash containing one hashref for each row.
##
## Args:
##   $sql => sql statement
##   $bind => optional bind values arrayref for the sql statement
##   $key_field => column name, column number or arrayref of colunm names/numbers
##                 column number starts at 1
## Returns:
##   a hashref of where each hash entry represents a row of data from the query.
##   The keys for the hash are the values in $key_field.

lib/Activator/DB.pm  view on Meta::CPAN

##   sth.failure - failure on fetch
##
## =cut
##
## sub getall_hr {
##     my ( $sql, $bind, $key_field ) = @_;
##
##     $self->{debug_start} = [ gettimeofday ];
##
##     my $sth = &_get_sth( $sql, $bind );
##
##     my $rv = $sth->fetchall_hashref( $key_field );
##
##     $sth->finish();
##

 view all matches for this distribution


ActiveRecord-Simple

 view release on metacpan or  search on metacpan

lib/ActiveRecord/Simple.pm  view on Meta::CPAN

    my $primary_key = ($self->can('_get_primary_key')) ? $self->_get_primary_key :
                      ($self->can('_get_secondary_key')) ? $self->_get_secondary_key : undef;

    my $field_names_str = join q/, /, map { q/"/ . $_ . q/"/ } @field_names;

    my (@bind, @values_list);
    for (@field_names) {
        if (ref $param->{$_} eq 'SCALAR') {
            push @values_list, ${ $param->{$_} };
        }
        else {
            push @values_list, '?';
            push @bind, $param->{$_};
        }
    }
    my $values = join q/, /, @values_list;
    my $pkey_val;
    my $sql_stm = qq{

lib/ActiveRecord/Simple.pm  view on Meta::CPAN


    if ( $self->dbh->{Driver}{Name} eq 'Pg' ) {
        if ($primary_key) {
            $sql_stm .= ' RETURINIG ' . $primary_key if $primary_key;
            $sql_stm = ActiveRecord::Simple::Utils::quote_sql_stmt($sql_stm, $self->dbh->{Driver}{Name});
            $pkey_val = $self->dbh->selectrow_array($sql_stm, undef, @bind);
        }
        else {
            my $sth = $self->dbh->prepare(
                ActiveRecord::Simple::Utils::quote_sql_stmt($sql_stm, $self->dbh->{Driver}{Name})
            );

            $sth->execute(@bind);
        }
    }
    else {

        my $sth = $self->dbh->prepare(
            ActiveRecord::Simple::Utils::quote_sql_stmt($sql_stm, $self->dbh->{Driver}{Name})
        );
        $sth->execute(@bind);

        if ( $primary_key && defined $self->{$primary_key} ) {
            $pkey_val = $self->{$primary_key};
        }
        else {

lib/ActiveRecord/Simple.pm  view on Meta::CPAN

    my $table_name = _what_is_the_table_name($self);
    my @field_names     = sort keys %$param;
    my $primary_key     = ($self->can('_get_primary_key')) ? $self->_get_primary_key :
                          ($self->can('_get_secondary_key')) ? $self->_get_secondary_key : undef;

    my (@set_list, @bind);
    for (@field_names) {
        if (ref $param->{$_} eq 'SCALAR') {
            push @set_list, $_ . ' = ' . ${ $param->{$_} };
        }
        else {
            push @set_list, "$_ = ?";
            push @bind, $param->{$_};
        }
    }
    my $setstring = join q/, /, @set_list;
    push @bind, $self->{$primary_key};

    my $sql_stm = ActiveRecord::Simple::Utils::quote_sql_stmt(
        qq{
            UPDATE "$table_name" SET $setstring
            WHERE
                $primary_key = ?
        },
        $self->dbh->{Driver}{Name}
    );

    return $self->dbh->do($sql_stm, undef, @bind);
}

sub _mk_rw_accessors {
    my ($class, $fields) = @_;

 view all matches for this distribution


AddressBook

 view release on metacpan or  search on metacpan

lib/AddressBook/DB/LDAP.pm  view on Meta::CPAN

  }
  $self->{hostname} = $hostname || $self->{hostname};
  $self->{base} = $base || $self->{base};
  $self->{ldap} = Net::LDAP->new($self->{hostname}, async => 1 || croak $@);
  unless ($self->{anonymous}) {
    $mesg = $self->{ldap}->bind($self->{username}, password => $self->{password});
  } else {
    $mesg = $self->{ldap}->bind;
  }
  if ($mesg->is_error) {
    croak "could not bind to LDAP server: " . $mesg->error;
  }
  return $self;
}

sub search {

 view all matches for this distribution


( run in 1.274 second using v1.01-cache-2.11-cpan-3782747c604 )