- or download this
#!/usr/bin/perl
print diff(shift)."\n";
...
return diff($1)."+".diff($2) if m/(.+?)\+(.+);
... # other differentiation rules here
}
- or download this
...
if (m/(.+?)\+(.+))
my $firstTerm = $1;
my $secondTerm = $2;
return diff($firstTerm)."+".diff($secondTerm);
- or download this
sub diff
{
my $_=shift; my $1; my $2;
...
}
- or download this
Can't use global $1 in "my"...
Execution ... aborted due to compilation errors.