open (LECTOR1, "$datainfo/students_creados") || die "ERROR: NO Encuentro
el archivo 'students_creados'\n";
while () { #PRIMER WHILE
chomp;
@linea = split;
$login = $linea[7];
if ($name[0] =~ /$login/i){
$count1 += 1;
if ($count1 >
Hi,
I make a script to compare some variable in the same file but it not
working could some one help please. This is the script:
my $datainfo = '/gupl/GenerarUser';
$count = 0;
$count1 = 0;
#$countline = 0;
#$linejump = 8;
open (LECTOR, "$datainfo/students_creados") || die "ERROR: NO Encuentro e
Good Day To ya all
I wrote a perl script to read data thru a serial port. when I send data to
the serial port it works, problem is that when I receive data from the
serial port it sometimes contains null's in-between the actual data. This is
causing the variant to stop reading data when it hits th
You could also use translate operator:
tr/a-zA-Z/ /cs; # change non-alphas to single space
See perlop for more details.
HIH,
Tim
(EXTERN) CHAKIROV, Timour (TZ CIS / DS ESQ3)
Robert Bosch GmbH Tel: +49 (
Hello guys,
thanks for your ideas and friendly support. After evaluating all pros and
cons I selected (don't panic!) full enumeration of possibilities' method
(i.e. with "for" loop).
Why?
The task is to check if some attributes has appropriate values. All possible
values are known, and have to f
> Use grep:
>
> @colors = ('red', 'yellow', 'green');
> $var = 'green';
> print "yep" if grep /$var/, @colors;
On second thought, this answer is not ideal in your simple case. This checks
every element and is really oriented toward regexes.
The hash method is probably your best bet.
- Mark.
__
perldoc -q contains
-Original Message-
From: EXTERN Chakirov Timour (TZ CIS; DS/ESQ3)
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 11, 2003 10:38 AM
To: '[EMAIL PROTECTED]'
Subject: [Perl-unix-users] "in" operator?
Hello,
I know it's a dummy question, however I could not find a quick
> So my question: is any form of "logical-IN" operator in perl?
> I.e. I have a scalar $var and a list @colors = ['red',
> 'yellow', 'green']. All I want is to check
>
> if ($var in @color) {
> traffic_lite($var)
> }
>
> How could I realise this code in perl?
Use grep:
@colors = ('red',
Tassos,
I'm
not sure how to view or convert the "invisible" characters. You might try
something like this to remove them. This will find anything that is not an
alpha, _, numeric, or legitimate white space and replace it with nothing in
$string. The caveat here is that it will also remo
Simon Oliver wrote:
EXTERN Chakirov Timour (TZ CIS; DS/ESQ3) wrote:
Hello,
I know it's a dummy question, however I could not find a quick answer in
perl documentation.
So my question: is any form of "logical-IN" operator in perl? I.e. I
have a
scalar $var and a list @colors = ['red', 'yellow', '
EXTERN Chakirov Timour (TZ CIS; DS/ESQ3) wrote:
Hello,
I know it's a dummy question, however I could not find a quick answer in
perl documentation.
So my question: is any form of "logical-IN" operator in perl? I.e. I have a
scalar $var and a list @colors = ['red', 'yellow', 'green']. All I want
Hi all,
I have a file that contains some "invisible" characters. These characters
look like white spaces when I open the file in a text editor. Is there
a way I can make them visible so that I can manipulate them with a Perl
script? Is there a Perl function that allows me to delete any "invisible"
Hello,
I know it's a dummy question, however I could not find a quick answer in
perl documentation.
So my question: is any form of "logical-IN" operator in perl? I.e. I have a
scalar $var and a list @colors = ['red', 'yellow', 'green']. All I want is
to check
if ($var in @color) {
traff
13 matches
Mail list logo