Re: having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-28 Thread David Precious
On Fri, 17 Jun 2016 14:33:12 -0700 Kenneth Wolcott wrote: > Hi; > > I'm having trouble understanding the built-in Perl sort with regards > to mixed numbers and strings > > I'm looking at http://perldoc.perl.org/functions/sort.html > > I have a

Re: having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-20 Thread Kenneth Wolcott
On Mon, Jun 20, 2016 at 10:40 AM, Shlomi Fish wrote: > Hi Chris, > > On Mon, 20 Jun 2016 11:28:57 -0600 > Chris Fedde wrote: > >> Kenneth, >> >> Below the cut is my example implementation as I understand your >> requirements. >> Note that the "compare" routine uses $a and $b which are "special" t

Re: having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-20 Thread Shlomi Fish
gt; 6800 eashoo > 6800 ohweba > 2300 apahqu > 8100 ahghee > 6700 jooxoj > 3500 yeiboo > 2800 chuema > > > On Fri, Jun 17, 2016 at 3:41 PM, Kenneth Wolcott > wrote: > > > On Fri, Jun 17, 2016 at 2:33 PM, Kenneth Wolcott >

Re: having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-20 Thread Chris Fedde
t; Hi; > > > > I'm having trouble understanding the built-in Perl sort with regards > > to mixed numbers and strings > > > > I'm looking at http://perldoc.perl.org/functions/sort.html > > > > I have an array that I want to have sorted n

Re: having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-18 Thread Shlomi Fish
Hi Kenneth, On Fri, 17 Jun 2016 14:41:41 -0700 Kenneth Wolcott wrote: > On Fri, Jun 17, 2016 at 2:33 PM, Kenneth Wolcott > wrote: > > Hi; > > > > I'm having trouble understanding the built-in Perl sort with regards > > to mixed numbers and st

Re: having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-17 Thread Brock Wilcox
derstanding the built-in Perl sort with regards > > to mixed numbers and strings > > > > I'm looking at http://perldoc.perl.org/functions/sort.html > > > > I have an array that I want to have sorted numerically and descending. > > > > The array i

Re: having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-17 Thread Jim Gibson
Wolcott wrote: > > On Fri, Jun 17, 2016 at 2:33 PM, Kenneth Wolcott > wrote: >> Hi; >> >> I'm having trouble understanding the built-in Perl sort with regards >> to mixed numbers and strings >> >> I'm looking at http://perldoc.perl.org/

Re: having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-17 Thread Kenneth Wolcott
On Fri, Jun 17, 2016 at 2:33 PM, Kenneth Wolcott wrote: > Hi; > > I'm having trouble understanding the built-in Perl sort with regards > to mixed numbers and strings > > I'm looking at http://perldoc.perl.org/functions/sort.html > > I have an array that I w

having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-17 Thread Kenneth Wolcott
Hi; I'm having trouble understanding the built-in Perl sort with regards to mixed numbers and strings I'm looking at http://perldoc.perl.org/functions/sort.html I have an array that I want to have sorted numerically and descending. The array is composed of elements that loo

Re: Best way to translate parts of strings

2015-07-24 Thread Simon Reinhardt
Hi Gary, > Unfortunately some strings have a 'S' instead of a 5 or a 'B' instead of a 8 > > The fields are of the format > > Registration XX99XXX > Stock no XX9 > VIN XX9 > > I've been experi

Best way to translate parts of strings

2015-07-24 Thread Gary Stainburn
Hi I'm still extracting text from OCR generated documents. I've managed to extract likely fields for registration numbers, stock numbers and VINs. Unfortunately some strings have a 'S' instead of a 5 or a 'B' instead of a 8 The fields are of the format Re

Re: How to parse C#, javascript, lisp source code for quoted literal strings

2014-05-24 Thread Christian Walde
Do not use a single regex for this and instead build a proper parser with mgc parsing. You can check this module for prior art along those lines: https://metacpan.org/source/MITHALDU/Locale-Simple-0.017/lib/Locale/Simple/Scraper/Parser.pm It is based on Parser::MGC, which is very useful for th

Re: How to parse C#, javascript, lisp source code for quoted literal strings

2014-05-22 Thread Jim Gibson
languages? The Regexp::Common module, available from cpan.org, has several useful categories of regular expressions. Among these is Regexp::Common::delimited for finding delimited strings, which you may find useful. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: How to parse C#, javascript, lisp source code for quoted literal strings

2014-05-22 Thread Rob Dixon
On 22/05/2014 10:04, siegfr...@heintze.com wrote: I need to extract some information from source code. How can I write a perl regular expression that will match a literal string in languages like C#, javascript, java and lisp? Here is my naive approach: /"[^"]*"/ This of course does not accom

Re: How to parse C#, javascript, lisp source code for quoted literal strings

2014-05-22 Thread Jing Yu
On 22 May 2014, at 10:04, siegfr...@heintze.com wrote: > I need to extract some information from source code. > > How can I write a perl regular expression that will match a literal string in > languages like C#, javascript, java and lisp? > > Here is my naive approach: > > /"[^"]*"/ > > Thi

How to parse C#, javascript, lisp source code for quoted literal strings

2014-05-22 Thread siegfried
I need to extract some information from source code.How can I write a perl regular _expression_ that will match a literal string in languages like C#, _javascript_, java and lisp?Here is my naive approach:/"[^"]*"/This of course does not accommodate backslashes in the string that perl, C, C# _javas

Output of expect commands in to Strings Solved

2014-04-03 Thread Martin G. McCormick
After further study, I probably would have had to setup a named pipe to capture expect's output in to strings which would have not bought me anything useful for this situation. We needed to know what was going on with expect as it happened, not after the fact. More study shows that

Output of expect commands in to Strings

2014-04-02 Thread Martin G. McCormick
UT directly in to a list? This would make the flow of the program easier to follow and control. If something goes wrong, one finds out a lot sooner. What I was thinking was is some kind of special "file" that writes in to @strings when you write to the file but I am open to a

Re: Merging multiple strings

2012-04-25 Thread Rob Dixon
On 25/04/2012 13:52, Paul Clark wrote: Hi All, I have a small project that is stumping me aside from using a straight brute force. I am processing output from an accounting program that is producing some sort of printer control for some 3rd party print processing. I have several partial lines

Re: Merging multiple strings

2012-04-25 Thread Michael Rasmussen
On Wed, Apr 25, 2012 at 08:52:52AM -0400, Paul Clark wrote: > Hi All, > > I have a small project that is stumping me aside from using a straight brute > force. > > I am processing output from an accounting program that is producing some > sort of printer control for some 3rd party print process

Re: Merging multiple strings

2012-04-25 Thread John SJ Anderson
On Wednesday, April 25, 2012 at 8:52 AM, Paul Clark wrote: > Any suggestions for a more elegant solution? What you have there looks like an example of the 'Longest Common Substring Problem' -- http://www.softpanorama.org/Algorithms/lcs.shtml Seems like String::LCSS will help -- https://metacpan.o

Merging multiple strings

2012-04-25 Thread Paul Clark
Hi All, I have a small project that is stumping me aside from using a straight brute force. I am processing output from an accounting program that is producing some sort of printer control for some 3rd party print processing. I have several partial lines that have commands to "over write" th

Re: Merging multiple strings

2012-04-24 Thread Rob Dixon
On 24/04/2012 18:37, Paul Clark wrote: > Hi All, > > I have a small project that is stumping me aside from using a > straight brute force. > > I am processing output from an accounting program that is producing > some sort of printer control for some 3rd party print processing. I > have several

Merging multiple strings

2012-04-24 Thread Paul Clark
Hi All, I have a small project that is stumping me aside from using a straight brute force. I am processing output from an accounting program that is producing some sort of printer control for some 3rd party print processing. I have several partial lines that have commands to "over write"

Re: Including () and {} in strings.

2012-02-24 Thread Rob Dixon
On 25/02/2012 00:57, Sean Murphy wrote: Hi Rob, Thanks for that. I have spent 30 mins on it and was pulling out my hair. The end of the heredoc had a tab in front. I didn't know this mattered. I had the "tag" included and removed for the heredoc. But I got an error when compiled without the quot

Re: Including () and {} in strings.

2012-02-24 Thread John W. Krahn
Sean Murphy wrote: Hi All. Hello, I have a real issue with strings. I want to build a sub routine skeleton plus some test code. If I use () or {} etc. The string comes out completely messed up. The code below is for a heredoc and complains that I am trying to define a function. If I use the

Re: Including () and {} in strings.

2012-02-24 Thread Rob Dixon
On 25/02/2012 00:41, Sean Murphy wrote: Hi All. I have a real issue with strings. I want to build a sub routine skeleton plus some test code. If I use () or {} etc. The string comes out completely messed up. The code below is for a heredoc and complains that I am trying to define a function. If

Re: Including () and {} in strings.

2012-02-24 Thread Sean Murphy
tag. Now I know why. This is the first time I ever have used heredocs. Far better then other ways I have done it. It all works now. Sean On 25/02/2012, at 11:51 AM, Rob Dixon wrote: > On 25/02/2012 00:41, Sean Murphy wrote: >> Hi All. >> >> I have a real issue with st

Re: Including () and {} in strings.

2012-02-24 Thread Rob Dixon
On 25/02/2012 00:41, Sean Murphy wrote: Hi All. I have a real issue with strings. I want to build a sub routine skeleton plus some test code. If I use () or {} etc. The string comes out completely messed up. The code below is for a heredoc and complains that I am trying to define a function. If

Including () and {} in strings.

2012-02-24 Thread Sean Murphy
Hi All. I have a real issue with strings. I want to build a sub routine skeleton plus some test code. If I use () or {} etc. The string comes out completely messed up. The code below is for a heredoc and complains that I am trying to define a function. If I use the skeleton within a string. It

Re: script takes long time to run when comparing digits within strings using foreach

2011-05-28 Thread John W. Krahn
eventual wrote: Hi, Hello, I have an array , @datas, and each element within @datas is a string that's made up of 6 digits with spaces in between like this “1 2 3 4 5 6”, so the array look like this @datas = ('1 2 3 4 5 6', '1 2 9 10 11 12', '1 2 3 4 5 8', '1 2 3 4 5 9' , '6 7 8 9 10 11'); No

Re: script takes long time to run when comparing digits within strings using foreach

2011-05-28 Thread Dr.Ruud
On 2011-05-27 10:18, eventual wrote: I have an array , @datas, and each element within @datas is a string that's made up of 6 digits with spaces in between like this “1 2 3 4 5 6”, so the array look like this @datas = ('1 2 3 4 5 6', '1 2 9 10 11 12', '1 2 3 4 5 8', '1 2 3 4 5 9' , '6 7 8 9 1

Re: script takes long time to run when comparing digits within strings using foreach

2011-05-27 Thread Shlomi Fish
Hi eventual, On Friday 27 May 2011 11:18:01 eventual wrote: > Hi, > I have an array , @datas, and each element within @datas is a string that's > made up of 6 digits with spaces in between like this “1 2 3 4 5 6”, so the > array look like this @datas = ('1 2 3 4 5 6', '1 2 9 10 11 12', '1 2 3 4 5

script takes long time to run when comparing digits within strings using foreach

2011-05-27 Thread eventual
Hi, I have an array , @datas, and each element within @datas is a string that's made up of 6 digits with spaces in between like this “1 2 3 4 5 6”, so the array look like this @datas = ('1 2 3 4 5 6', '1 2 9 10 11 12', '1 2 3 4 5 8', '1 2 3 4 5 9' , '6 7 8 9 10 11'); Now I wish to compare each

Re: How do I trim UTF-8 strings?

2009-07-23 Thread Chas. Owens
On Thu, Jul 23, 2009 at 18:43, Jenny Chen wrote: > Hi All, > > I need some help with utf-8 string handling in Perl. I tried to trim utf-8 > strings using Perl. Follow is the main portion of the codes, but it does not > work. Any help will be greatly appreciated. > > J

Re: Replace string with list of strings via character changes

2009-04-12 Thread Dr.Ruud
Kelly Jones wrote: I want to ASCII-ify the geonames alternatenames table using iso-8859-1. Also try Text::Unidecode. -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Replace string with list of strings via character changes

2009-04-11 Thread Kelly Jones
-Original Message- >> From: Kelly Jones [mailto:kelly.terry.jo...@gmail.com] >> Sent: Friday, April 10, 2009 13:33 >> To: beginners@perl.org >> Subject: Replace string with list of strings via character changes >> >> I want to replace all the o's in a

RE: Replace string with list of strings via character changes

2009-04-10 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: Kelly Jones [mailto:kelly.terry.jo...@gmail.com] > Sent: Friday, April 10, 2009 13:33 > To: beginners@perl.org > Subject: Replace string with list of strings via character changes > > I want to replace all the o's in a string with x&

Replace string with list of strings via character changes

2009-04-10 Thread Kelly Jones
I want to replace all the o's in a string with x's or y's and all the a's in a string with u's or v's. Example: given string "foobar", the output would be this list of strings fxxbur (change both o's to x, and the a to u) fxxbvr (both o's to x,

Re: how are these two strings not equal?

2008-06-03 Thread Kev
> > Run the two strings through > > > sub nicehex { > > my $s = $_[0]; > > ... > > Noone's perfect. Here is a correct version, that one cut off the last > few characters. > > sub nicehex { > my $s = $_[0]; > my $hex = unpack 'H*

Re: how are these two strings not equal?

2008-06-02 Thread Dr.Ruud
Kev schreef: > 1) If I encode the generated code and the database code using > MIME::Base64, only the first few bytes ('REVDTEFSRQ', decoded that's > 'DECLARE') are the same, and after that the files are different. Maybe trailing whitespace, or different newlines? Try hexdump -c. -- Affijn, Ru

Re: how are these two strings not equal?

2008-06-02 Thread Jenda Krynicky
the code of a function, and then > > want to check whether this is the same code stored in the database or > > not, but diff shows "differences" where there aren't any (or shouldn't > > be any, since nothing in the database has changed), and worse, perl'

Re: how are these two strings not equal?

2008-06-02 Thread Jenda Krynicky
ows "differences" where there aren't any (or shouldn't > be any, since nothing in the database has changed), and worse, perl's > 'eq' and 'ne' operators agree with diff that the strings are > different. But at least visually the two texts

how are these two strings not equal?

2008-06-02 Thread Kev
nothing in the database has changed), and worse, perl's 'eq' and 'ne' operators agree with diff that the strings are different. But at least visually the two texts being compared are identical, and if I copy and paste the results from Firefox into TextPad and then run "com

Re: strings printing bug

2008-04-27 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > On Apr 26, 9:55 am, [EMAIL PROTECTED] (Rob Dixon) wrote: >> >> [EMAIL PROTECTED] wrote: >>> >>> The following script is to read 4 consecutive lines at a time from a >>> file, concatenate the first 3 lines >>> (with a ", "), and print the result to STDOUT. If the 3 lin

Re: strings printing bug

2008-04-27 Thread Chas. Owens
On Sat, Apr 26, 2008 at 3:42 PM, <[EMAIL PROTECTED]> wrote: > I tried your suggestion and got the following output: > 1) the first col didn't print, and the 3rd col overwrote the 2nd; this > is the main stumbling block > 2) also, what if example.txt has 36 lines with the same format as > descr

Re: strings printing bug

2008-04-27 Thread evan9021
I tried your suggestion and got the following output: 1) the first col didn't print, and the 3rd col overwrote the 2nd; this is the main stumbling block 2) also, what if example.txt has 36 lines with the same format as described. FYI I'm using cgywin's version of perl. -- On Apr 26, 9:55 am, [EMAI

Re: strings printing bug

2008-04-26 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > The following script is to read 4 consecutive lines at a time from a > file, concatenate the first 3 lines > (with a ", "), and print the result to STDOUT. If the 3 lines aren't > concatenated they print correctly, however > if they are, the result is gibberish. Any sug

Re: strings printing bug

2008-04-25 Thread John W. Krahn
[EMAIL PROTECTED] wrote: The following script is to read 4 consecutive lines at a time from a file, concatenate the first 3 lines (with a ", "), and print the result to STDOUT. If the 3 lines aren't concatenated they print correctly, however if they are, the result is gibberish. Any suggestions

strings printing bug

2008-04-25 Thread evan9021
The following script is to read 4 consecutive lines at a time from a file, concatenate the first 3 lines (with a ", "), and print the result to STDOUT. If the 3 lines aren't concatenated they print correctly, however if they are, the result is gibberish. Any suggestions. thx., EC. -

Re: Changing case of UTF-8 strings

2008-04-15 Thread Chas. Owens
On Mon, Apr 14, 2008 at 1:21 PM, Paulo Antonio <[EMAIL PROTECTED]> wrote: > On 14 abr, 13:25, [EMAIL PROTECTED] (Chas. Owens) wrote: > [...] > > > Hmm, the following works for me, but then again I have > > > > export PERL_UNICODE=SDL #Make Perl use UTF-8 for IO > > > > in my .bash_profile.

Re: Changing case of UTF-8 strings

2008-04-15 Thread Paulo Antonio
On 14 abr, 13:25, [EMAIL PROTECTED] (Chas. Owens) wrote: [...] > Hmm, the following works for me, but then again I have > > export PERL_UNICODE=SDL #Make Perl use UTF-8 for IO > > in my .bash_profile. > Yes, that made the trick. Thanks. But I wish there was a "Perl only" way... -- To unsubs

Re: Changing case of UTF-8 strings

2008-04-14 Thread Chas. Owens
On Apr 14, 2008, at 10:10, Paulo Antonio wrote: Hi all, I'm trying to change case of UTF-8 strings. I've read a bunch of documentation, but can't figure out how to do it right. Here is an example: === My code: use strict; use utf8; my $line; my $letter; while ($line = ) {

Changing case of UTF-8 strings

2008-04-14 Thread Paulo Antonio
Hi all, I'm trying to change case of UTF-8 strings. I've read a bunch of documentation, but can't figure out how to do it right. Here is an example: === My code: use strict; use utf8; my $line; my $letter; while ($line = ) { chomp($line); utf8::upgrade($line); $

Re: Concatenating Strings

2008-03-25 Thread Bobby
Thanks for all your input, using a hash does make things a lot easier for me. Rob Dixon <[EMAIL PROTECTED]> wrote: kens wrote: > > # Or if you must use a counter > > my $count = 0; > > while ( defined($strA[$count]) ) > { >print "$strA[$count++]\n"; > } for my $count (0 .. $#strA) { p

Re: Concatenating Strings

2008-03-24 Thread Rob Dixon
kens wrote: # Or if you must use a counter my $count = 0; while ( defined($strA[$count]) ) { print "$strA[$count++]\n"; } for my $count (0 .. $#strA) { print "[$count] = $strA[$count]\n"; } **OR** my $count = 0; foreach (@strA) { print "[$count] = $strA[$count]\n"; $count++; }

Re: Concatenating Strings

2008-03-24 Thread Randal L. Schwartz
> "Bobby" == Bobby <[EMAIL PROTECTED]> writes: Bobby> I'm trying to write a simple do until loop to print out the value of Bobby> $strA0 through $striA3. If your variable names are named sequentially, you've almost always done something wrong. Please rethink your problem, keeping data struc

Re: Concatenating Strings

2008-03-24 Thread Rob Dixon
Bobby wrote: Hi all, I'm trying to write a simple do until loop to print out the value of > $strA0 through $striA3. What i'm doing is replacing the value of 0 > through 3 in the $strA by joining two strings (my $strB = "strA". > $count;). Right now my script is pr

Re: Concatenating Strings

2008-03-24 Thread Gunnar Hjalmarsson
yitzle wrote: IIRC, Perl does not let you use a string to build a variable name like PHP does. Then you do not remember it correctly. If you do this: $myVar = 123; $varName = "myVar"; print "$varName"; You get "myVar" and not "123" Sure, but if you replace the last line with prin

Re: Concatenating Strings

2008-03-24 Thread kens
On Mar 24, 12:09 pm, [EMAIL PROTECTED] (Bobby) wrote: > Hi all, > > I'm trying to write a simple do until loop to print out the value of $strA0 > through $striA3. What i'm doing is replacing the value of 0 through 3 in the > $strA by joining two strings (my $strB = &qu

Re: Concatenating Strings

2008-03-24 Thread Gunnar Hjalmarsson
Bobby wrote: I'm trying to write a simple do until loop to print out the value of $strA0 through $striA3. What i'm doing is replacing the value of 0 through 3 in the $strA by joining two strings (my $strB = "strA" . $count;). Right now my script is printing $strB as below

Re: Concatenating Strings

2008-03-24 Thread Jenda Krynicky
> Bobby wrote: > Hi all, > > I'm trying to write a simple do until loop to print out the value of > $strA0 through $striA3. What i'm doing is replacing the value of 0 > through 3 in the $strA by joining two strings (my $strB = "strA" . > $count;).

Re: Concatenating Strings

2008-03-24 Thread Wolf
t; Hi all, > > > > > > I'm trying to write a simple do until loop to print out the value of > > > $strA0 through $striA3. What i'm doing is replacing the value of 0 > > > through 3 in the $strA by joining two strings (my $strB = "strA" . &g

Re: Concatenating Strings

2008-03-24 Thread Bobby
didn't > worked. > > Wolf wrote: > Bobby wrote: > > Hi all, > > > > I'm trying to write a simple do until loop to print out the value of $strA0 > > through $striA3. What i'm doing is replacing the value of 0 through 3 in > >

Re: Concatenating Strings

2008-03-24 Thread yitzle
IIRC, Perl does not let you use a string to build a variable name like PHP does. If you do this: $myVar = 123; $varName = "myVar"; print "$varName"; You get "myVar" and not "123" which seems to be what you want. However, I think you might be able to use hashes and get what you want. $hash{"

Re: Concatenating Strings

2008-03-24 Thread Wolf
27;m trying to write a simple do until loop to print out the value of $strA0 > > through $striA3. What i'm doing is replacing the value of 0 through 3 in > > the $strA by joining two strings (my $strB = "strA" . $count;). Right now > > my script is printing $strB

Re: Concatenating Strings

2008-03-24 Thread Bobby
3. What i'm doing is replacing the value of 0 through 3 in the > $strA by joining two strings (my $strB = "strA" . $count;). Right now my > script is printing $strB as below. How do i get perl to print the value of > $strA0 through $strA3 inside of my do until loop? i.e.:

Re: Concatenating Strings

2008-03-24 Thread Wolf
Bobby <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm trying to write a simple do until loop to print out the value of $strA0 > through $striA3. What i'm doing is replacing the value of 0 through 3 in the > $strA by joining two strings (my $strB = "strA

Concatenating Strings

2008-03-24 Thread Bobby
Hi all, I'm trying to write a simple do until loop to print out the value of $strA0 through $striA3. What i'm doing is replacing the value of 0 through 3 in the $strA by joining two strings (my $strB = "strA" . $count;). Right now my script is printing $strB as below.

Re: Use parentheses in translation strings

2008-01-02 Thread Nihilism Machine
aving problem with using parentheses in translation strings. For example, I want to replace the 4 digit year code '' with '(\d\d\d\d)', so it can be used for grouping in string matching later. I expected the code would be like: $org_str =~ tr//\(\d\d\d\d\)/; Then the r

Re: Use parentheses in translation strings

2008-01-02 Thread Nihilism Machine
how do i unsubscribe from this list? On Jan 2, 2008, at 12:14 PM, Tom Phoenix wrote: On Jan 1, 2008 1:20 PM, <[EMAIL PROTECTED]> wrote: I'm quite new to perl, and now having problem with using parentheses in translation strings. For example, I want to replace the 4 digit year

Re: Use parentheses in translation strings

2008-01-02 Thread Chas. Owens
On Jan 2, 2008 10:48 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Jan 1, 2008 4:20 PM, <[EMAIL PROTECTED]> wrote: > > Hi there, > > > > I'm quite new to perl, and now having problem with using parentheses > > in translation strings. For example,

Re: Use parentheses in translation strings

2008-01-02 Thread Paul Lalli
On Jan 1, 4:20 pm, [EMAIL PROTECTED] wrote: > Hi there, > > I'm quite new to perl, and now having problem with using  parentheses > in translation strings. For example, I want to replace the 4 digit > year code '' with '(\d\d\d\d)', so it can be used fo

Re: Use parentheses in translation strings

2008-01-02 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hi there, Hello, I'm quite new to perl, and now having problem with using parentheses in translation strings. For example, I want to replace the 4 digit year code '' with '(\d\d\d\d)', so it can be used for grouping in string matching l

Re: Use parentheses in translation strings

2008-01-02 Thread Tom Phoenix
On Jan 1, 2008 1:20 PM, <[EMAIL PROTECTED]> wrote: > I'm quite new to perl, and now having problem with using parentheses > in translation strings. For example, I want to replace the 4 digit > year code '' with '(\d\d\d\d)', so it can be used for gr

Re: Use parentheses in translation strings

2008-01-02 Thread Martin Barth
t;. HTH! Martin On 22:20:53 01/01/2008 [EMAIL PROTECTED] wrote: > Hi there, > > I'm quite new to perl, and now having problem with using parentheses > in translation strings. For example, I want to replace the 4 digit > year code '' with '(\d\d\d\d)'

Re: Use parentheses in translation strings

2008-01-02 Thread Chas. Owens
On Jan 1, 2008 4:20 PM, <[EMAIL PROTECTED]> wrote: > Hi there, > > I'm quite new to perl, and now having problem with using parentheses > in translation strings. For example, I want to replace the 4 digit > year code '' with '(\d\d\d\d)', so it

Use parentheses in translation strings

2008-01-02 Thread yellowbluetest
Hi there, I'm quite new to perl, and now having problem with using parentheses in translation strings. For example, I want to replace the 4 digit year code '' with '(\d\d\d\d)', so it can be used for grouping in string matching later. I expected the code would be l

Re: Finding time difference from two strings

2007-10-26 Thread Rob Dixon
Wijaya Edward wrote: Hi, Suppose I have this two strings: my $beginning = 'Fri Oct 25 17:37:58 2007'; my $end = 'Fri Oct 26 06:54:09 2007'; How can I compute the time difference between them (in secs)? Is there any CPAN module that does that? I have a large text fil

Re: Finding time difference from two strings

2007-10-26 Thread Rob Dixon
Wijaya Edward wrote: Hi, Suppose I have this two strings: my $beginning = 'Fri Oct 25 17:37:58 2007'; my $end = 'Fri Oct 26 06:54:09 2007'; How can I compute the time difference between them (in secs)? Is there any CPAN module that does that? I have a large text fil

Finding time difference from two strings

2007-10-26 Thread Wijaya Edward
Hi, Suppose I have this two strings: my $beginning = 'Fri Oct 25 17:37:58 2007'; my $end = 'Fri Oct 26 06:54:09 2007'; How can I compute the time difference between them (in secs)? Is there any CPAN module that does that? I have a large text files which contain two

Re: printing long strings

2007-08-30 Thread Gunnar Hjalmarsson
R (Chandra) Chandrasekhar wrote: I need to print diagnostic message strings like: warn "$parent/$child does not exist: verification failed\n"; in conditional blocks that are nested and indented. This means that, on occasion, the message string overflows to the next line in an 80

printing long strings

2007-08-30 Thread R (Chandra) Chandrasekhar
Dear Folks, I need to print diagnostic message strings like: warn "$parent/$child does not exist: verification failed\n"; in conditional blocks that are nested and indented. This means that, on occasion, the message string overflows to the next line in an 80-character line in my s

Re: Help on cleanining strings

2007-08-23 Thread usenet
On Aug 22, 12:21 pm, [EMAIL PROTECTED] wrote: > I've searche over the web and couldn' find an answer to what I need. The web is not the best place to look. The first place you should look for Perl answers is the perldocs themselves. They are very good. > I need to clean all the ocorrences of th

Re: Help on cleaning strings

2007-08-23 Thread kviel
- Original Message - From: Mário Gamito <[EMAIL PROTECTED]> Date: Wednesday, August 22, 2007 4:18 pm Subject: Help on cleaning strings To: beginners@perl.org > I need to clean all the ocorrences of the "##Z/" string (without > the quotes), from a series of .html fil

Re: Help on cleanining strings

2007-08-22 Thread Rodrick Brown
On 8/22/07, Mário Gamito <[EMAIL PROTECTED]> wrote: > Hi, > > Sorry for the newbie question, but I've searche over the web and couldn' > find an answer to what I need. > > I need to clean all the ocorrences of the "##Z/" string (without the > quotes), from a series of .html files located in a singl

Re: Help on cleaning strings

2007-08-22 Thread John W. Krahn
Mário Gamito wrote: Hi, Hello, Sorry for the newbie question, but I've searche over the web and couldn' find an answer to what I need. I need to clean all the ocorrences of the "##Z/" string (without the quotes), from a series of .html files located in a single directory. perl -i -pe's!#

Re: Help on cleaning strings

2007-08-22 Thread Chas Owens
On 8/22/07, Mário Gamito <[EMAIL PROTECTED]> wrote: > Hi, > > Sorry for the newbie question, but I've searche over the web and couldn' > find an answer to what I need. > > I need to clean all the ocorrences of the "##Z/" string (without the > quotes), from a series of .html files located in a singl

Help on cleaning strings

2007-08-22 Thread Mário Gamito
Hi, Sorry for the newbie question, but I've searche over the web and couldn' find an answer to what I need. I need to clean all the ocorrences of the "##Z/" string (without the quotes), from a series of .html files located in a single directory. Can someone help me, please ? Any help would

Help on cleanining strings

2007-08-22 Thread Mário Gamito
Hi, Sorry for the newbie question, but I've searche over the web and couldn' find an answer to what I need. I need to clean all the ocorrences of the "##Z/" string (without the quotes), from a series of .html files located in a single directory. Can someone help me, please ? Any help would

Re: Perl Help With Strings

2007-08-18 Thread Chas Owens
On 8/18/07, Dr.Ruud <[EMAIL PROTECTED]> wrote: > "Chas Owens" schreef: > > Dr.Ruud: > >> mihirtr: > > >>> I have multiple C/C++ files which I need to go manually and find out > >>> specific function call. I want to check 2nd parameter of this > >>> function > >>> (Function_To_Look_For) and get valu

Re: Perl Help With Strings

2007-08-18 Thread Dr.Ruud
"Chas Owens" schreef: > Dr.Ruud: >> mihirtr: >>> I have multiple C/C++ files which I need to go manually and find out >>> specific function call. I want to check 2nd parameter of this >>> function >>> (Function_To_Look_For) and get value of it and store it in local >>> file >> >> I would use (not

Re: Perl Help With Strings

2007-08-18 Thread Chas Owens
On 8/18/07, Dr.Ruud <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schreef: > > > I have multiple C/C++ files which I need to go manually and find out > > specific function call. I want to check 2nd parameter of this > > function > > (Function_To_Look_For) and get value of it and store it in local

Re: Perl Help With Strings

2007-08-18 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > I have multiple C/C++ files which I need to go manually and find out > specific function call. I want to check 2nd parameter of this > function > (Function_To_Look_For) and get value of it and store it in local file I would use (not Perl but) the preprocessor for that

Re: Perl Help With Strings

2007-08-18 Thread Chas Owens
On 8/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: snip > I have multiple C/C++ files which I need to go manually and find out > specific function call. I want to check 2nd parameter of this > function > (Function_To_Look_For) and get value of it and store it in local file > or output it. For

Perl Help With Strings

2007-08-18 Thread mihirtr
Hi, I have trying see if it is possible using perl to do following. I have multiple C/C++ files which I need to go manually and find out specific function call. I want to check 2nd parameter of this function (Function_To_Look_For) and get value of it and store it in local file or output it. For e

Re: qw with strings containing spaces

2007-08-09 Thread usenet
On Aug 9, 11:58 am, [EMAIL PROTECTED] (Mathew Snyder) wrote: > What I am doing is declaring an array and assigning the value: > @array = qw/All "A - H" "I - P" "Q - Z"/; You don't want qw{} here. Just do it the brute-force way: @array = ("All", "A - H", "I - P", "Q - Z"); -- The best way to

Re: qw with strings containing spaces

2007-08-09 Thread Mathew Snyder
determined values onto the array later on. >> However, >> when I print this all out while testing, I get each letter, hyphen and >> quote as >> individual elements. I've tried escaping different ways to no avail. > > qw/All "A - H" "I -

Re: qw with strings containing spaces

2007-08-09 Thread John W. Krahn
yphen and quote as individual elements. I've tried escaping different ways to no avail. qw/All "A - H" "I - P" "Q - Z"/ is the same as saying: split ' ', q/All "A - H" "I - P" "Q - Z"/ so when using qw// there are no strings ju

Re: qw with strings containing spaces

2007-08-09 Thread Flemming Greve Skovengaard
Mathew Snyder wrote: I need to populate a select multiple on a web page when it loads with a series of values. Most of the values will be determined dynamically when the code runs but some are static. They look like "A - H", "I - P" and "Q - Z". The spaces are for readability. What I am doing

  1   2   3   4   5   >