Hello,
Yes, I'm using IPC::Open3.
I wrote such code to be able to run different commands, pass them need data into STDIN, and store their STDOUT and STDERR. and exam various exit codes:
sub _run {
my $cmd = shift; # CMD to execute as plain string
my $input = shift; # CMD STDIN data...
Hello,
Does anybody can assist me with open3()?
It is require correct STDIN, STDOUT, STDERR, exit code, child process's manipulation, correct zombies cleanup, disable child(s) buzz
Thanks in advance for your time and help.
Best Regards
Hi all in the forum.
Does anybody know any versions comparator perl module?
For example, it is required to compare linux rpm packages versions.
Thanks,
Best Regards.
Hello,
I need to start/open new console session from my perl script, and allow user to run any commands (like as in usual Linux console).
Thanks,
Yura.
Hello,
It is easier to work with imported scalars instead of hash ,,,
And it is interesting for me if there is the way to do such export/import.
Best Regards.
Hello,
Thanks for your replies.
The issue is that I don't know hash keys/values, theirs number (in general). The hash is stored in XML, and has to be loaded from it.
So I need dynamicly form @EXPORT_OK.
But the script will import variables as you wrote by:
use ModuleName qw($cat $grep $host)...
Hi All.
I have symple hash in module (ModuleName), for example:
my %exec;
$exec{'cat'} = '/bin/cat';
$exec{'grep'} = '/bin/grep';
$exec{'host'} = '/usr/bin/host';
I want module export scalars with 'on fly' generated (from this hash) names=hash keys, and scalars values=hash...
Thanks for your help
I found the same solution:
{
local $SIG{'__WARN__'} = sub {
print $_[0];
};
eval { File::Path::rmtree($dir) };
}
Best Regards.
Yura.
Hi all.
I'm using the following structure in my perl script:
eval { File::Path::rmtree($dir) };
if ($@) {
do_somth();
}
But sometimes, the script prints to STDOUT/STDERR following warnings/errors:
Can't remove directory /some/dir: Directory not empty at script.pl line XXX
It is required...
Hi All in forum,
I need to compute/convert date/time string like:
Tue Jul 6 06:24:29 EDT 2004
to the corresponding time(2) value in seconds since the system epoch, using standard Perl functions.
Best Regards,
Yura.
Hello,
I use 'system' to execute another programs.
When executed processe fork another child processe(s), and this processe stop or not respond, 'system' not receive any signals from it.
Then I need to write my own processes "reaper" for my second, third, ... level child processes.
Does...
Thanks for help.
Perl cannot change/set 'wide' system enviroment variables.
The only way to do this for all new sesions - create exporting files/scripts for different shells and plase them into '/etc/profile.d/' (for Linux).
Thanks again.
Yura.
Hi All.
I need to set new environment variable value (or change an old one), not for the running script fork, but for currient user sesion.
Thanks,
Yura.
Hi Scotty
The module get loaded (use, require) after the script modifies the config file, but when I use imported variables, Thay have old (not modefied) values?
Thanks,
Yura
Hi all.
I have the module Vars.pm, that parthes and exports some configuration variables:
#!/usr/bin/perl -w
package Module::Vars;
require 5.004;
require Exporter;
use strict;
use Exporter;
BEGIN
{
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
$VERSION = 0.1...
Hi all in forum.
In my perl script i try to examine $? variable value:
---
system("");
$exit_value = $? >> 8;
if( $exit_value == 0 ){
...
}
When I run the script from command line, $? returns correct value.
But smth. goes wrong when the script is executed by cron (daemon to execute...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.