Perl QuickStart - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Perl QuickStart

Description:

Supports nearly everything in Code Complete except the annoying parts. ... Fetching a particular user. Finding patients named X' Questions? Future classes: ... – PowerPoint PPT presentation

Number of Views:92
Avg rating:3.0/5.0
Slides: 12
Provided by: Sain7
Category:

less

Transcript and Presenter's Notes

Title: Perl QuickStart


1
Perl QuickStart
2
Why Perl?
  • Easy to learn, easy to write, easy to use
  • Includes the best features from a dozen other
    languages
  • Over 5500 third-party modules
  • Supports nearly everything in Code Complete
    except the annoying parts.
  • Duct-tapes other systems together

3
Anatomy of a Perl script
4
Data Types
  • SCALAR (Identified with the symbol), holds a
    single number or string
  • HASH (Identified with the symbol), similar to
    a MUMPS local, holds many values that are
    accessed by name
  • LIST (Identified with the _at_ symbol), holds many
    values accessed by number.

5
Variable Gotchas
  • hash - hashfoo (NOT hashfoo)
  • _at_list - list5 (NOT _at_list5)
  • The starting sign represents what you WANT, not
    what the variable IS (what it is is determined by
    the or )
  • _at_hashfoo,bar,baz ?
  • _at_list hash ?

6
Major differences from MUMPS
  • Commands not abbreviated
  • Variables always marked with prefixes
  • Spaces/Lines not significant
  • Statements end with the
  • Routines/Modules dont know about each other
  • Blocks are created with and symbols

7
Hello World
  • 1.0 - Basic Syntax
  • 2.0 - Print any message, followed by reverse
  • 3.0 - CGI Greet the user by Name
    CGI-gtuser(name)

8
Working with Lists
  • Creating lists with _at_list ( )
  • Push, Pop, Shift, Unshift, Splice
  • Sequential access display anything gt 6
  • Foreach
  • Count how many start with a given number

9
Regular Expressions
  • /foo/
  • ,
  • , , , ?, least,most
  • Using () to save pieces
  • Revising Starts with 1 to use grep

10
Searching VMACS
  • Sequentially
  • Counting user by type (Status)
  • Skipping deactive users (DctvDate and
    DctvDate.time vs time)
  • Fetching a particular user
  • Finding patients named X

11
Questions?
  • Future classes
  • Helpful features of Perl
  • More VMACSModules
  • Websites
  • www.cpan.org
  • plumeria.vmth.ucdavis.edu/info/
Write a Comment
User Comments (0)
About PowerShow.com