On May 4, 2008, at 17:01, Dr.Ruud wrote:
snip
Ah-ha, perlre is wrong then. It claims that space is 'A GNU extension
equivalent to [ \t] , "all horizontal whitespace"', but that must
only
be true under the bytes pragma.
s/claims that space is/claims that blank is/
Be careful with using the b
"Chas. Owens" schreef:
> Dr.Ruud:
>> Chas:
>>> Is there a reason I am missing to use [[:blank:]] over [ \t]?
>>
>> The [:blank:] matches (at least) 18 codepoints. unicount.pl:
>>
http://www.nntp.perl.org/group/perl.perl5.porters/2007/02/msg121080.html
>>
>> I prefer some of the named ones, like
On Sun, May 4, 2008 at 2:25 PM, Dr.Ruud <[EMAIL PROTECTED]> wrote:
snip
> > Is there a reason I am missing to use [[:blank:]] over [ \t]?
>
> The [:blank:] matches (at least) 18 codepoints. unicount.pl:
> http://www.nntp.perl.org/group/perl.perl5.porters/2007/02/msg121080.html
>
> I prefer some
Chas. Owens schreef:
> Dr.Ruud:
>> $value{ $1 } = $2 while m/^(\S+)[[:blank:]]+(\S+)/mg;
>> or even
>> $value{ $1 } = $2 while m/^(\S+)[[:blank:]]*(\S*)/mg;
>
> Is there a reason I am missing to use [[:blank:]] over [ \t]?
The [:blank:] matches (at least) 18 codepoints. unicount.pl:
On Sat, May 3, 2008 at 6:40 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote:
snip
> $value{ $1 } = $2 while m/^(\S+)[[:blank:]]+(\S+)/mg;
>
> or even
>
> $value{ $1 } = $2 while m/^(\S+)[[:blank:]]*(\S*)/mg;
snip
Is there a reason I am missing to use [[:blank:]] over [ \t]?
--
Chas. Owens
won
"Dr.Ruud" schreef:
> Richard Lee:
>> my $fgh =~ /fgh\s+(\S+)/;
>> my $ijk =~ /ijk\s+(\S+)/;
>> my $lmk =~ /lmk\s+(\S+)/;
>
> You might want to use a hash:
>
> $fil{$1} = $2 while m/\b(fgh|ijk|lmk)\s+(\S+)/g;
Looking at your input data, you could also do:
$value{ $1 } =
Hi Richard,
Your right, that won't actually work. I wasn't paying very close attention was
I? It'd have to be something like this to actually work:
my ($fgh) = $_ =~ /fgh\s+(\S+)/;
-J
--
On Fri, May 02, 2008 at 06:26:52PM -0400, Richard Lee wrote:
> Joshua Hoblitt wrote:
> >Richard,
> >
> >Th
On Fri, May 2, 2008 at 9:48 PM, Richard Lee <[EMAIL PROTECTED]> wrote:
snip
> Chas, does this mean as long as we don't call another sub from the block we
> declare local, we should be good. Correct?
> I like using local on some of these variables.. for some reason. Most
> likely due to mislea
Chas. Owens wrote:
On Fri, May 2, 2008 at 5:08 PM, Joshua Hoblitt <[EMAIL PROTECTED]> wrote:
snip
They are probably undefinately because the record seperator is being set
lexically inside of the loop (and thus won't apply to the outer while). Please
consider this code:
local $/ = "\
On Fri, May 2, 2008 at 5:08 PM, Joshua Hoblitt <[EMAIL PROTECTED]> wrote:
snip
> They are probably undefinately because the record seperator is being set
> lexically inside of the loop (and thus won't apply to the outer while).
> Please
> consider this code:
>
>
> local $/ = "\n\n";
snip
Richard,
The unitalized warnings are probably coming from one or more of $fgh, $ijk,
$lmk being undefined because the regex failed to match anything. You can test
this by trying to print the values of these variables.
They are probably undefinately because the record seperator is being set
lexic
Richard Lee schreef:
> while () {
> local $/ = "\n\n";
> ++$count;
That $count is already in $. (see perlvar)
> my $fgh =~ /fgh\s+(\S+)/;
> my $ijk =~ /ijk\s+(\S+)/;
> my $lmk =~ /lmk\s+(\S+)/;
You might want to use a hash:
$fil{$1} = $2 while m/\b(fgh|ijk|lmk)\s+(\
Chas. Owens wrote:
On Fri, May 2, 2008 at 5:55 PM, Richard Lee <[EMAIL PROTECTED]> wrote:
snip
while () {
local $/ = "\n\n";
snip
}
snip
You want $/ to have an effect on , but it is localized to inside
of the loop. You need to say
{
local $/ = "\n\n";
while ()
On Fri, May 2, 2008 at 5:55 PM, Richard Lee <[EMAIL PROTECTED]> wrote:
snip
> while () {
>local $/ = "\n\n";
snip
> }
snip
You want $/ to have an effect on , but it is localized to inside
of the loop. You need to say
{
local $/ = "\n\n";
while () {
}
}
--
Chas. Owens
wonkden.
14 matches
Mail list logo