1 Replies - 3709 Views - Last Post: 12 September 2014 - 12:47 AM

#1 JennaPeterson88  Icon User is offline

  • New D.I.C Head

Reputation: 12
  • View blog
  • Posts: 39
  • Joined: 17-March 10

Non-User Input?

Posted 12 March 2014 - 12:14 PM

I'm trying to write a Perl script, intended to be run using Windows command line, that syncs with Perforce (aka "P4"). The computer I'm currently using at work does not have P4Perl installed, otherwise I would use that and all would be well. I've submitted a ticket with our help desk, but popular opinion is that I should just to command line P4 calls.

I want to limit the user's typing requirements as much as possible. Ideally, I'd like for the user to specify their Perforce workspace name and for the script to do all the grunt work.

To start, how can I make the Perl script execute these commands without the user typing them in full?
P4 set P4CLIENT=workspace
P4 have

I can't find any resources for using information saved in a variable as an input.

This post has been edited by JennaPeterson88: 12 March 2014 - 12:14 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Non-User Input?

#2 rahulbatra  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 17
  • View blog
  • Posts: 186
  • Joined: 28-December 05

Re: Non-User Input?

Posted 12 September 2014 - 12:47 AM

Have a look at the system() subroutine provided by Perl. It allows you to run shell commands. You can construct the commands beforehand as a string which can have user specific variables.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1