+ Reply to Thread
Results 1 to 2 of 2

Thread: replace item in @ARGV

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    11

    replace item in @ARGV

    I have a perl script that accepts a long option like --pager='less -R' and I want to shorten it to -p only.
    I`m assuming the most direct way is to search and replace -p in the ARGV array with --pager='less -R' before it starts to process the command line arguments.

    Any ideas ? and thanks

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    19
    You can use the following code :
    Code:
    s/^-p$/--pager/ for @ARGV;

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts