Frank#
25-08-2006, 13:52
Hallo,
ich habe hier ein script welches ich so aufrufe: ./m3usript.pl inputdatei outputdatei
unter Windows wurde es erstellt und funktioniert dort tadellos, mit der gleichen perlversion. rufe ich es auf, kommt:
[frank@client ~]$ perl m3uscript.pl test.m3u test.erg
m3uscript.pl: line 7: syntax error near unexpected token `;'
m3uscript.pl: line 7: ` @a = <FIN>;'
#!/bin/sh
#
if (open FIN, "@ARGV[0]")
{
if (open FOUT, ">@ARGV[1]")
{
@a = <FIN>;
$b = 1; $c = @a;
while ($c > 10)
{ $b++; $c/=10; }
for ($i=0; $i<@a; $i++)
{printf FOUT "%0" . $b . "d " . @a[$i], $i;}
close FOUT;
}
close FIN;
}
ich habe hier ein script welches ich so aufrufe: ./m3usript.pl inputdatei outputdatei
unter Windows wurde es erstellt und funktioniert dort tadellos, mit der gleichen perlversion. rufe ich es auf, kommt:
[frank@client ~]$ perl m3uscript.pl test.m3u test.erg
m3uscript.pl: line 7: syntax error near unexpected token `;'
m3uscript.pl: line 7: ` @a = <FIN>;'
#!/bin/sh
#
if (open FIN, "@ARGV[0]")
{
if (open FOUT, ">@ARGV[1]")
{
@a = <FIN>;
$b = 1; $c = @a;
while ($c > 10)
{ $b++; $c/=10; }
for ($i=0; $i<@a; $i++)
{printf FOUT "%0" . $b . "d " . @a[$i], $i;}
close FOUT;
}
close FIN;
}