#!/usr/bin/perl use strict; use warnings; my $string = 'perl monks'; my $space = qr/\s/; for (0 .. (length $string) - 2) { my $match = substr($string,$_,2); next if ($match =~ $space); print "$match\n"; }
In reply to Re: Splitting a string
by kwaping
in thread Splitting a string
by lampros21_7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |