Re: Help: Process data



Amy Lee wrote:

I have a little problem, could you tell me why do you use such block?

my(undef, $this) = split;

The above will split (on whitespace, by default), with the $this
variable being assigned the value of 0 or 1 -- given your example (the
second field in the line, is either 1 or 0, and since the conditional
isn't checking or caring what the first field is, the first field is
just undefined and not assigned anything).

if ( $this == $value )

If the value of $this is equal to (==) $value (whatever $value you set
to), then it will...

{ push @buffer, $_ }

Push (add) $_ (the string value for that line) to the @buffer array.

--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
.



Relevant Pages

  • Re: Arrays instead of files into hashes
    ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ... terminology extraction for linguistic purposes. ... little script and the output is an array which I can display in a file ...
    (comp.lang.perl.misc)
  • Re: Need help on AoH or array or any other think that might help!
    ... of foreach), but it will run. ... understand the issue now that you've seen the code this was in response ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)
  • Re: Newbie php problem
    ... Please forget the first part of the script, as I do put some extra ... accepting input, ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (alt.php)
  • Re: Favorite object-oriented modules?
    ... Programming in Perl? ... developing with other people that do go crazy and not CPAN modules. ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)
  • Re: Date/Time module
    ... possible the calculations don't lend themselves to a super efficient ... but I'm betting they do. ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)