Contents |
my $conn = DBI->connect("dbi:mysql:database=<DATABASE NAME>;host=<HOST URL>;user=<USER NAME>;password=<USER PASSWORD>") ||
die ("Couldn't connect to database. ".$DBI::errstr);
my $sql = qq{
<SQL HERE>
};
my $stmt = $conn->prepare($sql);
$stmt->execute();
my $dataRef = $stmt->fetchall_hashref(<FIELD TO KEY ON>);
if (($dataRef->{'<KEY>'}->{'<DESIRED FIELD>'}) =~ /enum(\(.*\))/)
{
. . .
}
$conn->disconnect();
my $sql = qq{
<query here>
};
grep { <code here> } <a list here>
shift @{[split /\//, $filePath]}
This is useful because it allows you to call functions inside of regular expressions
print "The time is ${ my $x = localtime; \$x }
This is taken from the Perl FAQ #4
© 2009 Novell, Inc. All Rights Reserved.