> Ron Smith wrote:
> > Hello all,
> 
> Hello,
> 
> > How do you print elements of an array, each on its own
> line, in a Windows' console?
> > 
> > I'm doing the following:
> > 
> > E:\My Documents>perl -e "use
> ExtUtils::Installed; my $inst =
> ExtUtils::Installed->new(); my @modules =
> $inst->modules(); print @modules"
> > 
> > it returns:
> > 
> >
> Archive::TarArchive::ZipArray::CompareAutoLoaderCPANCPAN::ChecksumsCPAN::DistnameInfo
> ...etc.
> > 
> > I need:
> > 
> > Archive::Tar
> > Archive::Zip
> > Array::CompareAutoLoaderCPAN
> > CPAN::Checksums
> > CPAN::DistnameInfo ...etc.
> > 
> > I tried "\n", '\n' and a
> 'foreach' loop, but nothing I do seems to work.
> ..any suggestions?
> 
> I don't have Windows to test this on but this should
> work:
> 
> perl -MExtUtils::Installed -le"my $inst =
> ExtUtils::Installed->new(); print for
> $inst->modules()"
> 
Thanks, John. It does work. And, I've found that my original command also works 
when I added the -l and 'for' like:

perl -le "use ExtUtils::Installed; my $inst = ExtUtils::Installed->new(); my 
@modules = $inst->modules(); print for @modules"

I don't know if mine is correct form though. 'perl -h' reveals that -l  enables 
line ending processing, specifies line terminator. Is that the idea?


Ron Smith
geeksatla...@yahoo.com

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to