Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

the basic datatypes, three

by root (Scribe)
on Oct 29, 1999 at 01:53 UTC ( #861=perltutorial: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
  2. or download this
    $a="5.0"; # set up our variables
    $b="5";   # # to the end of a line is a comment in perl
    print "These variables are equal as strings\n" if($a eq $b);
    print "These variables are equal numerically\n" if($a==$b);
  3. or download this
  4. or download this
    push @array, $value; #puts $value onto the end of @array.
  5. or download this
    @array=reverse @array;
  6. or download this
    @array=("key1","value1","key2","value2");   #an array filled with key 
    +value pairs
    %hash1=("key1"=>"value1","key2"=>"value2"); #one way to initialize a h
    +ash (key=>value,key2=>value2,..)
    %hash2=@array;                              #making %hash2 out of a co
    +llection of key value pairs in an array
    $hash3{"key1"}="value1";                    #creates key of "key1" and
    + value of "value1"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perltutorial [id://861]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2016-05-29 04:46 GMT
Find Nodes?
    Voting Booth?