halfcountplus has asked for the wisdom of the Perl Monks concerning the following question:
Thanks Kyle for noticing my stupidity#!/usr/bin/perl use warnings; use strict; while (<DATA>) { my @line = split / /; #nb. "split $_" returns many uninti +alized values my $bit = shift @line; # "split" returns the a variatio +n of that, print "|$bit| @line"; # but with no newlines } # "split / /,$_" predictably ret +urns the same # as "split / /" __DATA__ holli: s/drowning/draining/ moritz steps out of the way, and watches a nice hole in the wall moritz: time for a counter attack... moritz takes his +5 Samurai Sword of Perl Monk Decapitation... moritz: ... and throws a 1. Damned, I missded holli writes a Perl 6 module to automate aiming moritz: s/missded/missed/ holli laughs at [moritz], then slips over a globular dice moritz throws a discontinued perl 6 compiler at [holli] holli smiles as he sees hist watcher elemental tearing the compiler ap +art moritz: why do I have to lose all the time? holli: <c>try{ harder(); }</c> ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: about split
by kyle (Abbot) on Mar 12, 2008 at 15:42 UTC | |
by BrowserUk (Patriarch) on Mar 12, 2008 at 16:22 UTC | |
by Not_a_Number (Prior) on Mar 12, 2008 at 16:21 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |