Re: data manipulation
From: Tad McClellan (tadmc_at_augustmail.com)
Date: 10/10/03
- Next message: Peter Hickman: "Re: tree drawing toolkit"
- Previous message: Anno Siegel: "Re: strip text up to a keyword?"
- In reply to: Bob: "Re: data manipulation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 9 Oct 2003 23:25:51 -0500
Bob <bNOoONb@not.pilbara.net.au> wrote:
> "Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
> news:bm3848$i2lpa$1@ID-184292.news.uni-berlin.de...
[ Snip a whole bunch of lines not needed for context. ]
> there are only 2 lines I don't clearly
> understand
>
> -> push @chunks, $chunk if $chunk;
Or, if you like/understand it better written this way:
if ( $chunk ) {
push @chunks, $chunk;
}
> -> $chunk = '';
>
> After reading the push function description from "learning Perl" I am
> failing to understand exactly what is happening here.
if $chunk is a true value, then the value of $chunk gets tacked onto
the end of the @chunks array (ie. @chunks gets one element larger).
The second line clears out the accumulator for the next go-round.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
- Next message: Peter Hickman: "Re: tree drawing toolkit"
- Previous message: Anno Siegel: "Re: strip text up to a keyword?"
- In reply to: Bob: "Re: data manipulation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|