Feb22 - CSE262 Programming Languages Instructor Dr Liang...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE262: Programming Languages Instructor: Dr. Liang Cheng Department of Computer Science and Engineering P.C. Rossin College of Engineering & Applied Science Lehigh University February 22, 2007
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Instructor: Dr. Liang Cheng CSE262: Programming Languages 02/20/07 Outline Recap Pointer types Introduction to Perl Record types Summary and homework
Image of page 2
Instructor: Dr. Liang Cheng CSE262: Programming Languages 02/20/07 Some Pointer Rules From Stanford CS Education Library A pointer stores a reference to its pointee. The pointee, in turn, stores something useful. The dereference operation on a pointer accesses its pointee. A pointer may only be dereferenced after it has been assigned to refer to a pointee. Most pointer bugs involve violating this one rule.
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Instructor: Dr. Liang Cheng CSE262: Programming Languages 02/20/07 Other Issues Discussed Bad pointers Implicit scaling *(p+5) Dangling pointers Lost heap-dynamic variables
Image of page 4
Instructor: Dr. Liang Cheng CSE262: Programming Languages 02/20/07 Outline Recap Introduction to Perl Record types Homework and programming assignment
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Instructor: Dr. Liang Cheng CSE262: Programming Languages 02/20/07 Write Your First Perl Program #!/usr/bin/perl # My First Perl Program use strict; # pragma use warnings; print "What is your name?"; my $username; $username = <STDIN>; chomp($username); print "Hello, $username. \n"; example1.pl Must have this at the top of each Perl program Standard output Comments Explicit variable declaration by keyword my due to the strict mode File handle Remove “new line” by a built-in fun http://www.perl.com/doc/manual/html/pod/perlfunc/
Image of page 6
Instructor: Dr. Liang Cheng CSE262: Programming Languages 02/20/07 Run Your First Perl Program How to run? perl example1.pl perl script perl-compiler < script | perl-interpreter perl-compiler: source-code to parse-tree No generation of C code, assembly language, nor machine code
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Instructor: Dr. Liang Cheng CSE262: Programming Languages 02/20/07 Scalar Data - String String
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern