[p4] perl trigger

David Alban dalban at stubhub.com
Thu Nov 16 09:50:54 PST 2006


I'm new to perforce, so my comments below are outside the context of
perforce.

In any shell or perl program, always set an explicit path near (if not
at) the top of the program.  Examples:

       # perl
  $ENV{ PATH } = "/sbin:/bin:/usr/sbin:/usr/bin";

       # bourne compatible shells
  PATH=/sbin:/bin:/usr/sbin:/usr/bin; export PATH

Use whatever value of path is appropriate to your system and your
program's needs.

When you set 

Otherwise, not only do you run the risk of not "finding" a command, you
run the risk of picking up an untrusted version of the command.

-- 
David Alban <dalban at stubhub.com>
Release Engineering Tools
http://StubHub.com/

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Dave Lewis
Sent: Wednesday, November 15, 2006 7:54 PM
To: Robert McKenna
Cc: perforce-user at perforce.com
Subject: Re: [p4] perl trigger

Hi Rob!  Just taking a guess, it might be that there are
few or no paths set in the PATH env, so that 'ls'  might
not be found.  try /bin/ls  or wherever ls is residing...

dave

On 11/15/06, Robert McKenna <robertm at bioware.com> wrote:
> Hi
>
> I'm having a problem with a trigger which runs fine unless I try to
> execute a command using back ticks or system. The following is a very
> simple trigger I've been using for testing and which fails on the line
> @FILES = `ls -l /perforce/triggers`;. The trigger succeeds if this
line
> is replaced with a static assignment to @FILES. "Die" produces no
output
> in the validation failure message.
>
>
>
> #!/usr/bin/perl
>
> @FILES = `ls -l /perforce/triggers` || die("Bombed");
>
> foreach $FILE (@FILES) {
>
>   $test = $FILE;
>
> }
>
>
>
> The entry in the triggers table is this.
>
>
>
> simple change-submit //test/perforce/robertm/triggers/CookedXenon/...
> "/usr/bin/perl /perforce/triggers/simple.pl 2>&1"
>
>
>
> Any thoughts would be welcome.
>
>
>
> Rob McKenna
>
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user




More information about the perforce-user mailing list