in reply to Re: Amusing note on my own stupidity (longish)
in thread Amusing note on my own stupidity (longish)
There's even Scalar::Readonly that allows you to modify readonly variables :)
#!/usr/bin/perl use Scalar::Readonly 'readonly_off'; sub trim { for (@_) { readonly_off($_); s/^\s+//; s/\s+$//; } } for (' foo ', ' bar ') { trim($_); print ">>$_<<\n"; } __END__ >>foo<< >>bar<<
|
|---|