[p4perl] Problem Running P4Perl Based Triggers After LinuxSystemUpdate

Peter Prymmer PPrymmer at factset.com
Fri May 9 07:05:38 PDT 2008


p4perl-bounces at perforce.com wrote on 05/09/2008 09:21:42 AM:

> "Scott Lavender" <Scott.Lavender at visiprise.com> 
> Sent by: p4perl-bounces at perforce.com
> 
> 05/09/2008 09:21 AM
> 
> To
> 
> "Peter Prymmer" <PPrymmer at factset.com>
> 
> cc
> 
> p4perl at perforce.com, Tony Smith <tony at smee.org>
> 
> Subject
> 
> Re: [p4perl] Problem Running P4Perl Based Triggers After 
LinuxSystemUpdate
> 
> This is usually how I do things with P4Perl. Usually these return a
> scalar reference to an array or hash that can be dereferenced later.
> Maybe Tony can set me straight... ;) 

If it is a scalar reference to an array (admittedly I should consult 
the docs to discern) then perhaps you intended to
dereference the array when accessing it.  That is, instead of:

my $jobs = $p4->RunJobs();
if ( $#jobs >= 0 )
{
    foreach $job ( @jobs )
    {
        print "$job\n";
    }
}
else
{
    print "There are no jobs...\n";
}

Perhaps you wanted to write (note the extra $jobs in two places below):

my $jobs = $p4->RunJobs();
if ( $#$jobs >= 0 )
{
    foreach $job ( @$jobs )
    {
        print "$job\n";
    }
}
else
{
    print "There are no jobs...\n";
}

Peter Prymmer



More information about the p4perl mailing list