What is "or equal" in perl? Thanks

P

perlie_newbie

What is "or equal" in perl? Thanks

Eg:

my %vacadb;

my $vacadb =
tie(%vacadb,'DB_File',"$Vaca_dir/.$username.db",O_RDWR|O_CREAT,0666) ||
die "Cannot open vacation database: $!\n";

$vacadb{$sendto} ||= 0;
 
J

John W. Krahn

perlie_newbie said:
What is "or equal" in perl? Thanks

Eg:

my %vacadb;

my $vacadb =
tie(%vacadb,'DB_File',"$Vaca_dir/.$username.db",O_RDWR|O_CREAT,0666) ||
die "Cannot open vacation database: $!\n";

$vacadb{$sendto} ||= 0;

That is short for:

$vacadb{$sendto} = $vacadb{$sendto} || 0;

Which assigns $vacadb{$sendto} to $vacadb{$sendto} if $vacadb{$sendto} is TRUE
or assigns 0 to $vacadb{$sendto} if $vacadb{$sendto} is FALSE where FALSE can
be undef, 0, '' or '0'.



John
 
M

Mumia W.

perlie_newbie said:
[a multi-posted question]

This question was multiposted to PB. Please burn this thread.

Perl-beginner is a totally different forum. It's acceptable to
post the same message in different forums because there's not
guarantee that a person who subscribes to one forum is also
subscribed to the other.

While multi-posting to the same forum (e.g. usenet/usenet)
might be improper, multi-posting to different forums is simply
like talking with different groups of people, and it is not
improper.

And the question has been answered anyway:
http://groups.google.com/groups?selm=UQOyg.179449$771.25101@edtnps89

IOW,

$var ||= 9;
is the same as saying
$var = $var || 9;
 
P

perlie_newbie

Thanks folks.

I confused that I have post the same question in perl beginner.
Sorry for the confusing / "anger" that I have caused.


ok. ok. beer on me went you come to Singapore.


Thanks.







perlie_newbie said:
[a multi-posted question]

This question was multiposted to PB. Please burn this thread.

Perl-beginner is a totally different forum. It's acceptable to
post the same message in different forums because there's not
guarantee that a person who subscribes to one forum is also
subscribed to the other.

While multi-posting to the same forum (e.g. usenet/usenet)
might be improper, multi-posting to different forums is simply
like talking with different groups of people, and it is not
improper.

And the question has been answered anyway:
http://groups.google.com/groups?selm=UQOyg.179449$771.25101@edtnps89

IOW,

$var ||= 9;
is the same as saying
$var = $var || 9;
 
P

perlie_newbie

Oops.

Should be " I confessed..."


perlie_newbie said:
Thanks folks.

I confused that I have post the same question in perl beginner.
Sorry for the confusing / "anger" that I have caused.


ok. ok. beer on me went you come to Singapore.


Thanks.







perlie_newbie wrote:

[a multi-posted question]

This question was multiposted to PB. Please burn this thread.

Perl-beginner is a totally different forum. It's acceptable to
post the same message in different forums because there's not
guarantee that a person who subscribes to one forum is also
subscribed to the other.

While multi-posting to the same forum (e.g. usenet/usenet)
might be improper, multi-posting to different forums is simply
like talking with different groups of people, and it is not
improper.

And the question has been answered anyway:
http://groups.google.com/groups?selm=UQOyg.179449$771.25101@edtnps89

IOW,

$var ||= 9;
is the same as saying
$var = $var || 9;
 
U

usenet

Mumia said:
Perl-beginner is a totally different forum. It's acceptable to
post the same message in different forums because there's not
guarantee that a person who subscribes to one forum is also
subscribed to the other.

Then crosspost if you feel you must. But never multipost. That's
always rude.
 
J

John W. Krahn

Then crosspost if you feel you must. But never multipost. That's
always rude.

This must be a Google thing because I have been a subscriber to the Perl
Beginners *Mailing* *List* for many years and I have not seen that post on the
list. Please keep your Google squabbles on Google and not on Usenet. TIA


John
 
M

Matt Garrish

perlie_newbie said:
[a multi-posted question]

This question was multiposted to PB. Please burn this thread.

Although I do enjoy a good bonfire, it would be more helpful to quote
the answer that was given there, or at least crosspost it here so that
it can be discussed in both places. There's nothing worse than a dead
thread that's supposedly answered elsewhere.

Matt
 
M

Mumia W.

Then crosspost if you feel you must. But never multipost. That's
always rude.

Then Mumia W. was about to say:
It is not possible to crosspost to both a usenet
newsgroup and a mailing-list.

Now I remember that the situation with
«beginners-perl[at]perl.org» is complicated. Beginners-perl
/is/ a mailing-list; however, it's reflected to usenet as
perl.beginner which is what you were talking about.

I originally thought you were talking about the mailing-list,
but now I see, using Google, that the OP did multipost to
perl.beginner as well as clp.misc--which is improper.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top