Help for this page

Select Code to Download


  1. or download this
    package SomeDatabaseStuff;
    sub my_funny_sql{
        my ($dbh) = @_;
        $dbh->do('my great query');
    }
    
  2. or download this
    my_funny_sql($dbh);
    
  3. or download this
    $dbh->SomeDatabaseStuff::my_funny_sql();
    
  4. or download this
    $dbh->SomeDatabaseStuff::my_funny_sql ( 'some parameter', 12 , 34 );
    
  5. or download this
    package MoreDatabaseStuff;
    @MoreDatabaseStuff::ISA = qw( SomeDatabaseStuff);
    ...
    $dbh->MoreDatabaseStuff::my_funny_sql();
    # ends up being dispatched properly
    # to the sub in the parent SomeDatabaseStuff
    
  6. or download this
    my $dbh = DBI->connect('....');
    $dbh->SomeDatabaseStuff::my_funny_sql;