use strict; use warnings; use Data::Dumper; use DBI; use DBD::SQLite; my $mozilla_path = "$ENV{AppData}\\Mozilla\\Firefox\\Profiles"; opendir my $dh, $mozilla_path or die "Couldn't read Mozilla profiles directory $mozilla_path: $!"; my ($profile) = grep { /\.default/ } readdir $dh; my $file = "$mozilla_path/$profile/cookies.sqlite"; $file =~ s!\\!/!g; die "DB file '$file' not found!" unless -e $file; print "sqlite DBD version: $DBD::SQLite::sqlite_version\n"; my $dsn = "dbi:SQLite:uri=file:///$file?immutable=1"; my $user; my $password; my %dbi_options = ( RaiseError => 1, PrintError => 1, sqlite_open_flags => 'SQLITE_OPEN_READONLY', ); my $dbh = DBI->connect($dsn, $user, $password, \%dbi_options); my $sth = $dbh->prepare(q(SELECT * FROM moz_cookies )); $sth->execute; print Dumper $sth->fetchall_arrayref({});