Perl Tutorial - 2 林光龍. Memory Address (1/2) A number that is assigned to each byte in a computer’s memory that the CPU uses to track where data and instructions.

Slides:



Advertisements
Similar presentations
Abbreviations. Types of People Mr. Larder used for a man.
Advertisements

Months of the year December January November October February
Learn all about the year.
SUNDAY MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY
Chubaka Producciones Presenta :.
The Months and The Seasons Prepared by Claudia Doria and Terra Myers.
Faculty of Sciences and Social Sciences HOPE Structured Problem Solving Week 12: Data Structures 1 Stewart Blakeway FML 213
2012 CALENDAR. JANUARY 2012 Sunday 日 Monday 月 Tuesday 火 Wednesday 水 Thursday 木 Friday 金 Saturday 土
2012 JANUARY Sun Mon Tue Wed Thu Fri Sat
January 2012 Monday Tuesday Wednesday Thursday Friday Sat/ Sun / /8 14/15 21/22 28/
/3024/ SUN MON TUE WED THU FRI SAT JANUARY 2011 February 2011 SMTWTFS
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAY WEEK WEEK WEEK WEEK WEEK CALENDAR PROJECT.
MATHEMATICS Time – Dates, Calendars and Timetables.
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSAT/SUN Note: You can print this template to use as a wall calendar. You can also copy the slide for any month to add.
2007 Monthly Calendar You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation.
What day is today? What`s the date?. Sunday Monday Tuesday Wednesday Thursday Friday Saturday What day is today?
The Meeting Place Second Grade Saxon Math Lesson 30B.
The Meeting Place Second Grade Saxon Math Lesson 34.
Perl Tutorial - 2 林光龍. Memory Address (1/3) A number that is assigned to each byte in a computer’s memory that the CPU uses to track where data and instructions.
WORD JUMBLE. Months of the year Word in jumbled form e r r f b u y a Word in jumbled form e r r f b u y a february Click for the answer Next Question.
DATE POWER 2 INCOME JANUARY 100member X 25.00P2, FEBRUARY 200member X 25.00P5, MARCH 400member X 25.00P10, APRIL 800member.
By Monica Hilgemann Second Grade Teacher
2011 Calendar Important Dates/Events/Homework. SunSatFriThursWedTuesMon January
What can we do in English?. Can you count in English? Count from one to ten and vice versa. Count from ten to twenty and vice versa. Can you continue.
The Calendar.
July 2007 SundayMondayTuesdayWednesdayThursdayFridaySaturday
EVERY WEEK Every week has seven days, See how many you can say.
2015 monthly calendar template
2016 monthly calendar template
JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER
JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER
This template will allow you to easily create an annual calendar without having to change all the dates manually. It has 28 pages because it was put together.
2018 monthly calendar template
Insert Client Logo here with Client Project Name
1   1.テキストの入れ替え テキストを自由に入れ替えることができます。 フチなし全面印刷がおすすめです。 印刷のポイント.
JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER
Logo Calendar – January 2012 TO DO LIST 01/04/2012 Example TO DO LIST
January MON TUE WED THU FRI SAT SUN
January MON TUE WED THU FRI SAT SUN
ANNUAL CALENDAR HOLIDAYS JANUARY FEBRUARY MARCH APRIL MAY JUNE
HOLIDAYS ANNUAL CALENDAR JANUARY FEBRUARY MARCH APRIL MAY JUNE
2020 monthly calendar template
January Sun Mon Tue Wed Thu Fri Sat
January MON TUE WED THU FRI SAT SUN
January MON TUE WED THU FRI SAT SUN
2017 monthly calendar template
HOLIDAYS ANNUAL CALENDAR JANUARY FEBRUARY MARCH APRIL MAY JUNE
S M T W F S M T W F
January MON TUE WED THU FRI SAT SUN
McDonald’s calendar 2007.
2009 monthly calendar template
1 - January - Sun Mon The Wed Thu Fri Sat
2 0 X X s c h e d u l e 1 MON TUE WED THU JANUARY 20XX FRI SAT SUN MEMO.
January MON TUE WED THU FRI SAT SUN
JANUARY 1 Sun Mon Tue Wed Thu Fri Sat
Calendar
Calendar.
January MON TUE WED THU FRI SAT SUN
JANUARY 1 Sun Mon Tue Wed Thu Fri Sat
January MON TUE WED THU FRI SAT SUN
S M T W F S M T W F
JANUARY 1 Sun Mon Tue Wed Thu Fri Sat
McDonald’s calendar 2007.
1 January 2018 Sun Mon Tue Wed Thu Fri Sat
1 January MON TUE WED THU FRI SAT SUN MEMO 2 February MON TUE WED THU FRI SAT SUN.
2015 January February March April May June July August September
S M T W F S M T W F
S M T W F S M T W F
1 January MON TUE WED THU FRI SAT SUN MEMO 2 February MON TUE WED THU FRI SAT SUN.
Presentation transcript:

Perl Tutorial - 2 林光龍

Memory Address (1/2) A number that is assigned to each byte in a computer’s memory that the CPU uses to track where data and instructions are stored in RAM. Each byte is assigned a memory address whether or not it is being used to store data. The computer’s CPU uses the address bus to communicate which memory address it wants to access, and the memory controller reads the address and then puts the data stored in that memory address back onto the address bus for the CPU to use.

Memory Address (2/2) $b = 17; $a = \$b;

$b[2] $b[1] $b[0] $c{“k3”} $c{“k2”} %c $c{“k1”} E015 E001 E013 E017 E033 E031 E035

$b[2] $b[1] $b[0] $c{“k3”} $c{“k2”} %c $c{“k1”} E015 E001 E013 E017 E033 E031 E035 \$a \%c

Reference A reference is a scalar value that points to a memory location that holds some type of data. $a = = (1, 2, 3); %c = ("k1" => "foo", "k2" => "bar"); $add_of_a = \$a; $add_of_b = $add_of_c = \%c; print <<"END"; The address of \$a is $add_of_a The address of is $add_of_b The address of \%b is $add_of_c END

Multi-Dimensional = (' ', 'Sending Mail in Perl', 'Philip = (' ', 'Manipulating Dates in Perl', 'Philip = (' ', 'GUI Application for CVS', 'Philip = The result would be similar to = (' ', 'Sending Mail in Perl', 'Philip Yuson', ' ', 'Manipulating Dates in Perl', 'Philip Yuson', ' ', 'GUI Application for CVS', 'Philip Yuson');

Multi-Dimensional Array Instead of pumping these into one list, you can put the references of these arrays in the = Or to = ( [' ', 'Sending Mail in Perl', 'Philip Yuson'], [' ', 'Manipulating Dates in Perl', 'Philip Yuson'], [' ', 'GUI Application for CVS', 'Philip Yuson']);

To Get Value in Multi-Dimensional Array (1/2) To reference the first column of the first row: $ref = $main[0]; # set $ref to reference $ref->[0]; # Returns the first item To simplify: $main[0]->[0]; You can also simplify this as: $main[0][0]; To get the value of the second column of the third row: $ref = $main[2]; # Third row; $ref->[1]; # second column;

To Get Value in Multi-Dimensional Array (2/2) use strict; = (86, 77, 82, 90); = (88, 70, 92, 65); = (71, 64, 68, 78); = for (my $row = 0; $row < $#grades+1; $row++) { for (my $col = 0; $col < $#{$grades[$row]}+1; $col++) { print $grades[$row][$col]. ", "; } print "\n"; }

Associative Array (1/2) Scalar is the simplest Perl data type which was designed to hold only one thing like a number, a string or a reference. A list is an ordered collection of scalars. An array is a variable that contains a list. A hash is a data structure like an array, in that it can hold any number of values and retrieve these values at will. However, instead of indexing the values by number, as we did with arrays, we'll look up the values by name. That is, the indices (here, we'll call them keys) aren't numbers but are arbitrary unique strings

Associative Array (2/2) 3 $x Dog $y 3 $a[2] 2 1 $a[1] 188 $h{ "he" } Wall Larry $h{ “ln" } $h{ "fn" } %h

Creating a Hash my %weekdays = ( 'Sun' => 'Sunday', 'Mon' => 'Monday', 'Tue' => 'Tuesday', 'Wed' => 'Wednesday', 'Thu' => 'Thursday', 'Fri' => 'Friday', 'Sat' => 'Saturday', ); my %month = ( 'January' => '01', 'February' => '02', 'March' => '03', 'April' => '04', 'May' => '05', 'June' => '06', 'July' => '07', 'August' => '08', 'September' => '09', 'October' => '10', 'November' => '11', 'December' => '12', );

Hash Operation Retrieving a value from a hash. Adding new key/values to a hash. Changing the value of an existing hash key. Deleting a key/value from a hash. my $day_of_the_week = $weekdays{'Wed'}; delete $weekdays{'some'}; $weekdays{'some'} = 'someday';

Hash Function keys(%hashname) values(%hashname) each(%hashname)

17 Reference Perl Tutorial: Start, – – m (Big5 Version) m The perl.ogr Online Library, Beginning Perl – perl.org Perl For CGI tutorials

18 A. D. Marshall, Practical Perl Programming, , Simon Cozens, Ten Perl Myths, February 23, 2000, 簡信昌, Perl 學習手札全文, 朱孝國, Perl 筆記, Perl 的安全性監測, Programmer's File Editor, The CPAN Search Site, Regular Expression Tutorial, expressions.info/tutorial.htmlhttp:// expressions.info/tutorial.html 18