title: I can't get a class to work
body: <p>I want to create a Perl class.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#!/usr/ bin/perl
  
  package Data;
  
  sub new
  { my ($class, $student) = @_;
  $class = shift;
  $student = shift;
  $student = {_firstName =&gt; &lt;&gt;,
              _lastName =&gt; &lt;&gt;,
               _matric =&gt; &lt;&gt;,
              };
  bless $student,$class;
  print $student;
  }
  &amp;new;    
  </code></pre>
  
  <p>And I got this error:</p>
  
  <blockquote>
    <p>main=HASH(0x215fc40)Use of uninitialized value $class in bless at source_file.pl line 12.
    Explicit blessing to '' (assuming package main) at source_file.pl line 12.</p>
  </blockquote>
  
  <hr>
  
  <p>I use dcoder and I don't think it supports separating the program. But though I corrected it but it still leaves no output. I tried to print <code>$self</code> but it left an error. Here's the entire code:</p>
  
  <pre><code>#!/usr/ bin/perl
  use strict;
  use warnings 'all';
  
  package student;
  
  sub new {
   my $class = shift;
      my ($first, $last, $matric) = @_;
      my $self = {
          _firstName =&gt; $first,
          _lastName =&gt; $last,
          _matric =&gt; $matric,
          };
      bless $self, $class;
      }
  
  my $self = student-&gt;new('victor','valdes','csc');
  print $self;
  </code></pre>
  
  <p>And here's the error:</p>
  
  <blockquote>
    <p>student=HASH(0x238ae98)</p>
  </blockquote>
  
  <p>I'm sorry I'm really new at this and still don't understand.</p>