Best Club Penguin Bots
Hello, you are not logged in. You may log in or register.
Latest topics
» This forum died
Thu Mar 30, 2017 11:10 pm by _Skate_

» Introduce yourselves!
Fri Jan 23, 2015 7:21 pm by Gizmo92883

» Anybody else come to this forum for the memories?
Wed Nov 26, 2014 12:46 am by Gizmo92883

» Ozzy's Bot Script
Mon May 13, 2013 8:31 am by Pig

» Goodbye BCPB Forums.
Tue Sep 18, 2012 6:37 pm by 43nînjâ17

» Follow bot script (100% Credit to Cp-Cheater )
Sun Sep 16, 2012 4:55 pm by Dentonbrooks

» Xat Main Owner Hacker
Fri Aug 17, 2012 2:32 am by 43nînjâ17

» xat message big
Sat Aug 11, 2012 12:32 am by 43nînjâ17

» CPPS GLICH "Auto Talker"
Sat Aug 11, 2012 12:25 am by 43nînjâ17

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Club Penguin Events
Advertisement

How to make a simple perl script

View previous topic View next topic Go down

How to make a simple perl script

Post  Ozzyozborn13 on Sat Nov 20, 2010 11:57 pm

Hello, In this tutorial I will show you how to make a simple perl script that says "Hello World!" on your screen.

Step 1: Open Notepad or Notepad++ on your computer.

Step 2: Write this on the first line:
Code:
#!/usr/bin/perl -w
The Purpose of this is to tell the system that it is a perl script.

Step 3: Press Enter 2 times and write this:
Code:
print "Hello World!\n";
Print is one of the most commonly used functions in perl. It tells Perl to display what is in the quotes on your screen. Remember not to capitalize print or else it wont work. The \n tells perl to begin a new blank line on the screen after the text.\

Step 4: Write this on the next line:
Code:
sleep 2;
Basically what this does is tell perl to pause for 2 seconds or you can replace the 2 with any number you want. It just gives you time to read it, if you dont add this the script will just quickly open and close in under a second.

Step 5: Write this on the next line:
Code:
exit;
As you probably guessed this tells perl to close the script. Now for this script it is not necessary because after it stops pausing and there is no more coding it will just close.

When you are done it should look something like this.
Code:
#!/usr/bin/perl -w

print "Hello World!\n";
sleep 2;
exit;

If you want to learn how to script in perl then you shouldn't just copy the script right there ↑. The purpose for this tutorial is for you to learn.

Thanks for reading.

_________________
[You must be registered and logged in to see this image.]



[You must be registered and logged in to see this link.]

[You must be registered and logged in to see this link.]



[You must be registered and logged in to see this image.]
avatar
Ozzyozborn13
Admin

Posts : 211
Reputation : 19
Join date : 2010-08-28

http://www.youtube.com/ozzyozborn13

Back to top Go down

How do we do this?

Post  Mintoes on Sat Feb 05, 2011 1:08 pm

How do we like um make the script? It just says its a code. I do not get this at all!
confused
ak47 banana lol!

Mintoes

Posts : 11
Reputation : 0
Join date : 2011-01-30
Age : 15
Location : Earth

http://mintoescp.wordpress.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum