Re: Characters

2011-08-02 Thread Shawn H Corey
On 11-08-02 01:26 PM, Brandon McCaig wrote: By then I just had to find the official documentation for the feature to satisfy my curiosity. :\ Yes, it's the bane of restful nights and many a dead cat. :) -- Just my 0.0002 million dollars worth, Shawn Confusion is the first step of unde

Re: Characters

2011-08-02 Thread Brandon McCaig
On Mon, Aug 1, 2011 at 6:29 PM, Jim Gibson wrote: > Dr. Ruud is demonstrating the little-known but documented feature of Perl > that the explicit empty regex // repeats the last, successful regex within > its scope. Thus, in Dr. Ruud's sample program, the line > >  my @result = $text =~ //g; > > i

Re: Characters

2011-08-02 Thread Rob Dixon
On 01/08/2011 23:29, Jim Gibson wrote: On 8/1/11 Mon Aug 1, 2011 11:20 AM, "Rob Dixon" scribbled: On 01/08/2011 19:00, Dr.Ruud wrote: On 2011-08-01 15:52, Shlomi Fish wrote: To convert a string to characters one can use split based on the empty regex, That should be "a pattern matching t

Re: Characters

2011-08-01 Thread Emeka
Rob, I have already picked up those functions. I think they are virtually the same in all languages. Thanks Emeka On Mon, Aug 1, 2011 at 6:21 PM, Rob Dixon wrote: > On 01/08/2011 13:14, Emeka wrote: > >> >> I would like to know how to access character from string lateral. >> >> Say I have >> $

Re: Characters

2011-08-01 Thread Emeka
Brian, Thanks for re-directing me back to my original question, and thank again for your well researched comment. I intend to dig deeper into string...hopefully know a bit of the internals. Emeka On Tue, Aug 2, 2011 at 3:39 AM, Brian Fraser wrote: > On Mon, Aug 1, 2011 at 9:14 AM, Emeka wrote

Re: Characters

2011-08-01 Thread Brian Fraser
On Mon, Aug 1, 2011 at 9:14 AM, Emeka wrote: > > In some languages string type is just array/list of characters. What is it > in Perl? > > There's no string type in Perl, internals notwithstanding. There's scalars, and a scalar can hold a string - If you care to dig deeper, that string is stored

Re: Characters

2011-08-01 Thread Jim Gibson
On 8/1/11 Mon Aug 1, 2011 11:20 AM, "Rob Dixon" scribbled: > On 01/08/2011 19:00, Dr.Ruud wrote: >> On 2011-08-01 15:52, Shlomi Fish wrote: >> >>> To convert a string to characters one can use split based on the empty >>> regex, >> >> That should be "a pattern matching the empty string". >>

Re: Characters

2011-08-01 Thread Rob Dixon
On 01/08/2011 19:00, Dr.Ruud wrote: On 2011-08-01 15:52, Shlomi Fish wrote: To convert a string to characters one can use split based on the empty regex, That should be "a pattern matching the empty string". The "empty regex" works differently: perl -wle ' my $text = "abcdefghi"; $text =~ /

Re: Characters

2011-08-01 Thread Dr.Ruud
On 2011-08-01 15:52, Shlomi Fish wrote: To convert a string to characters one can use split based on the empty regex, That should be "a pattern matching the empty string". The "empty regex" works differently: perl -wle ' my $text = "abcdefghi"; $text =~ /[aeiou]/; $text =~ /x/; my @r

Re: Characters

2011-08-01 Thread Rob Dixon
On 01/08/2011 13:14, Emeka wrote: I would like to know how to access character from string lateral. Say I have $foo = "From Big Brother Africa"; I would want to print each of the characters of $foo on its own. In some languages string type is just array/list of characters. What is it in Perl?

Re: Characters

2011-08-01 Thread Emeka
Shlomi, Yea, that makes sense now. Emeka On Mon, Aug 1, 2011 at 2:52 PM, Shlomi Fish wrote: > On Mon, 1 Aug 2011 13:49:22 +0100 > AKINLEYE wrote: > > > my @characters = split /[\s]/, $foo; > > foreach my $letter(@characters ) > > { > >print $letter ; > > > > } > > > > or > > > > my @char

Re: Characters

2011-08-01 Thread Shlomi Fish
On Mon, 1 Aug 2011 13:49:22 +0100 AKINLEYE wrote: > my @characters = split /[\s]/, $foo; > foreach my $letter(@characters ) > { >print $letter ; > > } > > or > > my @characters = split /[\s]/, $foo; > print join("\n" , @characters); > That won't work because split/[\s]/ will split the

Re: Characters

2011-08-01 Thread Emeka
John, Thanks and thanks :) Emeka On Mon, Aug 1, 2011 at 2:45 PM, John W. Krahn wrote: > Emeka wrote: > >> Hello All, >> > > Hello, > > > I would like to know how to access character from string lateral. >> >> Say I have >> $foo = "From Big Brother Africa"; >> I would want to print each of the

Re: Characters

2011-08-01 Thread John W. Krahn
Emeka wrote: Hello All, Hello, I would like to know how to access character from string lateral. Say I have $foo = "From Big Brother Africa"; I would want to print each of the characters of $foo on its own. In some languages string type is just array/list of characters. What is it in Perl?

Re: Characters

2011-08-01 Thread AKINLEYE
my @characters = split /[\s]/, $foo; foreach my $letter(@characters ) { print $letter ; } or my @characters = split /[\s]/, $foo; print join("\n" , @characters); Untested code though. OP Hello All, I would like to know how to access character from string lateral. Say

Re: Characters

2011-08-01 Thread Shawn H Corey
On 11-08-01 08:14 AM, Emeka wrote: Hello All, I would like to know how to access character from string lateral. Say I have $foo = "From Big Brother Africa"; I would want to print each of the characters of $foo on its own. In some languages string type is just array/list of characters. What is

Re: characters encode

2009-12-16 Thread Shlomi Fish
On Wednesday 16 Dec 2009 13:49:19 Xiao Lan (小兰) wrote: > Hello, > > What's the standard way to encode a whole document to utf8 (or other > encoding mode)? > > For example, I want to encode a document which is gb2312 encoded > originally to utf8, I could do: > > perl -MEncode -ne 'print encode("u

Re: Characters from encryption

2007-03-04 Thread Dr.Ruud
"Ned Cunningham" schreef: > The character is a right arrow? When I read it I only get up to that > character. The remaining characters are dropped. MSDOS-text-mode, Ctrl-Z? -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: Characters from encryption

2007-02-28 Thread Neal Clark
You do have some issues with characters. they are called newlines. and carriage returns. hehe, just kidding. show us some code. -n On Feb 28, 2007, at 6:44 AM, Ned Cunningham wrote: Hi all. I have an issue with some characters passed back or read to a file. The character is a right

Re: Characters from encryption

2007-02-28 Thread Chas Owens
On 2/28/07, Ned Cunningham <[EMAIL PROTECTED]> wrote: I have an issue with some characters passed back or read to a file. Without knowing what your code looks like, the ord value of the character, and what system you are running on (is EBCDIC, ascii, or some other character set?) it is doubtful

Re: Characters instead of regex patterns

2002-11-24 Thread Jenda Krynicky
From: "Jason Rauer" <[EMAIL PROTECTED]> > Say I have: > > foreach $string (@strings) { > if ($text =~ /$string/) { ... } > } > > Now, it happens that the data in $string contains \|()[{$^*.? etc. > that turn into regex metacharacters within m// but I want to match > them by their literal value,

Re: Characters instead of regex patterns

2002-11-23 Thread John W. Krahn
Jason Rauer wrote: > > Say I have: > > foreach $string (@strings) { > if ($text =~ /$string/) { ... } > } > > Now, it happens that the data in $string contains \|()[{$^*.? etc. that turn > into regex metacharacters within m// but I want to match them by their > literal value, not as a regex pa

Re: Characters instead of regex patterns

2002-11-23 Thread Wiggins d'Anconia
You should be able to \ them just like any other character, if that isn't working you might try backslashing the \. Aka, \\ or even . http://danconia.org Mystik gotan wrote: Maybe you should use a foreach loop spitting every character and then parsing the \ in front of it? Sincerly, Bob

Re: Characters instead of regex patterns

2002-11-23 Thread Mystik gotan
Maybe you should use a foreach loop spitting every character and then parsing the \ in front of it? Sincerly, Bob Erinkveld (Webmaster Insane Hosts) www.insane-hosts.net From: "Jason Rauer" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Characters instead of regex patterns Date: Sat, 2

Re: Characters instead of regex patterns

2002-11-23 Thread Paul Johnson
On Sat, Nov 23, 2002 at 10:45:40AM +, Jason Rauer wrote: > Say I have: > > foreach $string (@strings) { > if ($text =~ /$string/) { ... } > } > > Now, it happens that the data in $string contains \|()[{$^*.? etc. that > turn into regex metacharacters within m// but I want to match them by