Sort of. You might want to be more specific about what you split on though...

#!perl -w
use strict;
my $line;
my @fields;
my $item;
$line = `ls`;
chomp $line;
@fields = split(/s/,$line);
foreach $item ( @fields ) {
   print "$item\n";
}

Eric Hennessey wrote:

I've got an issue with a split function, or at least I THINK that's where I'm having the problem.
Given that $line is one line of output from a command in column format, I run the following:
$line = `some command`;
chomp $line;
@fields = split $line;
This should produce a list of strings from $line, right?
Any idea why I'd have an empty list when $line contains the expected data as verified from a print command?
Thanks in advance!
Eric


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

Reply via email to