rmexico has asked for the wisdom of the Perl Monks concerning the following question:
thanks in advance#!/usr/bin/perl undef $/; &doStuff(); &foo(); sub doStuff { # want to read the file as a single string.... open TMP, "<somefile.txt"; my @file = <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, "<otherfile.txt"; my @file = <TMP>; close TMP; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: switching default line terminator?
by rafl (Friar) on Mar 21, 2006 at 14:08 UTC | |
|
Re: switching default line terminator?
by CountOrlok (Friar) on Mar 21, 2006 at 16:07 UTC |