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
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
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
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
>> $
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
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
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".
>>
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 =~ /
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
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?
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
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
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
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?
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
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
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
"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:
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
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
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,
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
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
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
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
25 matches
Mail list logo