RE: [perl #18114] [no subject] BUG: "-4\n".."0\n" is not DWIM but "-4\n".."-0\n" is!

Content-Type: text/plain;

Slaven Rezic Sent on 30 October 2002 16:23
> There is a special handling for numeric strings beginning with a "0".
> This is to allow things like "01".."31" to preserve the leading zero
> for one-digit numbers.


> The special handling is triggered if either the left or right operand
> starts with "0". For left operands this is OK but I cannot think of a
> useful case where only a right operand with leading zero triggers this
> handling.
> OK:
> $ perl -e 'print join(",", "01" .. "02"), "\n"'
> 01,02
> Strange:
> $ perl -e 'print join(",", "1" .. "02"), "\n"'
> 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
> ,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,4
> 5,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,
> 66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86
> ,87,88,89,90,91,92,93,94,95,96,97,98,99
> With the patch below, Yves' new test cases pass (and all other tests)
> and the output from the example below looks better:
> $ ./perl -e 'print join(",", "1" .. "02"), "\n"'
> 1,2




10/30/2002 3:33:41 PM
perl.perl5.porters 48287 articles. 1 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 24


Similar Artilces:

RE: "\r\n\r\n" or "\n\n" or "\r\n" or "\n"... What is the term / name for this?
Escape characters that refer to: \r = carriage return \n = newline -----Original Message----- From: LI NGOK LAM [] Sent: Saturday, July 26, 2003 02:16 PM To: Subject: "\r\n\r\n" or "\n\n" or "\r\n" or "\n"... What is the term / name for this? Does anyone have a code snippet or a module for converting the IIS log = file format to NCSA Common? Cheers, Nigel ...

"\r\n\r\n" or "\n\n" or "\r\n" or "\n"... What is the term / name for this?
------=_NextPart_000_0011_01C353E5.0AE4D150 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable ------=_NextPart_000_0011_01C353E5.0AE4D150-- ...

Swap a "1" or "0" for a "Y" or "N"
I have a sql query that returns rows of data and one field returns a 1 (which means yes) or a 0 (which means no).  On my page, how do I replace the 1 with a Yes and the 0 with a No?  Or do I do this in the sql?  How do I do this in sql?Never make important decisions on a Monday! By default, VB.Net can understand 1 as Yes and 0 as No.I believe you are using those DB values for your Boolean Operations.Try to use If <DBValue> then <Operation>. If you are really need Yes/No .... Declare boolean variable in and set those variables. Thanks and R...

about "\r\n" or "\n"
Hello,=0A=0AI created a script for checking HTTP like below:=0A=0Ause stric= t;=0Ause IO::Socket;=0A=0Amy $host =3D shift || '';=0Amy $port =3D= shift || 80;=0A=0Amy $sock=3DIO::Socket::INET->new(PeerAddr =3D> $host,=0A= PeerPort =3D> $port,=0A = Proto =3D> 'tcp');=0Aunless (defined $sock) {=0A exit -1;=0A}= =0A=0A=0Aprint $sock "GET / HTTP/1.0\n\n";=0A=0A...=0A=0AFor above line, if= the remote server OS is Windows, should I send "GET / HTTP/1.0\r\n\r\n" in= stea...

Blue "N"/Red "N"
While troubleshooting a Win2k workstation running v4.9 of the Novell client, I noticed something. At the login prompt, after entering the ID/password, the animated "N" that indicates a connection attempt was blue instead of red. What does the blue "N" indicate? Mike Michael, It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply. Has your problem been resolved? If not, you might try one of the following options: - Do a search of our knowledgebase at http://supp...

.ALLCOL("%COLUMN%", " ", ", ", ", ")
Do you know anyway for me to exclude a subset of columns returned by this function. We have two columns (rec_user and rec_datetime) which are in all of our tables, but when generating triggers I want automatically generate a script which does not include those two columns but does include all other columns in that table. Bruce I should add that I am using PD Bruce "Bruce Lamb" <> wrote in message > Do you know anyway for me to exclude a subset of columns returned by this > function. ...

Precedence of "where" ("of", "is", "will")?
Nobody on #perl6 today could answer this one. Is: Str | Int where { $_ } the same as: (Str | Int) where { $_ } or: Str | (Int where { $_ }) ? Followup questions, Mr. President: What kind of operators are "where", "of", "is", and "will"? Is there a reason that S03 doesn't list them? What are their precedence(s)? -- Chip Salzenberg - a.k.a. - <> Open Source is not an excuse to write fun code then leave the actual work to others. Chip Salzenberg writes: &...

quotes, quotes, quotes...
I am getting this error and I know what is causing it, but I have no idea how to fix it, any help would be great. The script steps through the /var/log/messages file on a linux server and puts The entries into a mysql database. However when it gets to the 'hlt' line in the messages file it just barfs. The single quotes are freaking it out. I know about quotes but not how to use in this situation. Thanks, Paul Error: May 27 17:53:00 localhost kernel: Checking 'hlt' instruction... OK. <----- doesn't like this in the messages file DBD::mysql::st exec...

[ID 20000407.003] print \@foo=~/^ARRAY/?"yes\n":"no\n" changes behaviour in 5.6.0
This is a bug report for perl from, generated with the help of perlbug 1.28 running under perl v5.6.0. ----------------------------------------------------------------- [Please enter your report here] The following codes behaviour has changed moving to 5.6.0. While accepting that ref is the correct way to do this, is this change intentional or accidental? $ perl5.6.0 -e 'print \@foo=~/^ARRAY/?"yes\n":"no\n"' no $ perl5.00503 -e 'print \@foo=~/^ARRAY/?"yes\n":"no\n"' yes Note that the follow...

"Me" is better than "You"
Yes I know, strings are frozen. But let me talk about it, I really can't get through the idea of a PC talkin to me. I consider my PC as an extension of myself, not a dumb companion who addresses Me as You. Yes there are times when I get angry with Him while I work and get wrong calculations etc.., but it really is my fault, Me using wrong istructions and eventually wanting to find someone else to blame, but it's Me. And yes, I consider Thunderbird my mail program, reading my mail on my PC as Me. So I personally like to have Me in the header bar as a compact address ...

Using "+" or "||"
Using SQLAnywhere 5.5.04, I've gotten into the habit of using "||" in ISQL to indicate a string concatenation. I needed to paste my SQL statement into the PowerBuilder script painter for some embedded SQL, and PB didn't like the "||" very much at all. I changed it to "+" and it seems to be ok. Do these two operators indicate ~exactly~ the same thing? moin, afaik these two's are not the same! if you're using "||" and any term is NULL then in the resultstring the term will be ignored if you use "+" then the resu...

replace the "." with a ","
Oi.... I need to build a small programm in ASP.NET and chose to use C# for it.Now i got everything working but there's one little problem.the first textbox is a double. I need to make it so that when someone enters a "." then it gets replaced by a ","any ideas?Ghan  string blah = "";blah = blah.Replace(".", ",");Ryan Ryan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question...

"Using" or "With"
Hi all Please can someone enlighten to me as regards the difference with the "Using" and "With" statement when accessing data - which is better, what are the limitations and/or any pointers. Many thanks. Regards DaveDavid WinchesterPlease mark as answer if this is the solution.  using gives you the ability to use the connection and it closes the connection directlly after you finish using it. and there is no need to try- cach - finaly. there is no limitation on using USING keywordMuhanad YOUNISMCSD.NETMy Blog || My Photos || LinkedIn I have a dataobject the re...

Replacing "\\" with "\"
Hi all I'm getting this value from a CheckBoxList control - a location of file, i have to remove "\\" and replace it with "\" and pass it to Query, how to do it, i tried with Replace, but coud'nt suceed. "\\\\Blaze10xp\\BLZ_SFS_07\\Sample Excel Files\\Excel Files\\report2.xls" thank's in advance - Prakash.C you tried Replace like this? string newstring = oldstring.Replace(@"\\",@"\");Plese, do not forget to click "Mark as Answer" on the post that helped you. Thanx!My blog: Scenes From A Developer Memory yes i tr...

"To" and "From" missing
When I print emails, the words "To" and "From" are blank, even though the "To" name and "From name (addresser, addressee) do show up. This is not a problem for other users on my system. Suggestions In mailbox right click, view. On the message window, right click and choose print options. Make sure print header is checked. -- Barry Merchant NSC Volunteer SysOp *** no email unless requested please!! *** > In mailbox right click, view. On the message window, right click and > choose print options. Make sure prin...

Web resources about - RE: [perl #18114] [no subject] BUG: "-4\n".."0\n" is not DWIM but "-4\n".."-0\n" is! - perl.perl5.porters

Subject (grammar) - Wikipedia, the free encyclopedia
According to a tradition associated with predicate logic and dependency grammars , the subject is the most prominent overt argument of the predicate. ...

'Filthy' Perth Chinese restaurant kitchen had been subject to health complaints
A Perth Chinese restaurant which shocked a renovation crew - and WAtoday readers - with its filthy state had twice been the subject of health ...

Rich student, poor student: what your VCE subjects say about you
&nbsp;Rich VCE students study Latin and receive bonus marks while their poor counterparts study food technology and their results are scaled ...

"And now Mary’s aggression on this subject is getting a lot less passive!"
"You two love birds keep doing what you’re doing, which is enjoying the physical aspects of the sex act without true emotional intimacy! We have ...

Self-driving cars could be subject to tough new rules
California rolls out plan to require a driver behind the wheel and other safety measures

Donald Trump Changes The Subject
Yesterday morning, I was on TV talking about Barack Obama’s anemic speech in the Oval Office, and I was promoting my latest column, titled: “How ...

‘Sicario’ Director Denis Villeneuve: “It’s Tough To Make A Movie About A Dark Subject Matter” – AwardsLine ...
Known for his dark, white-knuckle films made within the last five years, including Incendies , Enemy and Prisoners , Denis Villeneuve has secured ...

How to Secure Containers Is Still Subject to Debate
NEWS ANALYSIS: Experts agree that security is paramount when it comes to containers. Yet how to properly secure containers is still a matter ...

AP Report: U.S. Power Grid Subject To Repeated Foreign Hacks
... Press found there have been at least a dozen cyberattacks against the U.S. power grid over the last decade. The U.S. power grid is subject ...

Lord Rose And Britain In Europe Are Entirely Ignorant On The Subject Of Brexit, The EU And Trade
That we expect people to be a little free with the truth in discussions about whether Britain should leave or stay in the European Union is true. ...

Resources last updated: 12/28/2015 2:44:55 AM