Jump to content
fl0 fl0w

$Perl tutorial[the basics]fl0 fl0w$

Recommended Posts

My name is fl0 fl0w and i am going to show you a couple of basic things in Perl.Let's begin.

Arrays

The beginning of every perl program is :

#!/usr/bin/perl -w

# This sign is used for comments.

Arrays contain values.The join function is used when printing the elements of an array.

Algorithm :

 #!/usr/bin/perl -w

@a=qw(Salut ,sunt eu ,fl0 fl0w);

print join('',@a);

Algorithm

 #!/usr/bin/perl -w

@a=('hello','world','my','name','is','florin');

print @a[0]." ".@a[1]." ".@a[2]." ".@a[3]." ".@a[4]." ".@a[5]."\n";

I have used the split method,this splits the worls apart with spaces.

How do you run the programs ?Simple ,just save them in .PL format and go to CMD and after you instal perl go in to the folder you have saved the program and run it like this :

 c:\[pach]\ perl name.pl

fl0 fl0w

Link to comment
Share on other sites

flo flow nu te supara dar asta nu e un tutorial. nici macar nu reprezinta "the basics". sunt doar cateva functii aruncate acolo. metoda "split"(de fapt e o functie) pe care spui ca ai folosit-o nici macar nu apare in vreun cod iar functia "join" nu este folosita numai atunci cand tiparesti un elementele unui array.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...