meanroy has asked for the wisdom of the Perl Monks concerning the following question:
The output looks like this:use warnings; use strict; my @MatchFoundArray = ""; my $WikiHistory ="* [Any garbled crap2345n&%]i"; print "WikiHistory contains:$WikiHistory\n"; # sanity check @MatchFoundArray = split(m/(\* \[)/, $WikiHistory ); my $indexnum = 0; foreach my $MatchFoundArray (@MatchFoundArray) { print "Item", $indexnum++," is $MatchFoundArray\n"; }
So where the heck did Item0 come from????WikiHistory contains:* [Any garbled crap2345n&%]i Item0 is Item1 is * [ Item2 is Any garbled crap2345n&%]i
2006-08-11 Retitled by planetscape, as per Monastery guidelines
Original title: 'I'm splitting a scaler and putting the results in an array. Why is the first element empty?'
|
|---|