Hello Dave,
here's your bug:
> while (($game_id, @teams) = each %fixture) {
> print "Game=$game_id Home=$teams[0]\n";
> }
I guess you thought that @teams would get an arry of
values. Instead, the array is assigned one array reference.
To access the array elements from a referenc
The values in %fixture are not arrays. They are references to arrays.
You have to dereference them.
Here are a few ways you could do it:
###
while(($game_id,$teamref) = each %fixture){
#calling the array element using the reference
print "G
Hello perlfolk.
Goal: Create a hash of arrays where
hash key = match number
array[0] = home team
array[1] = away team
and then retrieve the teams by retrieving all the keys
while ( @fixture_rec = $sth->fetchrow_array ) {
my $game_id = $fixture_rec[0];
p
Jose Nyimi wrote:
>
>>-Message d'origine-
>>De : John W. Krahn [mailto:[EMAIL PROTECTED]
>>Envoyé : jeudi 22 septembre 2005 23:26
>>À : Perl Beginners
>>Objet : Re: Is it possible to force a particular order in a hash?
>>
>>
>>Dave Adams wrote:
>>
>>>I have a hash that I need to use later
> -Message d'origine-
> De : John W. Krahn [mailto:[EMAIL PROTECTED]
> Envoyé : jeudi 22 septembre 2005 23:26
> À : Perl Beginners
> Objet : Re: Is it possible to force a particular order in a hash?
>
>
> Dave Adams wrote:
> > I have a hash that I need to use later and display some val
Dave Adams wrote:
> I have a hash that I need to use later and display some values in a
> particular order. Perl comes up with its own way of ordering it but I
> am wondering if I can instruct perl to have it listed in the way that
> I want.
You could store the ordered keys in a separate array or
On Sep 22, Dave Adams said:
I have a hash that I need to use later and display some values in a
particular order. Perl comes up with its own way of ordering it but I
am wondering if I can instruct perl to have it listed in the way that
I want.
You can use Tie::IxHash (or Tie::IxHash::Easy if
Waldemar Jankowski wrote:
> On Thu, 22 Sep 2005, Dave Adams wrote:
>
>> I have a hash that I need to use later and display some values in a
>> particular order. Perl comes up with its own way of ordering it but
>> I am wondering if I can instruct perl to have it listed in the way
>> that I want.
On Thu, 22 Sep 2005, Dave Adams wrote:
> I have a hash that I need to use later and display some values in a
> particular order. Perl comes up with its own way of ordering it but I
> am wondering if I can instruct perl to have it listed in the way that
> I want.
>
> Here is the code
>
>
> #!/u
Please bottom post...
Please group reply so others can help and be helped...
O'Brien, Bill wrote:
> Thanks I think that work but know it appears I lost /bin/sh, error below
> any ideas?
>
> [EMAIL PROTECTED]:~/.cpan/sources/modules/Crypt-RSA-1.56$ which sh
> sh: Command not found.
> [EMAIL PROTEC
I have a hash that I need to use later and display some values in a
particular order. Perl comes up with its own way of ordering it but I
am wondering if I can instruct perl to have it listed in the way that
I want.
Here is the code
#!/usr/bin/perl -w
use strict;
my $page = {
AUTHOR=>"John
On Sep 22, Michael Gale said:
Jeff 'japhy' Pinyan wrote:
On Sep 22, Michael Gale said:
I have the following line of code and I believe it is correct, but it is
not doing what I am expecting it to do:
Config file
[test]
value=^OK$i
The problem is that '^OK$i' as a string turned into a reg
I was hoping that $ would mean the end of the string and "i" would mean
case insensitive :(
Michael
Jeff 'japhy' Pinyan wrote:
On Sep 22, Michael Gale said:
I have the following line of code and I believe it is correct, but it
is not doing what I am expecting it to do:
Config file
[tes
Are there any way to set the charcter coding for output from the
backtick operator.
I failed to split the output of a tool that generates lines (in
utf-16) of the following
format : "key" = "key"
The left instance is an unlocalized string, the write one will
ususally be localized.
Splitting
On Sep 22, John W. Krahn said:
The if statement modifier is just another way to write a logical and statement:
$ perl -MO=Deparse -e' display_nothing() if $match_type eq q/none/ '
display_nothing() if $match_type eq 'none';
-e syntax OK
$ perl -MO=Deparse -e' $match_type eq q/none/ and display_
Frank Geueke, III wrote:
> Hi everyone.
Hello,
> Okay, so maybe this one is a silly question. I have a
> fairly large script and I have a bunch of places where
> I'm following a reverse if with a normal else and perl
> keeps complaining about it. It seems to make sense to
> me, but I guess its
On Sep 22, Michael Gale said:
I have the following line of code and I believe it is correct, but it is not
doing what I am expecting it to do:
Config file
[test]
value=^OK$i
The problem is that '^OK$i' as a string turned into a regex is a regex
that can never match. The '$' is the end-of-s
Hello,
I have the following line of code and I believe it is correct, but it is
not doing what I am expecting it to do:
Config file
[test]
value=^OK$i
$regex=$Config->get('test.value');
chomp ($regex);
$regex=qr/$regex/;
Frank Geueke, III wrote:
> Hi everyone.
> Okay, so maybe this one is a silly question. I have a
> fairly large script and I have a bunch of places where
> I'm following a reverse if with a normal else and perl
> keeps complaining about it. It seems to make sense to
> me, but I guess its bad synta
On Sep 22, Frank Geueke, III said:
display_nothing() if ($match_type eq 'none');
else
{
}
Now I like the reverse if because it takes up one line
instead of four (I like braces on their own lines -
see else). But this error...
syntax error at
/usr2/login/fjg/hotspot_tracker/search_by_ip_or_mac
Hi everyone.
Okay, so maybe this one is a silly question. I have a
fairly large script and I have a bunch of places where
I'm following a reverse if with a normal else and perl
keeps complaining about it. It seems to make sense to
me, but I guess its bad syntax. Here is one of them:
display_not
21 matches
Mail list logo