[p4] perl trigger

Ken.Williams at thomson.com Ken.Williams at thomson.com
Thu Nov 16 11:16:20 PST 2006


Hi Rob,

You've got an operator precedence problem there.  Change to this:

   @FILES = `ls -l /perforce/triggers` or die("Bombed");

Or this:

  (@FILES = `ls -l /perforce/triggers`) || die("Bombed");

 -Ken

> -----Original Message-----
> From: perforce-user-bounces at perforce.com 
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of 
> Robert McKenna
> Sent: Wednesday, November 15, 2006 4:53 PM
> To: perforce-user at perforce.com
> Subject: [p4] perl trigger
> 
> 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
> 




More information about the perforce-user mailing list