variables arrays and hashes in perl n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Variables, Arrays, and Hashes in Perl PowerPoint Presentation
Download Presentation
Variables, Arrays, and Hashes in Perl

Loading in 2 Seconds...

play fullscreen
1 / 7

Variables, Arrays, and Hashes in Perl - PowerPoint PPT Presentation


  • 88 Views
  • Uploaded on

Variables, Arrays, and Hashes in Perl. Variables. Login to unixs.cis.pitt.edu and create a hello.pl which will print "hello world“

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Variables, Arrays, and Hashes in Perl' - silas


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
variables
Variables
  • Login to unixs.cis.pitt.edu and create a hello.pl which will print "hello world“
  • Variables: Instantiate 4 variables. Begin by assigning them values. Print the sum, product, and difference of the 4 variables. Then assign strings as values to the variables and print a nice story.
variables1
Variables
  • perl –w xxx.pl
    • Or add #!/bin/perl –w in the first line of perl
  • @,$
array
Array
  • Construct an array consisting of 3 of your favorite baseball teams.
  • Then, incorporate this array into a larger array of your favorite teams overall. Use the length of the new array to print each element in the array.
  • Then, print only the first, third, and last element. To this array, add elements to the beginning and to the end.
  • Then, remove them from the beginning and the end.
  • Finally, sort the array both forward and backward.
array1
Array
  • qw
  • [-1]
  • for/foreach
  • push,unshift,shift,pop
  • sort/reverse sort
    • http://raleigh.pm.org/sorting.html
hashes
Hashes
  • Construct a hash that maps several Universities to their shortened names, i.e. Pittsburgh to Pitt.
  • Sort and print the hash, and then reverse sort and print the hash.
slide7
Hash
  • %
  • delete