Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Re: Assigning text sections to scalars

by hdp (Beadle)
on Apr 25, 2001 at 18:13 UTC ( [id://75461] : note . print w/replies, xml ) Need Help??


in reply to Re: Re: Assigning text sections to scalars
in thread Assigning text sections to scalars

The undef is not necessary, as per split's documentation:

When assigning to a list, if LIMIT is omitted, Perl supplies a LIMIT one larger than the number of variables in the list, to avoid unnecessary work.

Essentially, this means that all the extra text you're worried about gets assigned to that nonexistent fourth variable in the list on the left hand side.

Good thinking, but Perl beat you to it.

hdp.

  • Comment on Re: Re: Re: Assigning text sections to scalars