#!/usr/bin/perl -w use strict; use Data::Dumper; use Carp; use Getopt::Long; my $cone_type = 'sugar'; my $no_unit = 1; my $help = 0; if ( @ARGV == 0 ) { &usage(); exit(1); } my $res = GetOptions ( "type=s"=>\$cone_type, "unit=i"=>\$no_unit, "help"=>\$help,); if ($res) { die "Unit too large\n" if ($no_unit > 5); my %unitprice = ( 'sugar' => 100, 'waffle' => 200 ); my $total_price = $unitprice{$cone_type} * $no_unit; print "$total_price\n"; } sub usage { print <