Hi Rob ,
Sorry my mistake didn't see that.
Thanxs
if ($found eq $search) {
#!/usr/bin/perl
> use strict;
> use warnings;
>
> my @arr=qw(fry ring apple law);
> print "Enter the string you are searching for:";
> chomp(my $search=); # you may have to check, if input is not string
>
I don't u
On 11-08-22 09:19 AM, Uri Guttman wrote:
the comment was still off as he seems to
imply data that isn't a string. eof isn't data.
It's meta-data. :)
--
Just my 0.0002 million dollars worth,
Shawn
Confusion is the first step of understanding.
Programming is as much about organization
> "SHC" == Shawn H Corey writes:
SHC> On 11-08-22 08:23 AM, Uri Guttman wrote:
>> it can only be a string as it comes from stdin. what else do you think
>> it could be?
SHC> 1. The empty string (not really a string)
it is a string that also called the null string. and it is hard to
On 11-08-22 08:23 AM, Uri Guttman wrote:
it can only be a string as it comes from stdin. what else do you think
it could be?
1. The empty string (not really a string)
2. eof( *STDIN );
--
Just my 0.0002 million dollars worth,
Shawn
Confusion is the first step of understanding.
Prog
> "ta" == timothy adigun <2teezp...@gmail.com> writes:
ta> Hi Rob,
ta> my @arr=qw(fry ring apple law);
ta> print "Enter the string you are searching for:";
ta> chomp(my $search=); # you may have to check, if input is not string
>>> I don't understand your comment. The input from std
On 11-08-22 02:25 AM, anant mittal wrote:
Hi!
I want to search whether a scalar '$a' contains any one of value of an array
'@arr'.
How it may be done?
as its not correct : print "found" if $a =~ /@arr/;
First of all, don't use $a or $b as a variable name. `sort` uses them
and although `perl`
Hi Rob,
my @arr=qw(fry ring apple law);
print "Enter the string you are searching for:";
chomp(my $search=); # you may have to check, if input is not string
>>I don't understand your comment. The input from stdin has to be a
>>string - it cannot be anything else.
the input from stdin could be
Hi Rob,
my @arr=qw(fry ring apple law);
print "Enter the string you are searching for:";
chomp(my $search=); # you may have to check, if input is not string
>>I don't understand your comment. The input from stdin has to be a
>>string - it cannot be anything else.
the input from stdin could be a
On 22/08/2011 12:03, AKINLEYE wrote:
Hi anant
On Mon, Aug 22, 2011 at 8:42 AM, timothy adigun<2teezp...@gmail.com> wrote:
Hi Anant,
I want to search whether a scalar '$a' contains any one of value of an
array
'@arr'.
How it may be done?
as its not correct : print "found" if $a =~ /@arr/;
On 22/08/2011 08:42, timothy adigun wrote:
Hi Anant,
I want to search whether a scalar '$a' contains any one of value of an
array
'@arr'.
How it may be done?
as its not correct : print "found" if $a =~ /@arr/;
#!/usr/bin/perl
use strict;
use warnings;
my @arr=qw(fry ring apple law);
pr
Hi anant
On Mon, Aug 22, 2011 at 8:42 AM, timothy adigun <2teezp...@gmail.com> wrote:
> Hi Anant,
>
> >>I want to search whether a scalar '$a' contains any one of value of an
> array
> >>'@arr'.
> >>How it may be done?
> >>as its not correct : print "found" if $a =~ /@arr/;
>
> #!/usr/bin/perl
>
Hi Anant,
>>I want to search whether a scalar '$a' contains any one of value of an
array
>>'@arr'.
>>How it may be done?
>>as its not correct : print "found" if $a =~ /@arr/;
#!/usr/bin/perl
use strict;
use warnings;
my @arr=qw(fry ring apple law);
print "Enter the string you are searching for
Hello Anant,
Please read:
perldoc -q 'certain element is contained in a list or array'
or
http://bit.ly/o9uKat
Regards,
Alan Haggai Alavi.
--
The difference makes the difference.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.o
Hello Anant,
> I want to search whether a scalar '$a' contains any one of value of an
> array '@arr'.
> How it may be done?
If you are using perl v5.010 or later, you can use the smart match operator
(~~):
use 5.010;
use strict;
use warnings;
my @array = qw( foo bar quux );
my $item = 'bar';
14 matches
Mail list logo