How to do a consecutive grep?

2002-07-10 Thread Robert Kasunic
Hi, I am looking for an efficient way to do consecutive grep's in perl, i. e. a possibility to resemble something like 'cat some_file | grep pattern1 | grep pattern2 | grep pattern3'. I know I can do that as follows: @array = ; @res_grep1 = grep /pattern1/, @array; @res_grep2 = grep /pattern1

Re: HOW TO capture an EXACT perl command line?

2002-07-08 Thread Robert Kasunic
Hi Charlie, On Mon, Jul 08, 2002 at 07:50:22PM -0700, charlie strauss wrote: > You might think, "well just join the @ARGV array and voila!: but > this is not exactly the same thing. the main differtence is that > perl removes any surrounding quotation marks of the split arguments. I don't think

Re: number 1 showing up in printf output I don't understand

2002-07-07 Thread Robert Kasunic
Hello Zachary, On Sat, Jul 06, 2002 at 11:19:58PM -0700, Zachary Buckholz wrote: > Odd extra '1' showing up? Can someone explain this. > my $current_date = printf("%04d-%02d-%02d", $year+1900, $month+1, $day); ^^ The problem lies here. You have to use sprintf to get a

How to start processes in parallel?

2002-07-02 Thread Robert Kasunic
Hello, I have some shell scripts that I want to start from a perl script on about 10 hosts via ssh. At the moment I start them one after another. As you probably can imagine this takes quite a long time. So I would like to process them in parallel. How could that be done? Threads? I'd really app

Re: Parameter parsing with Getopt::Long in functions

2002-06-15 Thread Robert Kasunic
Hello Paul, On Sat, Jun 15, 2002 at 06:27:18PM +0200, Paul Johnson wrote: > > sub test_params() > > { > >@ARGV=@_; > local @ARGV = split " ", shift; > Hopefully you can work out what the problem was and why the fix works. I can't believe how blind I've been. Thank you very much. I now c

Parameter parsing with Getopt::Long in functions

2002-06-15 Thread Robert Kasunic
Hello, I'm trying to use Getopt::Long for parsing parameters passed to a function. I tried to test if that works by using the following script. --- #!/usr/bin/perl -w use strict; use Getopt::Long; sub test_params() { @ARGV=@_; print "ARG