Share Pastebin
Guest
Public paste!

theo

By: a guest | Jan 28th, 2010 | Syntax: Perl | Size: 0.28 KB | Hits: 71 | Expires: Never
Copy text to clipboard
  1. #! /usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. my %hash = (
  7.     'fermat' => ['dual core', '2G DDR'],
  8.     'gauss'  => ['P4', '1G'],
  9.     'euler'  => ['586', '64k']
  10. );
  11.  
  12. foreach ('descartes', 'gauss', 'laplace')
  13. {
  14.     print "we have a machine named $_\n" if ($_ ~~ keys %hash);
  15. }