M
Mike Flannigan
I can't believe I can't figure this out, but I could use some
help here. I have so many questions about this script,
but I'm going to limit myself to only 3 with this post.
1) The script runs as written, but gives an error after running
"Use of uninitialized value in transliteration (tr///) . . . at line 12,
<DATA> line 3." Then there are more errors about
concatenation at line 13 and 16.
Can anybody explain these errors for me. I can't figure it out.
I thought I was smart, but Perl is proving me wrong.
2) Why won't this script run is I remove the space between the
<DATA> and the line with "Gur ebbgf bs gur snyyra gerr ner
evtug orfvqr gur genvy naq gur gerr unf snyyra gb gur evtug.
Whfg sbyybj gur gerr."? I have only one new line after the
data line. I have tried with and without a new line (carriage
return) at the end.
3) Why won't this script process the whole thing if I put a
newline in the middle like so:
Gur ebbgf bs gur snyyra gerr ner evtug orfvqr
gur genvy naq gur gerr unf snyyra gb gur evtug. Whfg sbyybj gur gerr.
I'm guessing these are somewhat related.
__________________________________
use strict;
use warnings;
my $ki;
my @kites;
while (<DATA>) {
$ki = <DATA>;
push @kites, $ki;
}
foreach my $num (@kites) {
$num =~ tr/a-zA-Z\. /n-za-mN-ZA-M\. /;
print "$num\n";
}
print "$kites[0]\n$kites[1]\n";
__DATA__
Gur ebbgf bs gur snyyra gerr ner evtug orfvqr gur genvy naq gur gerr unf
snyyra gb gur evtug. Whfg sbyybj gur gerr.
help here. I have so many questions about this script,
but I'm going to limit myself to only 3 with this post.
1) The script runs as written, but gives an error after running
"Use of uninitialized value in transliteration (tr///) . . . at line 12,
<DATA> line 3." Then there are more errors about
concatenation at line 13 and 16.
Can anybody explain these errors for me. I can't figure it out.
I thought I was smart, but Perl is proving me wrong.
2) Why won't this script run is I remove the space between the
<DATA> and the line with "Gur ebbgf bs gur snyyra gerr ner
evtug orfvqr gur genvy naq gur gerr unf snyyra gb gur evtug.
Whfg sbyybj gur gerr."? I have only one new line after the
data line. I have tried with and without a new line (carriage
return) at the end.
3) Why won't this script process the whole thing if I put a
newline in the middle like so:
Gur ebbgf bs gur snyyra gerr ner evtug orfvqr
gur genvy naq gur gerr unf snyyra gb gur evtug. Whfg sbyybj gur gerr.
I'm guessing these are somewhat related.
__________________________________
use strict;
use warnings;
my $ki;
my @kites;
while (<DATA>) {
$ki = <DATA>;
push @kites, $ki;
}
foreach my $num (@kites) {
$num =~ tr/a-zA-Z\. /n-za-mN-ZA-M\. /;
print "$num\n";
}
print "$kites[0]\n$kites[1]\n";
__DATA__
Gur ebbgf bs gur snyyra gerr ner evtug orfvqr gur genvy naq gur gerr unf
snyyra gb gur evtug. Whfg sbyybj gur gerr.