Is it possible to rewrite this perl subroutine without using variables?
sub XMLEncode {
my ($line) = @_;
$line =~ s//amp;/g;
$line =~ s//lt;/g;
$line =~ s//gt;/g;
return $line;
}
I was thinking something like
sub XMLEncode {
s//amp;/g;
s//lt;/g;
s//gt;/g;
On Sun, Apr 29, 2001 at 04:34:40AM -0400, Philip Mak wrote:
I was thinking something like
sub XMLEncode {
local $_ = shift;
s//amp;/g;
s//lt;/g;
s//gt;/g;
return $_;
}
--
Honza
On Sun, 29 Apr 2001, Philip Mak wrote:
Is it possible to rewrite this perl subroutine without using variables?
sub XMLEncode {
my ($line) = @_;
$line =~ s//amp;/g;
$line =~ s//lt;/g;
$line =~ s//gt;/g;
return $line;
}
I was thinking something like
sub XMLEncode {