use FLV::ToMP3;
$flv_filename = "/home/video/music.flv";
$mp3_filename = "test.mp3";
my $converter = FLV::ToMP3->new();
$converter->parse_flv($flv_filename);
$converter->save($mp3_filename);
Visit the following links for details:
use FLV::ToMP3;
$flv_filename = "/home/video/music.flv";
$mp3_filename = "test.mp3";
my $converter = FLV::ToMP3->new();
$converter->parse_flv($flv_filename);
$converter->save($mp3_filename);
cpan -install ModuleNamecpan -install LWPcpan -install Mail::Sendmail
$sum = add(3, 5);
print $sum."\n";
sub add
{
$a = shift;
$b = shift;
return ($a + $b);
}
$sum = add(3, 5);
print $sum."\n";
sub add
{
$a = shift;
$b = shift;
}
$sum = add(3, 5);
print $sum."\n";
sub add
{
$a = shift;
$b = shift;
$c = 10;
}
$items = count($ara);my $items = scalar(@ara);, you can also try: my $items = @ara;items = ara.__len__(). Note that in Python it's called list. List can be used as array.
my $upload_file_handle = $q->upload("file_name");close $upload_file_handle;my $txt = $page->hybrid; to my $txt = $page->text;
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
my $zip = Archive::Zip->new();
my $zip_file_name = 'scraper.zip';
$zip->read( $zip_file_name );
print "Number of files in the zip file: ".$zip->numberOfMembers()."\n";
print "List of files:\n";
my @members = $zip->memberNames();
#now print the name of the files
foreach (@members)
{
print $_, "\n";
}
...
my $query = new CGI;
print $query->header(-type=>'text/plain');
...
print $query->header(-type=>'text/plain', -status=>"500 $err_str");print $query->header(-type=>'text/plain'); and modified the code in such a way that the header is printed once. In order to return error, I wrote a function and just called it in case of any error occurs (but I made sure the header is not printed before I call it). Here is the function:
sub catch_n_die
{
my $err_str = shift;
print $query->header(-type=>'text/plain', -status=>"500 $err_str");
exit;
}
my $program_name = 'abc.pl';
my $data = `ps ax | grep perl`;
my @ara = $data =~ /perl\s+$program_name/g;
my $count = @ara;
print "$count\n";
print $0;
import os
os.system('ls -lt')
system(mkdir $folder);qw(mkdir $folder);$temp = `mkdir $folder`; #back ticks exec($command);
qw(rm $filename);
if($?) {
print STDERR "error deleting file\n";
}