Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
BTW, the deliminator can be any single char if that makes any difference.#!/usr/bin/perl -w $delim = "."; $line = "testing.someting.with.fields"; foreach $field (split(/$delim/, $line)) { print "$field\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Split - what am i doing wrong?
by McDarren (Abbot) on May 04, 2009 at 01:32 UTC | |
|
Re: Split - what am i doing wrong?
by roubi (Hermit) on May 04, 2009 at 01:38 UTC | |
|
Re: Split - what am i doing wrong?
by otto (Beadle) on May 04, 2009 at 01:48 UTC |