J
John
Hi all,
I have to split a test but I don't know how to do it.
If I have:
#!/usr/local/bin/perl -w
use strict;
my $arr = "nothing to compa-re";
my $block = [split /\W+/, $arr];
foreach (@$block){
print "$_\n";
}
will produce:
nothing
to
compa
re
but I have to consider - as part of the word.
the result I would like to obtain is:
nothing
to
compa-re
any idea?
Thanks for your help.
J
I have to split a test but I don't know how to do it.
If I have:
#!/usr/local/bin/perl -w
use strict;
my $arr = "nothing to compa-re";
my $block = [split /\W+/, $arr];
foreach (@$block){
print "$_\n";
}
will produce:
nothing
to
compa
re
but I have to consider - as part of the word.
the result I would like to obtain is:
nothing
to
compa-re
any idea?
Thanks for your help.
J