#!/usr/bin/perl
use strict;

# comments
# variables.pl
#

# Scalar Variables

my $name = "Will";

my $area_code = 713;

 
my $desired_bonus = 1_000_000;

# Better quotes

print qq(my name is $name, but you can call me "Willis");

print q(What you talk'n about, "Willis"?);

# Array Variables

my @friends = ( 'Ned', 'Brady', 'Keith', 'John', 'Mo' );

my @favorite_numbers = ( 8, 4, 22, 77 );

my @favorite_numbers = qw( 8 4 22 77 );

my @random_scalars = ( 8, "eight", -80, $name );

# Array elements

print $friends[1];    #  "Brady"

print @friends[ 1 .. 3 ];    # "Brady", "Keith", "John"

# Setting Array values

$friend[99] = 'Todd';

print "I have " . $#friends + 1 . " friends\n";

my $friend_count = @friends;

print "I have $friend_count friends\n";

# Hash Variables
# look-up tables or dictionaries

my %spanish = (
    'one'   => 'uno',
    'two'   => 'dos',
    'three' => 'tres'
);

my $three = $spanish{three};

$spanish{four} = 'cuatro';

@spanish{'five', 'six'} = ('cinco', 'seis')