Thread: @ARGV variable

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    West Chester, PA USA
    Posts
    2
    Rep Power
    0
    Can someone help me and tell me mabout the @ARGV variable in PERL?

    thanks.
  2. #2
  3. SwollenMember
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    the master control
    Posts
    264
    Rep Power
    15
    lets say you have a script called 'jerk.pl' and then when you run the script you type this at the command line:
    jerk.pl loser hoser
    $ARGV[0] would be loser
    $ARGV[1] would be hoser
    basically it is an array that stores the arguments you pass to the script...that is the short version
  4. #3
  5. No Profile Picture
    ledjon
    Guest
    Devshed Newbie (0 - 499 posts)
    If you want multiple words on one element of the array, then you need to put them in quotes:

    jerk.pl "loser loser" "hoser"
    $ARGV[0] would be "loser loser"
    $ARGV[1] would be "hoser"

IMN logo majestic logo threadwatch logo seochat tools logo