#!/usr/bin/perl undef $/; &doStuff(); &foo(); sub doStuff { # want to read the file as a single string.... open TMP, "; close TMP; # do more stuff with that file... } sub foo { ## here i would want to read the file line-by-line $/ = '\n'; open TMP, "; close TMP; }