Daniel Kidger wrote:
> 
> I have a pattern like
>    $hosts = "fred[1,3-7,9-22]"
> 
> Is there a simple way to generate an expanded list like:
>    fred1 fred3 fred4 fred5 ...
> etc.

Well, I don't know how simple you consider this:

my $hosts = "fred[1,3-7,9-22]";
my ( $name, $list ) = $hosts =~ /([^[]+)\[([^\]]+)]/;
$list =~ s/-/../g;
my @hosts = map { $name . $_ } eval $list;



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to