Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
monks,
i was wondering if any of you could tell me why a while loop over the default filehandle with $/ set to undef when using inplace editing runs twice instead of once. for example:
prints only once as expected, butopen(X,"< test"); undef $/; while(<X>) { print "hello" }
prints twice regardless of how many lines in 'test' thanks$ARGV[0]="test"; $^I=""; undef $/; while(<>) { print "hello" }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: inplace file editing
by ZZamboni (Curate) on Jun 11, 2001 at 05:38 UTC | |
by Anonymous Monk on Jun 11, 2001 at 11:40 UTC | |
Re: inplace file editing
by Abigail (Deacon) on Jun 11, 2001 at 11:51 UTC | |
Re: inplace file editing
by mattr (Curate) on Jun 11, 2001 at 17:58 UTC | |
Re: inplace file editing
by Anonymous Monk on Jun 11, 2001 at 20:41 UTC | |
Re: inplace file editing
by Anonymous Monk on Jun 11, 2001 at 21:00 UTC | |
Re: inplace file editing
by mattr (Curate) on Jun 12, 2001 at 10:51 UTC |
Back to
Seekers of Perl Wisdom