Begging your pardon, :) but I sure could use a little help. I have a
script here that was given to me by a friend of a friend :) And the
middle person knows just as much as I do about cgi/perl, which is
nothing. I know just enough to make this script work at my server (after
several, and I mean several attempts) But whether it is scripted
correctly, I don't know. What I mean, where a line ends and a new line
begins. I do know that a semi-colon ends the line. And can you tell me
the reason for these
||
Some I removed and a couple HAD to stay in. Does that sound correct?
Any help sure would be appreciated.
#!/usr/bin/perl -w
# name script 'pnm.pl'
use CGI;
my $q = new CGI;
my $Song = $q->param('song')
|| '';if ($Song eq '') {print "Content-type: text/||html\n\n";
print qq~
Byron wrote:
> I don't know. What I mean, where a line ends and a new line
> begins. I do know that a semi-colon ends the line. And can you tell me
> the reason for these
>
> ||
>
> Some I removed and a couple HAD to stay in. Does that sound correct?
>
> Any help sure would be appreciated.
my $Song = $some_variable || ''; # Set $Song to '' if not otherwise defined.
> #!/usr/bin/perl -w
> # name script 'pnm.pl'
> use CGI;
> my $q = new CGI;
> my $Song = $q->param('song')
> || '';if ($Song eq '') {print "Content-type: text/||html\n\n";
> print qq~
Get rid of all the other instances of || and start a new line after each ; .
The last statement {print("$Song\n");} doesn't really do anything.
-Joe
Re: pnm strip player help
am 21.02.2007 22:21:49 von ByronDallas
He Joe, I think this is the changes you wanted me to do. I tried making
the changes but I kept getting errors. I'm sure it was a coding error on
my part.
>#!/usr/bin/perl -w
>use CGI::Carp qw(fatalsToBrowser);
># name script 'pnm2.pl'
>use CGI;
>my $q =3D new CGI;
>my $Song =3D $some_variable || ''; =A0
># Set $Song to '' if not otherwise defined.
>if ($Song '')
I had to leave this print in from the bottom:
print("$Song\n");
or I would loose my form url after I clicked onto it.
And if I removed these || from the
|| method=3D"post"
I loose the encrypted song url that the server generates.
I think you'll understand better with what is going on with an example.
This is how I have it coded now. And it seems to be working ok. Please
correct me on any mistakes if there wrong.
http://www.byrondallas.p4h.biz/test/pnm2.txt
This is the tool:
http://www.byrondallas.p4h.biz/test/pnm2.pl
If you will paste the strip below into the tool and click onto it, you
will be able to get the encrypted clickable url. I click "Show Last" on
webtv. It also allows me to time the song from an archive list. Just
click off the form and then back up to change the time settings.
I don't know if the code is correct, I just know that's what I had to do
to get the tool to perform. Do you see any problems with this? and if so
please correct me. :) I wasn't sure about these || and was worried about
deleting some and leaving some.
Thanks Joe!
Re: pnm strip player help
am 22.02.2007 07:11:42 von Joe Smith
Byron wrote:
> I removed these || from the
> || method="post"
> I loose the encrypted song url that the server generates.
The || there is wrong. It should be either
Re: pnm strip player help
am 22.02.2007 14:05:02 von ByronDallas
Joe wrote:
>The || there is wrong. It should be either =A0
>
Re: pnm strip player help
am 22.02.2007 14:53:20 von ByronDallas
I'm sorry Joe, I meant the line is like this: (uppercase)
Re: pnm strip player help
am 22.02.2007 15:42:00 von ByronDallas
Hey Joe, the bottom line on pnm4 reads like this after removing
print("$Song\n");
This is the player without the print line.
http://www.byrondallas.p4h.biz/test/pnm4.pl
I'm not sure if your on a computer or WebTV. But on WebTV when I copy
this strip into the form and click it, it seems to play the strip and
even gives me the encrypted url, but I can't hear anything.
and the line:
"Content-type: audio/x-pn-realaudio-plugin\n\n";
}
is the the type of audio plugin WebTV uses. Which you probably guessed
it anyway. :)
Re: pnm strip player help
am 23.02.2007 16:19:20 von ByronDallas
Hey Joe, I really appreciate all the help you've given me. I don't know
if your into Pink Floyd or not, but you did make mention of them, so
here ya go.