Re: [Perl-unix-users] How to compare variable in the same file

2003-03-11 Thread Andy_Bach
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 >

[Perl-unix-users] How to compare variable in the same file

2003-03-11 Thread Ing. Ricardo Cumberbatch L. \(PANNet - URC\)
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

[Perl-unix-users] Variants

2003-03-11 Thread RonaldMU
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

AW: [Perl-unix-users] deleting "invisible" characters

2003-03-11 Thread EXTERN Chakirov Timour \(TZ CIS; DS/ESQ3\)
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 (

AW: [Perl-unix-users] "in" operator?

2003-03-11 Thread EXTERN Chakirov Timour \(TZ CIS; DS/ESQ3\)
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

RE: [Perl-unix-users] "in" operator?

2003-03-11 Thread Thomas, Mark-BLS CTR
> 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. __

RE: [Perl-unix-users] "in" operator?

2003-03-11 Thread Peter Eisengrein
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

RE: [Perl-unix-users] "in" operator?

2003-03-11 Thread Thomas, Mark-BLS CTR
> 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',

RE: [Perl-unix-users] deleting "invisible" characters

2003-03-11 Thread Matt Schneider
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

Re: [Perl-unix-users] "in" operator?

2003-03-11 Thread Simon Oliver
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', '

Re: [Perl-unix-users] "in" operator?

2003-03-11 Thread Simon Oliver
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

[Perl-unix-users] deleting "invisible" characters

2003-03-11 Thread Tassos123
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"

[Perl-unix-users] "in" operator?

2003-03-11 Thread EXTERN Chakirov Timour \(TZ CIS; DS/ESQ3\)
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