platform independent (-:
I don't think Windows has a separate stream for Errors thought....
You can also try to use the IPC:Open3 module...
It works fine on UNIX...
use IPC::Open3;
open3($in,$out,$err,"ls -l|");
close $in;
@b=<$out>;
@c=<$err>;
print STDOUT "OUT:", @b, "\n\n\n";
print...
If your code works fine except when it returns nothing, just try to test if the variable is defined before doing your match.....I don't totally understand your snippet of code though but try this with the defined function.
sub process_input
{
#
# Code to process the information from the PIX...
When you use the /g , the expression returns a list not a scalar value anymore since you can have multiple matches.
{
$line =~ s,<[/]?.*?>,,g;
@a = ($line =~ m/\w+/g);
$wc += scalar(@a); # or $wc += @a;
}
print "Word count: $wc\n";
or if you want to be very fancy ;-), you...
you can also play with the /e modifier....
my $source = "(\\d\\d)(\.\*)" ;
my $dest = '"data $1"';
$_ = "35 example filename.fmn";
s/$source/$dest/ee; # print also data 35
print("$_\n"); #prints 'data'
You are doing the substitution a little too early :-)
It only happens in-place between quotes when the variable is set. Therefore this should work.
my $source = "(\\d\\d)(\.\*)" ;
my $dest = "data";
$_ = "35 example filename.fmn";
s/$source/"$dest $1"/; # this work....
print("$_\n"); #prints...
Assuming the regex works....
Since He wants to count 1 occurrence of the match between _t3, you need to reset the $flag to 0 where you are incrementing.
if ($flag)
{
++$trans;
$flag = 0;
}
The way to solve your problem is to write a separate LOG package /object that you can pass the object reference to your diverse functions within your packages. Since I can't seem to fall asleep, I'll write it for you :-) to illustrate......
LOG.pm...
Must have been late :-)
Please notice that you're passing $year to get_files as parameter and you're not using it. Although the get_files function seems to be an overkill for what you want to do. A simple solution:
sub get_files
{
my $year = shift;
my @dirs =...
At my last job, I used a cool software xtsql32.exe written in PowerBuilder I believe to access databases. Where can I find a download online or can someone get me a copy. I’ll appreciate the help. I just miss it a ton. Thanks!
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.