Tag Archives: Perl

extract databases or tables from mysqldump

I wrote a simple fast and flexible perl script called xmysqldump.pl to extract databases/tables from mysqldump sql file, you may download it from here. Usage: ./xmysqldump.pl -h|–help This page ./xmysqldump.pl -l|–list [file.sql …] List databases and tables ./xmysqldump.pl -a|–all-tables [file.sql … Continue reading

Posted in Perl, Programming, System Administration | Tagged , , , | 5 Comments

Using libcurl: follow redirect and get header only

Let’s look at a sample code first(I use the WWW::Curl perl module here, the idea is the same for other language). #!/usr/bin/perl use warnings; use strict; use WWW::Curl::Easy; my $url = ‘http://search.cpan.org/CPAN/authors/id/L/LO/LORN/LWP-Curl-0.09.tar.gz'; my $resp_body; #Get file length via HTTP HEAD … Continue reading

Posted in Perl, Programming | Tagged , , | Leave a comment