Subdomain Posts
None | 7 hours ago
None | 1 day ago
None | 5 days ago
None | 6 days ago
Bash | 6 days ago
None | 9 days ago
None | 9 days ago
C++ | 12 days ago
unrealScript | 15 days ago
None | 15 days ago
Recent Posts
None | 9 sec ago
None | 21 sec ago
Java | 24 sec ago
None | 35 sec ago
None | 42 sec ago
None | 54 sec ago
HTML | 56 sec ago
None | 57 sec ago
None | 1 min ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By root on the 30th of Jun 2009 01:02:19 PM
Download |
Raw |
Embed |
Report
#!/usr/bin/perl
use strict;
use DBI;
sub db_connect {
my $dsn = "delfi;host=localhost;mysql_enable_utf8=1";;
my $dbh = DBI->connect("dbi:mysql:$dsn", "mysql", "", { PrintError => 0, RaiseError => 1 });
return $dbh;
}
my $dbh = db_connect();
my $sth = $dbh->prepare("SELECT name FROM newsCategories WHERE ID=?");
$sth->execute(2);
my ($rootname) = $sth->fetchrow or die 'Non existing root category';
print "rex: ", $1, "\n" if $rootname =~ /^(...)/;
print "substr: ", substr($rootname, 0, 3) . '...';
Submit a correction or amendment below.
Make A New Post