Click here to get back home

Re: Is substr only way of getting nth character of string?

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Re: Is substr only way of getting nth character of string? Ben Bullock 03-19-2008
Posted by Ben Bullock on March 19, 2008, 8:41 pm
Please log in for more thread options
On Thu, 20 Mar 2008 00:06:39 +0000, Uri Guttman wrote:
>>>>>> writes:

> RH> the only array I really need is the entire 96-character
> RH> character set.

my @x = map chr, 33..127;

> typing in the alphabet is more error prone than just 'a' and 'z'.

Well, typing the entire alphabet in one go certainly is error-prone if
you're six or seven years old. But eight year olds or above probably can
handle it.


Posted by Ben Bullock on March 19, 2008, 8:50 pm
Please log in for more thread options
On Thu, 20 Mar 2008 00:41:13 +0000, Ben Bullock wrote:

>> RH> the only array I really need is the entire 96-character RH>
>> character set.
>
> my @x = map chr, 33..127;

Sorry, I forgot you wanted tab and space:

my @x = map chr, 9,32..126;

Also included 127 by mistake.

Should have looked more carefully at http://www.asciitable.com/.

Sorry!



Posted by John Bokma on March 19, 2008, 10:22 pm
Please log in for more thread options

> On Thu, 20 Mar 2008 00:06:39 +0000, Uri Guttman wrote:
>>>>>>> writes:
>
>> RH> the only array I really need is the entire 96-character
>> RH> character set.
>
> my @x = map chr, 33..127;
>
>> typing in the alphabet is more error prone than just 'a' and 'z'.
>
> Well, typing the entire alphabet in one go certainly is error-prone if
> you're six or seven years old. But eight year olds or above probably can
> handle it.


I LOLed at your reply to this one :-D

--
John

http://johnbokma.com/

Posted by Ben Morrow on March 20, 2008, 1:35 am
Please log in for more thread options

>
> Now, I just need to figure out how to do random permutations
> of arrays...

use List::Util qw/shuffle/;

my @random = shuffle 0..40;

Ben


Posted by Jonathan Clark on April 4, 2008, 8:50 am
Please log in for more thread options
On Thu, 20 Mar 2008 18:10:30 -0800, Robbie Hatley wrote:

>
> Given program X....
> in Cobol: 857 pages
> in C: 37 pages
> in C++: 5 pages
> in APL: @&*%@#*$%*(%^*&@#*&%#@ (1/4 line of gibberish) In Perl:
> JustDo($what_I_mean)
> or die "Sorry, Dave, I'm afraid I can't do that!";

Would you mind if I grabbed that for my sigmonster?


--
Clarjon1

Proud Linux User.
PCLinuxOS on Dell Inspiron 1501,1 Gig ram,80 Gig Hard drive
1.7gHz AMD Athlon 64bit dualcore processor
Contact:
Gmail/gtalk: clarjon1
irc: #pclinuxos,#pclinuxos-support,##linux on freenode
The Abrams' Principle:
        The shortest distance between two points is off the wall.

Similar ThreadsPosted
Re: Is substr only way of getting nth character of string? March 19, 2008, 7:14 am
FAQ 4.31 How can I split a [character] delimited string except when inside [character]? January 18, 2005, 12:03 am
FAQ 4.31 How can I split a [character] delimited string except when inside [character]? April 10, 2005, 5:03 pm
FAQ 4.31 How can I split a [character] delimited string except when inside [character]? June 26, 2005, 11:03 am
FAQ 4.31 How can I split a [character] delimited string except when inside [character]? September 19, 2005, 10:03 pm
FAQ 4.31 How can I split a [character] delimited string except when inside [character]? December 7, 2005, 5:03 pm
FAQ 4.31 How can I split a [character] delimited string except when inside [character]? April 16, 2006, 3:03 pm
FAQ 4.31 How can I split a [character] delimited string except when inside [character]? May 25, 2006, 3:03 pm
FAQ 4.31 How can I split a [character] delimited string except when inside [character]? June 19, 2006, 3:03 pm
FAQ 4.31 How can I split a [character] delimited string except when inside [character]? July 30, 2006, 3:03 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap