On Sat, Mar 7, 2009 at 13:44, Octavian Râşniţă wrote:
> From: "Rick"
>>
>> my ($data) = $test_s =~ /(\[(.+)\]/;
>
> I think it contains a "(" that shouldn't be there (after =~ /).
>
>>> The code above assumes you want what is between the first and last
>>> brackets in $test_s. If the string c
From: "Rick"
my ($data) = $test_s =~ /(\[(.+)\]/;
I think it contains a "(" that shouldn't be there (after =~ /).
The code above assumes you want what is between the first and last
brackets in $test_s. If the string contains more than one set of
brackets you may want to say this instead
Chas. Owens wrote:
On Sat, Mar 7, 2009 at 11:53, Rick wrote:
__test-code__
use warnings;
use strict;
my $test_s = 'hi [how are you]';
my $data;
if ( $test_s =~ m/\[.+\]/ ) {
$data = $1;
}
__END__
is there easier way to do this
I was hoping something like this would work
$data = ($test_
On Sat, Mar 7, 2009 at 11:53, Rick wrote:
> __test-code__
> use warnings;
> use strict;
> my $test_s = 'hi [how are you]';
>
> my $data;
> if ( $test_s =~ m/\[.+\]/ ) {
> $data = $1;
> }
> __END__
>
> is there easier way to do this
> I was hoping something like this would work
>
> $data = ($tes
__test-code__
use warnings;
use strict;
my $test_s = 'hi [how are you]';
my $data;
if ( $test_s =~ m/\[.+\]/ ) {
$data = $1;
}
__END__
is there easier way to do this
I was hoping something like this would work
$data = ($test_s =~ m/\[.+\]/); but does not work.. I tried @data too
but stil