Eric,

> -----Original Message-----
> From: Hawley, Eric [mailto:[EMAIL PROTECTED]] 
>  actually I think I see what is wrong with the code.  At 
> first I was reading the wrong variable which was producing 
> just the word "Status" and second after looking at the grep 
> function again it looks as though I will have to store the 
> file into a data structure and grep from that data structure 
> to get the desired results.

There is, however, a really nice feature of the magical diamond "<>" that
can help you. If you're writing one-shot code it can be a real time saver,
but should not be used in production code as it's mostly silent when things
go wrong.

# pretend we got a whole load of lines from the command line
@ARGV=<*.txt>; 
# grep the magical <> 
my @results = grep /^Status/, <>; 

As if by magic...


Alistair


-----------------------------------------------------------------------


Registered Office:
Marks & Spencer p.l.c
Michael House, Baker Street,
London, W1U 8EP
Registered No. 214436 in England and Wales.

Telephone (020) 7935 4422 
Facsimile (020) 7487 2670

www.marksandspencer.com

Please note that electronic mail may be monitored.

This e-mail is confidential. If you received it by mistake, please let us know and 
then delete it from your system; you should not copy, disclose, or distribute its 
contents to anyone nor act in reliance on this e-mail, as this is prohibited and may 
be unlawful.

The registered office of Marks and Spencer Financial Services PLC, Marks and Spencer 
Unit Trust Management Limited, Marks and Spencer Life Assurance Limited and Marks and 
Spencer Savings and Investments Limited is Kings Meadow, Chester, CH99 9FB.

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to