Command Line Arguments - PowerPoint PPT Presentation

1 / 3
About This Presentation
Title:

Command Line Arguments

Description:

argv[] contains program name and arguments. argc contains number of ... ARGV contains list of arguments $0 contains program name. Examples: myscript 15 4 hello ... – PowerPoint PPT presentation

Number of Views:148
Avg rating:3.0/5.0
Slides: 4
Provided by: PaulL155
Category:
Tags: arguments | argv | command | line

less

Transcript and Presenter's Notes

Title: Command Line Arguments


1
Command Line Arguments
2
Command Line Arguments
  • Similar (yet different) to C/C
  • in C/C
  • argv contains program name and arguments
  • argc contains number of arguments plus one
  • in Perl
  • _at_ARGV contains list of arguments
  • 0 contains program name

3
Examples
  • myscript 15 4 hello
  • array _at_ARGV ? (15, 4, hello)
  • scalar 0 ? myscript
  • scalar(_at_ARGV) ? 3
  • myscript
  • _at_ARGV ? ( )
  • 0 ? myscript
  • scalar(_at_ARGV) ? 0
Write a Comment
User Comments (0)
About PowerShow.com