Created by sironekotoro 2018-06-17 View revision File hash_profile.pl Added Side-by-side diff More Ignore whitespace Hide word diff +#!/usr/bin/env perl +use strict; +use warnings; + +# Perl入学式 2018 第3回 練習問題 +# https://github.com/perl-entrance-org/workshop-2018/blob/master/3rd/slide.md +# 練習問題(hash_profile.pl) + +# 次の処理をする hash_profile.pl を作りましょう。 + +# 1. 自分の名前 (name)、年齢 (age)、好きな食べ物 (food) を key にしたハッシュ %my_profile を作ってください。 +my %my_profile = ( name => 'sironekotoro', age => '200', food => 'ramen' ); + +# 2. key である name, age, food を使って、それぞれの value を出力してください。 +print $my_profile{name}, "\n"; # sironekotoro +print $my_profile{age}, "\n"; # 200 +print $my_profile{food}, "\n"; # ramen +