On 4/13/07, yitzle <[EMAIL PROTECTED]> wrote:
snip
> @record{qw(firstName lastName field3 field4)} = split /\t/;
This line sorta confuses me.
Now record is treated as an array? An array element which is a hash?
On the next line, you push it as a hash onto @data. This makes an array of
hashes?
sn
BANG!
There's no need to assign names to array indices when you have Perl's hash
structure. Suppose your data is tab-separated, you could write:
my @data;
while (<>) {
my %record;
@record{qw(firstName lastName field3 field4)} = split /\t/;
push @data, \%record;
}
or something similar. No
yitzle wrote:
Rob Dixon wrote:
yitzle wrote:
Don't shoot me!
I can't find enum on the perldocs. Perl does have an enum, right?
How do I go about making an enum? I basically want a bunch of
variables to equal subsequent values, eg 0, 1, 2, ...
Perl doesn't provide enum nativ
The "problem" is thus.
I an reading in data and using split to get it to an array.
Each element/column has a specific meaning, eg firstName, lastName etc
Rather than using [0], [1] I figured I could set up an enum($firstName,
$lastName, etc)
I suppose the alternative is to define (c
yitzle wrote:
Don't shoot me!
I can't find enum on the perldocs. Perl does have an enum, right?
How do I go about making an enum? I basically want a bunch of variables to
equal subsequent values, eg 0, 1, 2, ...
Perl doesn't provide enum natively. But it's a solution to a
Are you looking for C style enumerated types?
AFAIK,Perl doesn't have this built-in type.But you could get it on CPAN:
http://search.cpan.org/~zenin/enum-1.016/enum.pm
2007/4/13, yitzle <[EMAIL PROTECTED]>:
Don't shoot me!
I can't find enum on the perldocs. Perl does hav
Don't shoot me!
I can't find enum on the perldocs. Perl does have an enum, right?
How do I go about making an enum? I basically want a bunch of variables to
equal subsequent values, eg 0, 1, 2, ...
Thanks!
Not a vb person myself but would a hash do that then:
my %enum = (
ASSET => 1,
LIABILITY => 2,
EQUITY => 3,
REVENUE => 4,
EXPENSE => 5,
DIVIDEND => 6,
CONTRA_ASSET => 11,
);
Or is Vb's enum like mysql's enum? I ask since you where
doing a sel
Dan Muey wrote:
> In addtion to Rob's very sound advice it sound like you simply need an array:
>
> my @enum = qw(dhbold dhcaption dhend dhform);
>
> print $enum[0]; # prints dhbold
> print $enum[2]; # prints dbhend
>
> HTH
>
> DMuey
Sorry Dan,
I dn't th
> Remember these 3 words... search.cpan.org ;)
>
> http://search.cpan.org/search?query=enum&mode=all
>
> CPAN is always the best place to start looking for code.
>
> On the results page is looks like "enum" will do what you need.
>
> Rob
>
In addt
On Wednesday, August 27, 2003, at 02:35 PM, Harter, Douglas wrote:
Visual Basic has a construct called Enum which looks like so:
Enum namea
dhbold
dhcaption
dhend
dhform
.
end enum
What it essentially does is assign an incrementing numeric value to
each
Remember these 3 words... search.cpan.org ;)
http://search.cpan.org/search?query=enum&mode=all
CPAN is always the best place to start looking for code.
On the results page is looks like "enum" will do what you need.
Rob
-Original Message-
From: Harter, Douglas
Visual Basic has a construct called Enum which looks like so:
Enum namea
dhbold
dhcaption
dhend
dhform
.
end enum
What it essentially does is assign an incrementing numeric value to each
variable in the enum, so that
dhbold = 1
dhcaption = 2
dhend = 3
dh form
On 10/4/01 2:54 AM, "Rahul Garg" <[EMAIL PROTECTED]> wrote:
> what i want is :
>
> $s_month can be 1 to 12
> if($s_month == 1){$s_month = 'JAN'};and so on
> how can i do it.
?
http://www.cpan.org/authors/id/S/SN/SNEEX/cal.perl_v2A
HTH/-Sx- :]
--
To unsubscribe, e-mail: [EMAIL PROTECT
)or enum
what i want is :
$s_month can be 1 to 12
if($s_month == 1){$s_month = 'JAN'};and so on
how can i do it.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
what i want is :
$s_month can be 1 to 12
if($s_month == 1){$s_month = 'JAN'};and so on
how can i do it.
16 matches
Mail list logo