Sinisterly
[PERL] Small Interactive database [CODE INCLUDED] - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Coding (https://sinister.li/Forum-Coding--71)
+--- Thread: [PERL] Small Interactive database [CODE INCLUDED] (/Thread-PERL-Small-Interactive-database-CODE-INCLUDED)



[PERL] Small Interactive database [CODE INCLUDED] - FrostByte_mybb_import5923 - 05-19-2011

It is an interactive personal information database, the only small issue being that i cant seem to save the array's when exiting but that is just a small issue im not too fussed about as im not selling it. So anyway if you just beginning, here is just an incentive that even with the basic's you can make quite good programs.

Code:
print"\n\n\n\n"; print"================================================================================​\n"; print"---------------------------------- + {DB_s11} + --------------------------------\n"; print"================================================================================​\n"; print"For help type -h\n\n"; @names = (); @age = (); @location = (); @recovery_info = (); @country = (); $count=1; my $num = -1; while ($count<11) { my $num = -1; print">> "; chomp ($input = <STDIN>); if ($input eq "db_info") { print"--------------------------------------------------------------------------------\n\n"; print"\t* Database Use - Sub11 employee / Public Information Source\n"; print"\t* Database Version - 0.1.1 Sub_Eleven\n"; print"\t* Database MFO - Microsoft Windows 2009 - 2011\n"; print"\t* Database MBI - Perl\n"; print"\t* Creator - P-teo, frost\n"; print"\t* Copywrite - © copywrited 2011\n"; print"\t* Updates Availible - None\n\n"; print"--------------------------------------------------------------------------------\n\n"; } if ($input eq "add") { print"Name: "; chomp ($add = <STDIN>); push(@names, "$add"); print"Age: "; chomp ($add_age = <STDIN>); push(@age, "$add_age"); print"Country: "; chomp ($counrty = <STDIN>); push(@country, "$country"); print"Address (Town): "; chomp ($address = <STDIN>); push(@location, "$location"); print"\n<Must contain 5 numbers and nothing else.>\nPasscode: "; chomp ($info = <STDIN>); push(@recovery_info, "$info"); print"User Added..."; print"\n\nName: $add\nAge: $add_age\nAddress: $address\nPasscode: $info\n\n"; } elsif ($input eq "-h") { print"\n\n::>> add <Add a new user>\n"; print"::>> users <List's all user>\n"; print"::>> -h <Open's the help list>\n"; print"::>> db_info <Shows database information>\n"; print"::>> remove <Remove a user from the database>\n"; print"::>> banner <Add's a banned so you start a freash>\n"; print"::>> seluser <Show's all of the selected users infomation>\n"; print"::>> print <See data base's content's (names, age, location, recovery)>\n"; print"::>> Exit <Exit the database>\n\n"; } elsif ($input eq "users") { foreach $line (@names) { $num++; print"\n\n\t$num) $_\n"; } } elsif ($input eq "remove") { print"To remove a User you will have to use a database no.\nYou will be able to view the number when you view users.\n\n"; print"username: "; chomp ($usesel = <STDIN>); delete $names[$usesel]; delete $age[$usesel]; delete $location[$usesel]; delete $recovery_info[$usesel]; print"User Deleted...\n"; } elsif ($input eq "banner") { print"\n\n\n\n"; print"================================================================================​\n"; print"---------------------------------- + {DB_s11} + --------------------------------\n"; print"================================================================================​\n"; print"For help type -h\n\n"; } elsif ($input eq "seluser") { print"To select a user you must know there database number.\n\n"; print"DB Number: "; chomp ($sel = <STDIN>); print"\n\nName: $names[$sel]\n"; print"Age: $age[$sel]\n"; print"Location: $location[$sel]\n"; print"Recovery Code: $recovery_info[$sel]\n\n\n"; } elsif ($input eq "print") { print"To use this feature you will need to know the datanames.\n\n"; print"Dataprint: "; chomp ($dbprint = <STDIN>); print"Gathering information...\n\n"; if ($dbprint eq "names") { foreach(@names) { print"\n\n\t $_\n"; } } if ($dbprint eq "age") { foreach(@age) { print"\n\n\t $_\n"; } } if ($dbprint eq "location") { foreach(@location) { print"\n\n\t $_\n"; } } if ($dbprint eq "recovery") { foreach(@recovery_info) { print"\n\n\t $_\n"; } } } elsif ($input eq "exit") { $count = 11; print"Exiting Database...\n\n\n\n\n"; } else { print"Invalid Command\n\n"; } }


This was my personal project that i set myself, to make a fully working database.


RE: [PERL] Small Interactive database [CODE INCLUDED] - White Charisma - 05-19-2011

looks interesting Smile

thanks man


RE: [PERL] Small Interactive database [CODE INCLUDED] - TheShadow1 - 05-20-2011

Thanks. I might use this in one of my projects. Thanks again!


RE: [PERL] Small Interactive database [CODE INCLUDED] - Coded32 - 05-20-2011

I know the OP and he is one of the best programmers that i have ever met.
The perl basics were funny, best of luck with your Perl.


RE: [PERL] Small Interactive database [CODE INCLUDED] - FrostByte_mybb_import5923 - 05-20-2011

thanks very much, support if always nice