hi,
Does anyone know of a module I could use to constantly capture output within a timeframe? Basically, I want to capture everything that a console is spitting out for 60 seconds. Then I'm planning to search through the output to look for a specific phrase. Any tips would be much appriciated...
you guys have all been a big help. I have one more question on regular expressions though. I want to make an if statement that will print out the line if a word is in the first pair of parenthesis. for example, these would print out:
1. (blah blah WORD) blah blah blah blah
2. (WORD) blah blah...
using perl, how would i get it to erase everything up to and including the first bracket [ ?
I have this, but it only erases up to the [. I need the bracket removed as well.
for($i=0;$i<@mylist;$i++)
{
@mylist[$i] =~ s/[^]]*//;
}
any ideas?
thanks,
gammaman
hi,
I have a windows version of perl installed, and I realized that I need a sed function that's like the unix version. Does perl have a sed? if so, would you call it the same as you would do in unix? ie. " sed -e '/^ *$/d' input" ?
thanks,
gammaman
hi,
i'm having trouble with concatenation in perl. What I need to do is put the input of a file into an array. Then I want to join certain indices in the array. For example:
open FILENAME, "testtest";
@mylist = <FILENAME>;
close FILENAME;
$temp = @mylist[0] . @mylist[1];
print "$temp";
The...
hi,
I have a file that lists files and filepath such as this:
C:\foldera\file1
C:\folderb\file2
...
C:\folderc\file10
C:\folderd\file11
I'm trying to figure out a way to sort these so that they will be sorted in ascending order. I tried using perl's sort:
@sorted_array = sort { $a <=> $b }...
hi,
this is probably really simple, but I haven't figured this out. All I want to do is execute file1.pl which will then execute file2.pl. In unix, I would probably just call "file2.pl" but I'm using perl in windows XP. what command do i need?
thanks,
gammaman1
Hi,
I'm trying to verify this line of code:
select( ( select( STDOUT ), $| = 1 )[ 0 ] );
this line is in a file that takes in 3 arguments.
From what I read from my oreilly book, does this mean that select will return the output filehandle if there is at least 1 arguement?
thanks,
gammaman1
I'm trying to store a large amount of data into a variable, and then ouputting the results to a text file.
open results, ">results";
$test = `execute program that will output`;
print results "$test";
close results;
so now I will have a huge text file named results. But when I run this, the...
Hi,
I just installed windows XP on my machine, and I was trying to figure out how to output the results of an execution to a file. For example:
check_execute("grep test testfile");
sub check_execute {
if (system("$_[0]") != 0)
{
print "failed execution";
print ($?>>8)...
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.