In my most recent postings, I was dealing with first HoA and now HoH.
In my previous example code, I ended up with an output that looked
something like this:
jelly -- strawberry apple grape pear
jam -- strawberry apple grape
milk -- plain strawberry chocolate
I thought I'd prefer to have it
John W. Krahn wrote:
M. Lewis wrote:
John W. Krahn wrote:
my %HoH;
while (my $line = ){
chomp $line;
my ($prod, $flavor) = split ' ', $line, 2;
$HoH{ $prod }{ $flavor } = ();
}
for my $i ( keys %HoH ) {
print "$i -- @{[ keys %{$HoH{$i}} ]}\n";
}
Does it matter that the value
M. Lewis wrote:
> John W. Krahn wrote:
>>
>> my %HoH;
>>
>> while (my $line = ){
>> chomp $line;
>> my ($prod, $flavor) = split ' ', $line, 2;
>> $HoH{ $prod }{ $flavor } = ();
>> }
>>
>> for my $i ( keys %HoH ) {
>> print "$i -- @{[ keys %{$HoH{$i}} ]}\n";
>> }
>
> Does it matter
Hi I have a series of HTML tags in one file and want to convert to a DOC
file how is it possible. Do we have any specific modules
For Ex:
Read a HTML file write to a document
Read the Second HTML file and write to the same document (Append)
Thanks
Anish
--
To unsubscribe, e-mail: [EMAIL PROTEC
John W. Krahn wrote:
my %HoH;
while (my $line = ){
chomp $line;
my ($prod, $flavor) = split ' ', $line, 2;
$HoH{ $prod }{ $flavor } = ();
}
for my $i ( keys %HoH ) {
print "$i -- @{[ keys %{$HoH{$i}} ]}\n";
}
Does it matter that the value of the HoH is undef?
jelly -- straw
John W. Krahn wrote:
M. Lewis wrote:
I'm still experimenting with the HoA from a couple of days ago. I just
realized there is the possibility for having duplicate elements of the
array. How do I prevent that?
Use a hash instead of an array.
Thank you John. I wondered about that as I was c
M. Lewis wrote:
>
> I'm still experimenting with the HoA from a couple of days ago. I just
> realized there is the possibility for having duplicate elements of the
> array. How do I prevent that?
Use a hash instead of an array.
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use Data::Du
I'm still experimenting with the HoA from a couple of days ago. I just
realized there is the possibility for having duplicate elements of the
array. How do I prevent that?
Thanks,
Mike
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper::Simple;
my %HoA;
while (my $line = ){
c
Alan Campbell schreef:
> [attribution repaired] Ricardo:
>> [attribution repaired] Ruud:
[quote characters fixed]
>>>while $. <= 4;
>>
>> $. is not well-known to many Perl programmers.
I don't think you are right. And it was used in the original posting.
>>for 1 .. 4;
>
> thanks. Abov
From: "Beginner" <[EMAIL PROTECTED]>
> Hi All (and a happy holiday to those that will get a break),
>
> I am trying to read in an XML file of addresses. I need to remove all
> the address data from the file where code =~ /^000/ (there are none in
> the example data below). I need to reproduce that
I sent a message to the list already mentioning that after checking
perldoc -f split one more time I found where it mentioned using a quoted
literal space as the matching pattern. For some reason, it seems that
nobody saw the message, because I have seen several messages so far
quoting the releva
On Thu, 28 Dec 2006 09:53:05 +0100
"Tatiana Lloret Iglesias" <[EMAIL PROTECTED]> wrote:
> Thanks Owen,
> but in this case, inspecting the html page i see that the button hasn't got
> NAME attribute but only VALUE that's why i've used value command.
> The strange thing is that to pass from page 1
>while $. <= 4;
$. is not well-known to many Perl programmers.
for 1 .. 4;
>>> thanks. Above solution is simple & effective. I agree that I was
>>> gratuitously using $. when your solution is far easier to document and
>>> probably safer in my program since I have several filehandles op
Okies... yeah ..later I changed it to glob() and it worked, but I was little
bit concerned why it works with switch module. Nevertheless, I have had
wierd troubles with Switch module in past ...
Thanks
Madhur
On 12/28/06, Mumia W. <[EMAIL PROTECTED]> wrote:
On 12/28/2006 01:42 AM, Madhur Kashy
On 12/28/2006 01:42 AM, Madhur Kashyap wrote:
Hi there,
Have a look at these two different implementations. IMPL2 works somehow.
The
problem I am facing is that the glob <$pat> does not return any value in
IMPL1 but it returns in IMPL2. Can somebody tell what could be the problem.
[...]
Use
Chad Perrin schreef:
> [split works differently with ' ', /\s/, /\s+/]
> Why doesn't perldoc -f split say anything about that? Never mind, I
> guess that's a rhetorical question.
It is all in the documentation:
[...] By default, empty leading fields are preserved, and
empty trailing ones a
Igor Sutton wrote:
2006/12/28, Chad Perrin <[EMAIL PROTECTED]>:
On Thu, Dec 28, 2006 at 03:31:36AM -0500, M. Lewis wrote:
>
> Chad, I've been experimenting with this a bit since your posting. Maybe
> this will help: (I'm trying to understand the diff too)
>
> perl -le'
> my $ln = "one two thr
On Thu, Dec 28, 2006 at 02:01:54AM -0700, Chad Perrin wrote:
>
> Why doesn't perldoc -f split say anything about that? Never mind, I
> guess that's a rhetorical question.
Igor just pointed out to me that it is, in fact, in perldoc -f split,
and I just managed to miss it when I looked through it
On Thu, Dec 28, 2006 at 08:51:26AM +, Igor Sutton wrote:
> 2006/12/28, Chad Perrin <[EMAIL PROTECTED]>:
> >
> >That makes sense, considering I just checked the tutorials at PerlMonks
> >and discovered that, according to split(), ' ' and /\s+/ are exactly the
> >same. Frankly, I find that a bit
Thanks Owen,
but in this case, inspecting the html page i see that the button hasn't got
NAME attribute but only VALUE that's why i've used value command.
The strange thing is that to pass from page 1 to page 2 it works but to
pass from page 2 to page 3 it fails ... although the code is the same
2006/12/28, Chad Perrin <[EMAIL PROTECTED]>:
On Thu, Dec 28, 2006 at 03:31:36AM -0500, M. Lewis wrote:
>
> Chad, I've been experimenting with this a bit since your posting. Maybe
> this will help: (I'm trying to understand the diff too)
>
> perl -le'
> my $ln = "one two three four ";
> print
Hi Chad,
2006/12/28, Chad Perrin <[EMAIL PROTECTED]>:
[snip]
Actually, on second thought, I seem to recall that ' ' has a meaning in
split() beyond a literal space. Unfortunately, I don't recall exactly
what that is. I've tried looking it up using perldoc -f split and in
several books I ha
On Thu, Dec 28, 2006 at 03:31:36AM -0500, M. Lewis wrote:
>
> Chad, I've been experimenting with this a bit since your posting. Maybe
> this will help: (I'm trying to understand the diff too)
>
> perl -le'
> my $ln = "one two three four ";
> print map " |$_| ", split /\s/, $ln;
> print map "
Hi Madhur,
2006/12/28, Madhur Kashyap <[EMAIL PROTECTED]>:
Hi there,
Have a look at these two different implementations. IMPL2 works somehow.
The
problem I am facing is that the glob <$pat> does not return any value in
IMPL1 but it returns in IMPL2. Can somebody tell what could be the
problem
Chad Perrin wrote:
John W. Krahn wrote:
M. Lewis wrote:
while (my $ln = ){
chomp $ln;
my ($prod, $flavor) = split /\s/, $ln, 2;
You probably should use ' ' instead of /\s/ as the first argument to split:
my ($prod, $flavor) = split ' ', $ln, 2;
Ok, but why? Are they not the same?
On Thu, Dec 28, 2006 at 08:46:25AM +0100, Tatiana Lloret Iglesias wrote:
> Hi!
> I'm executing this perl and I get an error in this line_
> $browser2->click_button( value => "Next 25 records");
>
> but i dont understand why because Next 25 records button exists!!
> Can you help me with this please
26 matches
Mail list logo