# in-memory files 21. open(my $memory, ">", \$var) 22. or die "Can't open memory file: $!"; 23. print $memory "foo!\n"; # output will appear in $var #### #!/usr/bin/perl use strict; use warnings; my $file = 'here are some words I want '; open my $fh, '<', \$file; chomp(my @words = <$fh>); my $pattern = join "|", @words; print $pattern;