Hi
I tryed to include the elsif and else command but the complier always tell me that I have a syntax error near my elsif (in my first script list bellow) and near the else in the second one ...
#1
#!/usr/bin/perl -w
#
# trying to include the if else into my code !
my @list = ('A','B')
# I puted the folloing command because I want the complier to
# execute the print command...
if ($list[0] eq "A"); {
print "$list[0]\n";
}
elsif ($list[1] eq "B"); {
print "$list[1]\n";
}
and #2
#!/usr/bin/perl -w
#
#try if & else command
my @list = ('A','B','C')
if ( $list[0] eq "A" ) {
print "$list[0]\n\n";
}
else {
print "@list\n\n";
}
the complier aslo 'complaint' angainst my last curly brace ... please help me cause I'm completly out of ressource ...
I tryed to include the elsif and else command but the complier always tell me that I have a syntax error near my elsif (in my first script list bellow) and near the else in the second one ...
#1
#!/usr/bin/perl -w
#
# trying to include the if else into my code !
my @list = ('A','B')
# I puted the folloing command because I want the complier to
# execute the print command...
if ($list[0] eq "A"); {
print "$list[0]\n";
}
elsif ($list[1] eq "B"); {
print "$list[1]\n";
}
and #2
#!/usr/bin/perl -w
#
#try if & else command
my @list = ('A','B','C')
if ( $list[0] eq "A" ) {
print "$list[0]\n\n";
}
else {
print "@list\n\n";
}
the complier aslo 'complaint' angainst my last curly brace ... please help me cause I'm completly out of ressource ...