#!/usr/bin/perl print "RS is:<$/>\n"; # typing 'x \$/' in debugger gives this (as expected) #0 SCALAR(0x10141238) # -> ' #' changeRS(); sub changeRS { local $/; print "RS is:<$/>\n"; # typing 'x \$/' in debugger gives this (*NOT* as expected) #0 SCALAR(0x103b8f68) # -> ' #' } print "RS is:<$/>\n"; # typing 'x \$/' in debugger gives this as expected #0 SCALAR(0x10141238) # -> ' #'