in reply to Re^3: Using imported .txt file with Algorithms::Combinatorics
in thread Using imported .txt file with Algorithms::Combinatorics

Thank you for the help! That has clarified some things for me.

#!/usr/bin/env perl open (my $data, "<", "test.txt") or die "There was a problem opening: +$!"; my @primers = <$data>; close $data; chomp @primers; use strict; use warnings; use Algorithm::Combinatorics qw(combinations); my $strings = \@primers; my $iter = combinations($strings, 2); while (my $c = $iter->next) { print "@$c\n"; }

I'm now running this and it mostly does what I intended it to do. My output ends up putting an unwanted space in-between the 2 words that were combined. Is this because i'm stringifying?

Replies are listed 'Best First'.
Re^5: Using imported .txt file with Algorithms::Combinatorics
by tangent (Parson) on Jan 08, 2014 at 13:16 UTC
    an unwanted space in-between the 2 words that were combined
    Replace the print statement with something like:
    print join('',@$c) ."\n";
      Or, golfed,
      print @$c, "\n";
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

        Thanks!