in reply to Re: putting text into array word by word
in thread putting text into array word by word
Here is my full code:
#! /usr/bin/perl -w use strict; my $i = 0; my $element; my @words; my @all_words open FILE, "<", "input.txt" or die $!; print "file loaded \n"; while (<FILE>) { # the words from *this* line @words = split('', $_); push @all_words, @words; } print "table loaded \n"; foreach $element (@words) { print "$element"; }
the "file loaded" and "table loaded" messages appear, however the elements are not printed afterwards
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: putting text into array word by word
by Eliya (Vicar) on Jan 09, 2012 at 18:44 UTC | |
Re^3: putting text into array word by word
by roboticus (Chancellor) on Jan 09, 2012 at 18:35 UTC |
In Section
Seekers of Perl Wisdom