First, a Perl refresher #!/user/local/bin/perl # Tell your OS this is a perl script use strict; # If you write a script without these use warnings; # ... two lines, you owe me 10 bucks use Module::Name; # "use" is like java's "import" my $stuff = undef; # "my" is how you declare variables # ... "undef" is like java's "null" my $bat = get_bat($name); # Function calls are just like java my $bar = ['Hoss',2,3,$stuff]; # square brackets make an array ref my $baz = {a => 1, b => 2}; # currly braces make a hash (ie: Map) ref my $first = $bar->[0]; # -> dereferences attributes/methods $baz->{'c'} = 3; # ... like "." in java. $bat->do_something(); # if ($bar->[1]) { # "if" and "print" work the way you think print "$first is true\n"; # Double quotes evaluate variables } # ... prints: Hoss is true