Umesh T G wrote:
Hi Joe,

just to correct my prevoius one,  my $line does not have * in the begining,
that was a type.  the $line value is like this

*Options=-a"hello" -mt -ml3 -i"dir1\dir2"-k -p -i"dir3\dir4" -m*



my grep return the values correct to my array and the values in array will
be like this obviously:

*Options=-a"hello" -mt -ml3 *
*"dir1\dir2"-k -p *
*"dir3\dir4" -m*
**
**
But, what I'm interested in getting the output values are:
*"dir1\dir2"*
*"dir3\dir4"*

I do not know how to get them......can u suggest pls.?


thanks
Umesh

#!/usr/bin/perl

use strict;
use warnings;

my $line='Options=-a"hello" -mt -ml3 -i"dir1\dir2" -k -p -i"dir3\dir4" -m';

for ( split /\s+/, $line ){
  if( /^-i(.*)/ ){
    print "$1\n";
  }
}

__END__



--

Just my 0.00000002 million dollars worth,
   --- Shawn

"Probability is now one. Any problems that are left are your own."
   SS Heart of Gold, _The Hitchhiker's Guide to the Galaxy_

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to