Pike's syntax is very much like C + +, but it is also a scripting language, so it has the characteristics of a generic scripting language. A simple pike program, Hello World:
1 int Main () 2 {3 Write ("Hello world!\n"); 4 return 0 ; 5 }
The use of string, and examples of command-line arguments:
#! /usr/local/bin/pike//next time you just hit the file name.intMainintARGC, Array (string) {Write (argv) {"Welcome to the Very simple WWW browser!\n"); stringURL; if(ARGC = =2) URL= argv[1];//command-line arguments Else{Write ("Type The address of the Web page:\n"); URL= Stdio.stdin->gets ();//reading a line of strings from standard input} write ("URL:"+ URL +"\ n"); return 0;}
Take a look at the small code below and feel more familiar:
1 Do 2 {3 Write ("Type the address of the Web page:\n"); 4 url = stdio.stdin->gets (); 5 while (sizeof0); // and C + + no bad
Pike Study Notes