Could anyone please tell me what's wrong with the following "program"? The compiler gives errors in the switch statement.
Thx!! Anthony
%commands=('v',0,'w',1,'t',2,'/pattern/',3,'s',4,'x',5);
$end = 0;
while (!end){
print "bookmarks.html>";
$operation = <>;
chop $operation;
$op=$commands{$operation};
switch ($op) {
case 0 {
&add ();
last;}
case 1 {
&delete();
last;}
case 2 {
&show();
last;}
case 3 {
&pattern();
last;}
case 4 {
&save();
last;}
case 5 {
&exit ();
last;}
}
}
sub add{ print "add"; }
sub delete{
print "delete";
}sub show{
print "show";
}sub pattern{
print "pattern";
}sub save{
print "save";
}sub exit{
$end = 1;
}_________________________________________________________________
Ben jij klaar voor De Vuilbek? http://devuilbek.msn.be/start.php Nu op JIM en MSN
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
