Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

the basic datatypes, three

by root (Monk)
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 having an uproarious good time at the Monastery: (3)
As of 2021-04-23 03:28 GMT
Find Nodes?
    Voting Booth?

    No recent polls found