PDA

View Full Version : [SOLVED] Using perl and bash together



Jackp90
November 19th, 2008, 05:23 AM
I am really new to programming and i don't know a lot about many languages . . . So this is what I want to do:

I want to make a more user friendly interface for mencoder for conversion between ogv files and avi files . . . this is my program thus far and as you can see it uses both bash and perl . . . its only a rough outline of what I want:



#!/usr/bin/perl -w
# Convogg 1.0
# Author: Robert
# Helped by:
use strict;
print "Enter ogg name here: \n";
my $ogg;
chomp ($ogg = <STDIN>);
print "Enter avi name here: \n";
my $avi;
chomp ($avi = <STDIN>);

#!/bin/bash
mencoder -idx $ogg -ovc lavc -oac mp3lame -o $avi
# This is the only place that bash really makes an appearance

slavik
November 19th, 2008, 05:52 AM
you can do the following ;)



#!/usr/bin/perl -w
# Convogg 1.0
# Author: Robert
# Helped by:
use strict;
print "Enter ogg name here: \n";
my $ogg;
chomp ($ogg = <STDIN>);
print "Enter avi name here: \n";
my $avi;
chomp ($avi = <STDIN>);

`mencoder -idx $ogg -ovc lavc -oac mp3lame -o $avi`;

Jackp90
November 27th, 2008, 08:35 PM
you can do the following ;)



#!/usr/bin/perl -w
# Convogg 1.0
# Author: Robert
# Helped by:
use strict;
print "Enter ogg name here: \n";
my $ogg;
chomp ($ogg = <STDIN>);
print "Enter avi name here: \n";
my $avi;
chomp ($avi = <STDIN>);

`mencoder -idx $ogg -ovc lavc -oac mp3lame -o $avi`;



its still not working i get the following output



robert@Laptop01:~/begperl$ convogg
Useless use of a constant in void context at /bin/convogg line 12.
Enter ogg name here:

slavik
November 27th, 2008, 10:05 PM
try
my $ogg = <>;
chomp $ogg;

same for the other variable.

Jackp90
December 2nd, 2008, 05:05 AM
try
my $ogg = <>;
chomp $ogg;

same for the other variable.

I am still getting the same output . . . and still doesnt convert the video . . . . any other ideas

ghostdog74
December 2nd, 2008, 06:06 AM
just use the shell,


#!/bin/bash
read -p "Enter ogg name: " ogg
read -p "Enter avi name: " avi
mencoder -idx $ogg -ovc lavc -oac mp3lame -o $avi


make sure your mencoder is compiled with libmp3lame support.

Jackp90
December 3rd, 2008, 07:24 AM
just use the shell,


#!/bin/bash
read -p "Enter ogg name: " ogg
read -p "Enter avi name: " avi
mencoder -idx $ogg -ovc lavc -oac mp3lame -o $avi


make sure your mencoder is compiled with libmp3lame support.

Thanks for the suggestion I will have to see if it works