Hi,
I have the following code:
opendir(DIR, "$clanbase"
;
@clanlist = readdir(DIR);
closedir(DIR);
foreach $clanlist (@clanlist) {
chomp($clanlist);
open(F, "$root/cgi-bin/databases/clans/$clanlist/info.list"
;
@clannames = <F>;
print "$clannames[0] [<A HREF=\"clans.cgi\">Explore</A>]<BR>";
chomp($clannames[0]);
close(F);
}
What it does is take all the values from info.list and displays the first vaue from the info.list. After running the code, it should be looking like this:
Some Name[Explore]
More Name [Explore]
But instead, it looks like this:
[Explore]
[Explore]
Some Name[Explore]
More Name [Explore]
How do i get rid of the the first 2 lines that causing the error? I tried to use the chomp function everywhere but it's not working. Any ideas? Thanks for your time.
-Aaron
I have the following code:
opendir(DIR, "$clanbase"

@clanlist = readdir(DIR);
closedir(DIR);
foreach $clanlist (@clanlist) {
chomp($clanlist);
open(F, "$root/cgi-bin/databases/clans/$clanlist/info.list"

@clannames = <F>;
print "$clannames[0] [<A HREF=\"clans.cgi\">Explore</A>]<BR>";
chomp($clannames[0]);
close(F);
}
What it does is take all the values from info.list and displays the first vaue from the info.list. After running the code, it should be looking like this:
Some Name[Explore]
More Name [Explore]
But instead, it looks like this:
[Explore]
[Explore]
Some Name[Explore]
More Name [Explore]
How do i get rid of the the first 2 lines that causing the error? I tried to use the chomp function everywhere but it's not working. Any ideas? Thanks for your time.
-Aaron