in reply to Re: making a list
in thread making a list and saving results

thanks, but how could i add a prefix to those numbers? like
something1 something2 something3
etc., etc.

Replies are listed 'Best First'.
Re^3: making a list
by polettix (Vicar) on May 29, 2005 at 23:16 UTC
    I like it dirt - instead of
    { local $" = "\n"; open my $fh, '>', "$ENV{HOME}/number_list.txt" or die $!; print $fh "@list\n"; }
    use
    my $prefix = "something"; { local $" = "\n$prefix"; open my $fh, '>', "$ENV{HOME}/number_list.txt" or die $!; print $fh "$prefix@list\n"; }
    Of course it's just to show you that you can put whatever separator inside $"; if you want a clean solution, use Zaxo's.

    Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

    Don't fool yourself.
Re^3: making a list
by Zaxo (Archbishop) on May 29, 2005 at 20:38 UTC

        print $fh "@{[ map { 'something' . $_ } @list ]}\n";

    Added: Or else you could decorate them beforehand: my @list = map { 'something' . $_ } $number1 .. $number2;

    After Compline,
    Zaxo