Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

well, it's been a long time since i've used vss, i must admit. i've used pvcs vm for seven years, and am now implementing a merant dimensions infrastructure. i've been doing conversions from vss, but i don't know specifics on fetch by label.

i can, however, help you modify your PerformSS subroutine to make it safer, and more robust. using IPC::Run will give you better control over std(in|out|err). passing system a list instead of a scalar will make the subroutine safer. here's an example:

#!/usr/bin/perl use strict; use warnings; $|++; use IPC::Run qw/run timeout/; sub PerformSS { my( $self, @cmdArgs )= @_; my $status; $self->trace("--- PerformSS did not $cmd ---\n") unless $self->doSS; $status= run ( 'ss', @cmdArgs ) => \my( $in, $out, $err ) => timeout(10); $self->checkError($status => <<ERROR }; PerformSS $cmd failed: status: $status stdout: $out stderr: $err ERROR $self->trace("--- completed $cmd ---\n"); return ( $status, $out, $err ); } my @result= $self->PerformSS( 'get' => '$/project', '-R', '-I-Y', qq{-V"$label"} );

Notes:

  • this code is untested, but it's passed my in-head compiler.
  • i've taken the liberty of formatting it the way i code, including fat commas, uncuddled braces, spacing, parameter passing methods, etc.
  • i've also changed both the input and output to the PerformSS method. it expects a list as input, to secure the system command (via IPC::Run,) and it returns a list including the status, stdout, and stderr for the caller to handle (if it needs it.)
  • this info is no longer written to an errorfile--an errorfile that was already a package global, anyway, so there's one less use of a global var, which is considered (by some) a Good Thing, especially in OO code like yours.

your mileage may vary, but IPC::Run is a powerful module that i use in all my automation when i'm working beyone the capabilities of system and qx{}.

to diagnose the vss errors, i suggest you create a small script (like this one) that uses IPC::Run to test both methods, and inspect the results carefully. you'll have to find a vss forum for more expert help. perhaps http://www.experts-exchange.com/ has a forum for that?

~Particle *accelerates*


In reply to Re^3: Perl source safe get by label failure by particle
in thread Perl source safe get by label failure by mgibian

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2022-05-24 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (82 votes). Check out past polls.

    Notices?