Hi,
I am a perl newbie..
I am sending a Perl script about five lines of data via <STDIN>.
cat filename | ./my_perl_script.pl
Where filename contains
This is line one sending to perl
this is line two with DATE: 19-Sept-01 and
I want to grab a certain string
and some more here.
I am storing this data like this...
@line=<STDIN>
I think this is working fine.
I now want to grab words from this @line.
a) I want to know how I can grab a word that is six places in from the left
on line 3....in the above example the word would be "certain". I can do this
in shell with "awk {print $6}"... Is there something with perl?
b) I want to find a regexp eg I want the DATE string...how can I find this.
I have thought about how I can cycle through the @line array and how I can
extract the data....not sure if I should be getting rid of all the returns
and placing it in one string.
Any help would be appreciated.
Thanks,
Brett
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]