Re: Re : Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-21 Thread Rob Dixon
b$w\b/ and !/\buc($w)\b/ ) { print "Keyword '$w' not uppercase line $.\n"; ajoute_erreur( 7, $. ); last; } } It's probably less fast than other ones, but it seems to work. I'm afraid you may need to imp

Re: Re : Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-21 Thread Paul Johnson
all your sentence. > >> > >> Here's my solution (for now) : > >> > >> for my $w (@keywords) > >> { > >> if ( /\b$w\b/ and !/\buc($w)\b/ ) > >> { > >> print "Keyword '$w' no

RE: Re : Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-21 Thread Bob McConnell
(@keywords) >> { >> if ( /\b$w\b/ and !/\buc($w)\b/ ) >> { >> print "Keyword '$w' not uppercase line $.\n"; >> ajoute_erreur( 7, $. ); >> last; >> } >> } &g

Re: Re : Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-21 Thread Paul Johnson
if ( /\b$w\b/ and !/\buc($w)\b/ ) > { > print "Keyword '$w' not uppercase line $.\n"; > ajoute_erreur( 7, $. ); > last; > } > } > > It's probably less fast than other ones, but it seems to work. I'm afraid you

Re : Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-21 Thread Beware
Hi to all, First of all, sorry for the late of my answer. Thank for all your sentence. Here's my solution (for now) : for my $w (@keywords) { if ( /\b$w\b/ and !/\buc($w)\b/ ) { print "Keyword '$w' not uppercase line $.\n";

Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-17 Thread Brandon McCaig
On Wed, Jun 15, 2011 at 12:09 PM, Jim Gibson wrote: > '$w eq $w' is always true. It certainly is more sane when that holds true, but to have a little fun there is overload. ;D use strict; use warnings; use overload '==' => sub { return 0; }; my $foo = bless {}; print $foo == $foo; __END__

Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-15 Thread Rob Dixon
On 15/06/2011 17:09, Jim Gibson wrote: On 6/15/11 Wed Jun 15, 2011 8:20 AM, "Rob Dixon" scribbled: I am afraid that will not work. $w is extracted from the input line and may contain lower-case letters. You must compare $w to uc $w to see if it contains any lower-case letters. '$w eq $w' is

Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-15 Thread Jim Gibson
: >>>>> Hi >>>>> >>>>> Sorry, i've been tired these past days. >>>>> >>>>> So, this is what i want to do : >>>>> >>>>> I've source code files in VHDL. I want to check that all specif

Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-15 Thread Rob Dixon
in VHDL. I want to check that all specific keywords of this language are in uppercase. In fact, in my current script i read this file line per line and check others rules. Am i clear, now? Here is some code that does this. I suggest you make sure you understand what it does and check that it

Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-15 Thread Jim Gibson
keywords of this language are in uppercase. In fact, in my current script i read this file line per line and check others rules. Am i clear, now? Here is some code that does this. I suggest you make sure you understand what it does and check that it is correct. Call it by passing th

Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-15 Thread John W. Krahn
Rob Dixon wrote: On 15/06/2011 12:10, Paul Johnson wrote: #!/usr/bin/perl use strict; use warnings; my @keywords = qw ( abs access after alias all and architecture array assert attribute begin block body buffer bus case component configuration constant disconnect downto else elsif end entity

Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-15 Thread Rob Dixon
On 15/06/2011 12:10, Paul Johnson wrote: On Tue, Jun 14, 2011 at 11:56:04PM -0700, Beware wrote: Hi Sorry, i've been tired these past days. So, this is what i want to do : I've source code files in VHDL. I want to check that all specific keywords of this language are in uppercase

Re: Re : Re: Re : Re: Check if words are in uppercase?

2011-06-15 Thread Paul Johnson
On Tue, Jun 14, 2011 at 11:56:04PM -0700, Beware wrote: > Hi > > Sorry, i've been tired these past days. > > So, this is what i want to do : > > I've source code files in VHDL. I want to check that all specific keywords of > this language are in uppercase. &g

Re : Re: Re : Re: Check if words are in uppercase?

2011-06-14 Thread Beware
Hi Sorry, i've been tired these past days. So, this is what i want to do : I've source code files in VHDL. I want to check that all specific keywords of this language are in uppercase. In fact, in my current script i read this file line per line and check others rules. Am i

Re: Re : Re: Check if words are in uppercase?

2011-06-14 Thread Jim Gibson
On 6/14/11 Tue Jun 14, 2011 7:47 AM, "Beware" scribbled: > Hi and thank you for your answer. > > But how can i use it with a list of word. > Use what? You need to put a little context in your messages so people can help you without seeing previous messages. If you have a list of words in a

Re : Re: Check if words are in uppercase?

2011-06-14 Thread Beware
Hi and thank you for your answer. But how can i use it with a list of word. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Check if words are in uppercase?

2011-06-14 Thread Jim Gibson
At 12:30 AM -0700 6/14/11, Beware wrote: @John : Thank you for your advices. @Rob Dixon : Your script works fine, but i want to add a little more thing. In fact, i want to detect if a word is in line (of course) and if it's not in uppercase. I mean, for example, i want to detect : aLL aL

Re: Check if words are in uppercase?

2011-06-14 Thread Beware
@John : Thank you for your advices. @Rob Dixon : Your script works fine, but i want to add a little more thing. In fact, i want to detect if a word is in line (of course) and if it's not in uppercase. I mean, for example, i want to detect : aLL aLl All etc.. but not ALL (which is correct f

Re: Check if words are in uppercase?

2011-06-13 Thread Mathieu Hedard
cript. In my script i read a file line per line, and check if keywords are in uppercase. To do that, i've an array filled with all used keywords. On each line, i check all keywords with a foreach loop. Well, this is my code : my $lines = 0; while ( ) { # cut '\n' chom

Re: Check if words are in uppercase?

2011-06-10 Thread Rob Dixon
On 09/06/2011 08:59, Beware wrote: Hi all, i've a question on my perl script. In my script i read a file line per line, and check if keywords are in uppercase. To do that, i've an array filled with all used keywords. On each line, i check all keywords with a foreach loop. Well,

Re: Check if words are in uppercase?

2011-06-10 Thread John W. Krahn
Beware wrote: Hi all, Hello, i've a question on my perl script. In my script i read a file line per line, and check if keywords are in uppercase. To do that, i've an array filled with all used keywords. On each line, i check all keywords with a foreach loop. Well, this is my c

Re: Check if words are in uppercase?

2011-06-10 Thread Rob Coops
On Thu, Jun 9, 2011 at 9:59 AM, Beware wrote: > Hi all, > > i've a question on my perl script. > > In my script i read a file line per line, and check if keywords are in > uppercase. To do that, i've an array filled with all used keywords. > > On each line, i

Check if words are in uppercase?

2011-06-10 Thread Beware
Hi all, i've a question on my perl script. In my script i read a file line per line, and check if keywords are in uppercase. To do that, i've an array filled with all used keywords. On each line, i check all keywords with a foreach loop. Well, this is my code : my $lines =

Re: convert string from lowercase to uppercase

2005-12-12 Thread John Doe
Buehler, Bob am Montag, 12. Dezember 2005 22.18: > Also: > > $name =~ tr/a-z/A-Z/; > > (the string is in $name variable) Ok, but this won't match words in my language (and others) or words containing unicode. :-) > -Original Message- > From: John Doe [mailto:[EMAIL PROTECTED] [...] > J

RE: convert string from lowercase to uppercase

2005-12-12 Thread Buehler, Bob
Also: $name =~ tr/a-z/A-Z/; (the string is in $name variable) -Original Message- From: John Doe [mailto:[EMAIL PROTECTED] Sent: Monday, December 12, 2005 3:02 PM To: beginners@perl.org Subject: Re: convert string from lowercase to uppercase Jenny Chen am Montag, 12. Dezember 2005

Re: convert string from lowercase to uppercase

2005-12-12 Thread Chris Devers
-f tr Did you try the uc() uppercase command ? perldoc -f uc uc() is probably the one you want, but the others offer more flexibility and can be preferable in certain contexts. -- Chris Devers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: convert string from lowercase to uppercase

2005-12-12 Thread John Doe
Jenny Chen am Montag, 12. Dezember 2005 21.49: > Hi All, Hi > Does anyone know how to convert a string in lower case > to upper case in Perl? Thanks. yes, perldoc -f uc does. hth, joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

convert string from lowercase to uppercase

2005-12-12 Thread Jenny Chen
Hi All, Does anyone know how to convert a string in lower case to upper case in Perl? Thanks. Jenny -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: converting the elements of a hash to uppercase

2004-11-13 Thread Randy W. Sims
John W. Krahn wrote: Octavian Rasnita wrote: Hi all, Hello, Please tell me how to convert the elements of a hash to uppercase, if I can access that hash only by reference. For example, I have something like: my $ref = { 'a' => 'aaa', 'b' => 'bbb', &

Re: converting the elements of a hash to uppercase

2004-11-13 Thread John W. Krahn
Octavian Rasnita wrote: Hi all, Hello, Please tell me how to convert the elements of a hash to uppercase, if I can access that hash only by reference. For example, I have something like: my $ref = { 'a' => 'aaa', 'b' => 'bbb', 'c' => 

Re: converting the elements of a hash to uppercase

2004-11-12 Thread Eric Walker
Can't you do the upper case thing when you first create it? On Friday 12 November 2004 03:07 pm, Randy W. Sims wrote: > Octavian Rasnita wrote: > > Hi all, > > > > Please tell me how to convert the elements of a hash to uppercase, if I > > can access that has

Re: converting the elements of a hash to uppercase

2004-11-12 Thread Randy W. Sims
Octavian Rasnita wrote: Hi all, Please tell me how to convert the elements of a hash to uppercase, if I can access that hash only by reference. For example, I have something like: my $ref = { 'a' => 'aaa', 'b' => 'bbb', 'c' => 'ccc&#x

Re: converting the elements of a hash to uppercase

2004-11-12 Thread David Kroeber
* Octavian Rasnita: > Please tell me how to convert the elements of a hash to uppercase, if I can > access that hash only by reference. $hash = { map { uc, $hash->{$_} } keys %{$hash} }; In a hash like ('key' => 'value', 'KEY' => 'VALUE')

converting the elements of a hash to uppercase

2004-11-12 Thread Octavian Rasnita
Hi all, Please tell me how to convert the elements of a hash to uppercase, if I can access that hash only by reference. For example, I have something like: my $ref = { 'a' => 'aaa', 'b' => 'bbb', 'c' => 'ccc' }; And I want

Re: Automatically write in uppercase

2004-03-03 Thread R. Joseph Newton
Taylor James wrote: > > Incidentally MS Word does this. If you try to type a sentence, say: > > pLEASE DON'T TURN OFF MY CAPS LOCK KEY, i WANT IT LIKE THIS. > > with the caps lock key on, it automatically turns off the caps lock key and > converts it to: > > Please don't...etc. > > It's really ann

RE: Automatically write in uppercase

2004-03-03 Thread Taylor James
James Edward Gray II wrote: > On Feb 29, 2004, at 6:30 AM, John wrote: > > > That's a nice method but i would prefer to activate the CAPS-LOCK > > and user write in capitals in my text entry widget > > I would prefer you didn't. ;) > > The keyboard takes commands from me, not the computer. If

Re: Automatically write in uppercase

2004-03-02 Thread zsdc
ntrolled by the user, who can turn it on or off whenever she wants. I have solved this by accepting lowercase input as uppercase, and in my case this works well as I am not using a text entry widget, but a Caps Lock solution might also be nice. Unfortunately, I don't think a cross platform

Re: Automatically write in uppercase

2004-03-02 Thread Paul Johnson
e to control Caps Lock. The program is used as part of a programme to help people with dyslexia improve their reading skills. In part this involves displaying text on the screen and having the student type it in. In the very early stages of the program the letters on the screen need to match those

Re: Automatically write in uppercase

2004-02-29 Thread zsdc
James Edward Gray II wrote: On Feb 29, 2004, at 6:30 AM, John wrote: That's a nice method but i would prefer to activate the CAPS-LOCK and user write in capitals in my text entry widget I would prefer you didn't. ;) The keyboard takes commands from me, not the computer. If a program started m

Re: Automatically write in uppercase

2004-02-29 Thread James Edward Gray II
On Feb 29, 2004, at 6:30 AM, John wrote: That's a nice method but i would prefer to activate the CAPS-LOCK and user write in capitals in my text entry widget I would prefer you didn't. ;) The keyboard takes commands from me, not the computer. If a program started monkeying with my control of

Re: Automatically write in uppercase

2004-02-29 Thread WilliamGunther
In a message dated 2/29/2004 7:31:49 AM Eastern Standard Time, [EMAIL PROTECTED] writes: >That's a nice method but i would prefer to activate the CAPS-LOCK and user >write in capitals in my text entry widget I can't think of how (or why) you'd want to do that. If you want them to type in caps,

Re: Automatically write in uppercase

2004-02-29 Thread John
ROTECTED]> Sent: Sunday, February 29, 2004 1:21 PM Subject: Re: Automatically write in uppercase > R. Joseph Newton wrote: > > > John wrote: > > > >>How can activate the caps lock while the user write in a perl programt (Perl/Tk) > > > > Why would you want to d

Re: Automatically write in uppercase

2004-02-29 Thread zsdc
locale; at the beginning of your program if your character set is not US-ASCII. You can update the text field with uppercase letters after user finishes typing, if you want it to be visible. -- ZSDC -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Re: Automatically write in uppercase

2004-02-28 Thread R. Joseph Newton
John wrote: > How can activate the caps lock while the user write in a perl programt (Perl/Tk) Why would you want to do that?!? Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Automatically write in uppercase

2004-02-28 Thread John
How can activate the caps lock while the user write in a perl programt (Perl/Tk)

Re: uppercase strings

2003-10-08 Thread simran
t; string is uppercased, then joined back together and > printed. > > Here is my code, can anyone help? Thanks, Sara G. > > !/usr/bin/perl > # Demonstrating split and join when prompting the user > for input and then changing the first letter of each > word in a sentence to up

Re: uppercase strings

2003-10-08 Thread Jeff 'japhy' Pinyan
t( / /, $firstline ); >print "$_\n" foreach ( @words ); What you need to do goes here. There are many ways to make the first character of a string in an array of strings uppercase. Here is one way: foreach (@words) { $_ = ucfirst } >$firstline = join( ' ', @words ); # j

uppercase strings

2003-10-08 Thread Sara Gribble
# Demonstrating split and join when prompting the user for input and then changing the first letter of each word in a sentence to uppercase. use strict; print "Please enter a sentence of your choice\n"; my $firstline = ; chomp ( $firstline ); my @words = split( / /, $firstline ); print &quo

RE: uppercase

2002-10-23 Thread Timothy Johnson
perldoc -f uc -Original Message- From: Javeed SAR [mailto:SAR.Javeed@;sisl.co.in] Sent: Wednesday, October 23, 2002 1:17 AM To: [EMAIL PROTECTED] Subject: uppercase Hi All, I have a script which accepts input from keyboard,here it is $label_tag, i want to convert it to upper case, if

uppercase

2002-10-23 Thread Javeed SAR
Hi All, I have a script which accepts input from keyboard,here it is $label_tag, i want to convert it to upper case, if the input from keyboard is given in lowercase, in my script? How to do that? print "\n\nENTER THE LABEL NAME:\n"; my $label_tag=<>; chomp$label_tag;

Re: UPPERCASE and DOING MULTIPLE THINGS

2002-07-22 Thread drieux
On Monday, July 22, 2002, at 08:11 , Bob H wrote: > I have a script that is *supposed* to search a file and make certain > words that I have in an array uppercase. My brain is not grokking it. > > Q1: What is wrong with my script (below)? what sorts of error messages

RE: UPPERCASE and DOING MULTIPLE THINGS

2002-07-22 Thread Nikola Janceski
See inline comments > -Original Message- > From: Bob H [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 22, 2002 11:12 AM > To: [EMAIL PROTECTED] > Subject: UPPERCASE and DOING MULTIPLE THINGS > > > I have a script that is *supposed* to search a file and make

Re: UPPERCASE and DOING MULTIPLE THINGS

2002-07-22 Thread Jeff 'japhy' Pinyan
On Jul 22, Bob H said: >I have a script that is *supposed* to search a file and make certain >words that I have in an array uppercase. My brain is not grokking it. You should not use tr/// to make strings uppercase. Perl provides the uc() function for that. >Q1: What is wrong with

UPPERCASE and DOING MULTIPLE THINGS

2002-07-22 Thread Bob H
I have a script that is *supposed* to search a file and make certain words that I have in an array uppercase. My brain is not grokking it. Q1: What is wrong with my script (below)? Q2: Can I update a file in place? Q3: How do I run multiple things against one file in one script? === SCRIPT

Re: converting hash keys to uppercase with regex

2002-06-18 Thread zentara
On Mon, 17 Jun 2002 16:55:08 -0700, [EMAIL PROTECTED] (Drieux) wrote: > >given that your code would generate >$vc{'TZ'} = 'ok';$vc{'UA'} = 'ok';$vc{'UG'} = 'ok';$vc{'UK'} = >'ok';$vc{'UM'} = 'ok'; >$vc{'US'} = 'ok';$vc{'UY'} = 'ok';$vc{'UZ'} = 'ok';$vc{'VA'} = >'ok';$vc{'VC'} = 'ok'; >$vc{'VE'}

Re: Is there any function for converting uppercase characters tolowercase chars ?

2001-08-10 Thread Brett W. McCoy
> Is there any function for converting uppercase characters to lowercase > chars ? Of course! perldoc -f uc perldoc -f lc perldoc -q capital -- Brett http://www.chapelperilous.net

RE: Is there any function for converting uppercase characters to lowercase chars ?

2001-08-10 Thread Chris Rogers
Try: print "\L$variable"; This will print the entire string in lowercase. print "\U$variable"; This will print the entire string in uppercase. -Original Message- From: Rahul Garg [mailto:[EMAIL PROTECTED]] Sent: Friday, August 10, 2001 10:20 AM To: [EMAIL PR

Re: Is there any function for converting uppercase characters tolowercase chars ?

2001-08-10 Thread Jeff 'japhy/Marillion' Pinyan
On Aug 10, Rahul Garg said: >Is there any function for converting uppercase characters to lowercase >chars ? The lc() function. It returns a lowercased version of the string you pass it. Please read 'perldoc -f lc'. -- Jeff "japhy" Pinyan [EMAIL PROTECTED]

Is there any function for converting uppercase characters to lowercase chars ?

2001-08-10 Thread Rahul Garg
Hello, Is there any function for converting uppercase characters to lowercase chars ? Thanks Rahul

Re: Need regex to match all UPPERCASE letters?

2001-07-23 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 23, KEVIN ZEMBOWER said: >Jeff and John, thanks for your help. I'm invoking my script with a >command line loop: perl -n pop2html.pl 2001-07-16.txt > >The file pop2html.pl, incorporating your suggestion, is: >if (! /[a-z]/) {chomp; print "$_\n"; next;} >if (/^\s*$/) { print "\n"; next;} >

Re: Need regex to match all UPPERCASE letters?

2001-07-23 Thread KEVIN ZEMBOWER
Jeff and John, thanks for your help. I'm invoking my script with a command line loop: perl -n pop2html.pl 2001-07-16.txt The file pop2html.pl, incorporating your suggestion, is: if (! /[a-z]/) {chomp; print "$_\n"; next;} if (/^\s*$/) { print "\n"; next;} The tail of the file 2001-07-16.txt is:

Re: Need regex to match all UPPERCASE letters?

2001-07-23 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 23, KEVIN ZEMBOWER said: >I need help writing a regular expression that will match lines that have >only upper case letters, and sometimes slashes and spaces, but won't >match lines with mixed case. > >Lines that must be matched are like: >FAMILY PLANNING / REPRODUCTIVE HEALTH POLICY >FAMI

RE: Need regex to match all UPPERCASE letters?

2001-07-23 Thread Chris Mulcahy
$_ !~ /[a-z]/ Easy enough! hth Chris > -Original Message- > From: KEVIN ZEMBOWER [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 23, 2001 8:49 AM > To: < > Subject: Need regex to match all UPPERCASE letters? > > > I need help writing a regular expression t

RE: Need regex to match all UPPERCASE letters?

2001-07-23 Thread John Edwards
CTED]] Sent: 23 July 2001 14:49 To: < Subject: Need regex to match all UPPERCASE letters? I need help writing a regular expression that will match lines that have only upper case letters, and sometimes slashes and spaces, but won't match lines with mixed case. Lines that must be matched a

Need regex to match all UPPERCASE letters?

2001-07-23 Thread KEVIN ZEMBOWER
I need help writing a regular expression that will match lines that have only upper case letters, and sometimes slashes and spaces, but won't match lines with mixed case. Lines that must be matched are like: FAMILY PLANNING / REPRODUCTIVE HEALTH POLICY FAMILY PLANNING / REPRODUCTIVE HEALTH PROJE