From: Godwin (email_suppressed_at_lugwash.org)
Date: Fri 05-Apr-2002 06:24:14 PM EST
Interesting. what does the pipe | do? If I take it out, nothing happens.
BTW, print "$_; needed another ". Hey, I'm learning. :-)
G-
> As everyone is adding there favorite way, here is
> mine:
>
> #!/usr/bin/perl
>
> open (LS, "ls -l |");
>
> while (<LS>) {
> print "$_;
> }
> close LS;
>
> This will process each line individually, and would
> allow you take action on each line, such as spliting
> is and getting the date stamp and such.
>
> As for a book, I would suggest the orielly perl cd
> bookshelf as it has 6 perl books on CD in html format.
> I have it, and I love it.
>
> If you need any other help, feel free to ask.
>
>
>
> --- Godwin <[e-mail suppressed]> wrote:
> > So if I do something simple like this. How do I
> > traverse (or print) the
> > results? I tried this, but got nothing.
> >
> > #!/usr/bin/perl
> >
> > @list=`ls /`;
> > chomp(@list);
> >
> > foreach $dir (keys %list)
> > {
> > print "$dir";
> > }
> > #--End
> >
> >
> >
>
>
> =====
> Mark Honomichl
> Systems Architect
> www.covisint.com
>
> Unix is a user friendly Operating System....
> It's just picky about who it's friends are.
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
>
-- *** Sent from [e-mail suppressed] *** http://www.lugwash.org to unsubscribe: `echo "unsubscribe" | mail [e-mail suppressed]`
This archive was generated by hypermail 2.1.5 : Wed 30-Oct-2002 10:28:36 PM EST