Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Perl (http://www.programmingforums.org/forum21.html)
-   -   My first program (http://www.programmingforums.org/showthread.php?t=7358)

ProjectX Dec 2nd, 2005 12:56 PM

My first program
 
ok i did this bt my self no one helped me well just alittle bit

:

#!C:/PERL/BIN/perl.exe -w
# :: Hello.pl ::
# :: This program outputs the text "Hello, World!" ::

print "::  Installing....
::  Initializing....
::  Loading....
::  Done!\n\n";
print "~ How old are you?\n";
print "~ ";
my $age = <STDIN>;
if ($age < 18){
print "                              Access Denied!            \n";
exit
} else{
$cls = "cls";
system($cls);
print "                          Welcome to the cotrol panel            \n\n";
}

print "~ For the help menu type 0\n";
print "~ ";
my $menu = <STDIN>;
if ($menu == 0){
print "                                Help Menu                    \n";
print "1 > Telnet\n\n";
}
print "~ ";
my $menu1 = <STDIN>;
if($menu1 == 1){
system($cls);
print "**********************************************************
*                      WARNING!                          *
*    You have reached a Government Computer            *
* Your computer IP has been recorded and will be send to *
*  FBI for security reasons. Violation of the law line 93*
**********************************************************\n\n";
print "Password: ";
my $pass = <STDIN>;
if($pass == 1337){
system($cls);
print "Type 12 for the help menu\n";
print "% ";
my $hash = <STDIN>;
if($hash == "12"){
print "Connection to host lost.\n";
exit
}
} else{
print "%Login failed\n";
}
print "Password: ";
my $pass2 = <STDIN>;
if($pass2 == 1337){
system($cls);
print "Type 12 for the help menu\n";
print "% ";
my $hash2 = <STDIN>;
if($hash2 == "12"){
print "Connection to host lost.\n";
exit
}
} else{
print "%Login failed\n";
}
print "Password: ";
my $pass3 = <STDIN>;
if($pass3 == 1337){
system($cls);
print "Type 12 for the help menu\n";
print "% ";
my $hash3 = <STDIN>;
if($hash3 == "12"){
print "Connection to host lost.\n";
exit
}
} else{
print "%Login failed
Connection to host lost.\n";
exit
}
}

tell me what you think of it. Its my first one

eclipsed4utoo Dec 2nd, 2005 12:59 PM

is this suppose to be a hacker program?

ProjectX Dec 2nd, 2005 1:11 PM

no just a kind of a joke thing

Infinite Recursion Dec 2nd, 2005 1:21 PM

I would work in the indentation a little bit... it could be hard to follow for someone who doesn't know Perl... indentation, regardless of language is a good thing.

@eclipsed4utoo --- No, its not a "hacker program"... the "connection" goes no where... it's just printing things to the screen based on user input.


@ProjectX --- Its a good start with Perl. It appears that you have user interaction down, you may want to look at other concepts in the language now... ie: loops, file io, sockets, etc...

eclipsed4utoo Dec 2nd, 2005 1:29 PM

Quote:

Originally Posted by Infinite Recursion
I would work in the indentation a little bit... it could be hard to follow for someone who doesn't know Perl... indentation, regardless of language is a good thing.

@eclipsed4utoo --- No, its not a "hacker program"... the "connection" goes no where... it's just printing things to the screen based on user input.


@ProjectX --- Its a good start with Perl. It appears that you have user interaction down, you may want to look at other concepts in the language now... ie: loops, file io, sockets, etc...

well i knew it wouldn't connect to anything...but that step could be easily added. i was wondering if this was the beginning of a "hacker" program.

and yes, indenting would help out greatly.

ProjectX Dec 2nd, 2005 2:20 PM

thanks alot guys I will work on it. And if I put my mind to it it can be transformed in a hacker program


All times are GMT -5. The time now is 4:26 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC