H
H
HANEFEKO2018-01-25 08:12:02
Perl
HANEFEKO, 2018-01-25 08:12:02

How can the following logic be implemented in Perl?

Hello, how can we do the following:
We have a variable that stores, well, let's say "Hello".
How can I check that "Hello" is really there, and then play the mp3 file hello.mp3 after that?
Accordingly, if the variable contains "Andrew", the Andrew.mp3 file should be played,
and so on.
In other words, the mp3 file that corresponds to what is in the variable should be played.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Olgeir, 2018-01-25
@HANEFEKO

my $a='Hello'
if (-e -f $a){system ($a."mp3")}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question