Re: while and last
- From: krahnj@xxxxxxxxx (John W. Krahn)
- Date: Tue, 15 Jan 2008 11:38:40 -0800
Kevin Viel wrote:
Hello,
Hello,
If I only want the data on the first line of a file, can I use "last" to
exit the loop or should I consider another tool?
Don't use a loop at all:
my $data = <FILE>; # Grap one line from file
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
.
- Follow-Ups:
- RE: while and last
- From: Kevin Viel
- RE: while and last
- References:
- while and last
- From: Kevin Viel
- while and last
- Prev by Date: Re: Adding a hash to an existing hash?
- Next by Date: Monitor a directory for file creation
- Previous by thread: while and last
- Next by thread: RE: while and last
- Index(es):
Relevant Pages
|