I correct in thinking that Perl
evaluates an inline 'if' from right to left - meaning that if
$item->{optionprice} is NOT true, then the addition will not even be
seen? Or does Perl look at the entire line before performing it?
I'm not clear what you mean by an *inline* i
On Sep 17, 2014, at 3:32 PM, Rob Dixon wrote:
> As you have presented them, those code fragments are identical in meaning.
That was my understanding as well, but the inline 'if' gave an error
while the block didn't. Running the code by itself in TextWrangler does not
produce the warning
On 17/09/2014 01:37, SSC_perl wrote:
I just ran across something puzzling. Why are these two statements
not equivalent when it comes to warnings?
if ($item->{'optionprice'}) {
$item->{'unitprice'} += $item->{'optionprice'};
}
and
$item->{'unitprice'} += $item->{'optionprice'}
On 09/17/2014 12:46 PM, SSC_perl wrote:
> On Sep 16, 2014, at 6:58 PM,
> wrote:
>> Are you sure you've quoted the code (that's producing the warning) correctly?
>
> Yes, I did. I double-checked it just to be certain. However, I ran
> the code by itself and it doesn't produce that warni
On Sep 16, 2014, at 6:58 PM,
wrote:
> Are you sure you've quoted the code (that's producing the warning) correctly?
Yes, I did. I double-checked it just to be certain. However, I ran
the code by itself and it doesn't produce that warning, so it must be something
upstream that's caus
-Original Message-
From: SSC_perl
Sent: Wednesday, September 17, 2014 10:37 AM
To: Perl Beginners
Subject: Argument isn't numeric warning in if statement
I just ran across something puzzling. Why are these two statements not
equivalent when it comes to warnings?
if (
I just ran across something puzzling. Why are these two statements not
equivalent when it comes to warnings?
if ($item->{'optionprice'}) {
$item->{'unitprice'} += $item->{'optionprice'};
}
and
$item->{'unitprice'} += $item->{'optionprice'} if ($item->{'optionprice'});
2013/8/15 Brian Fraser :
> On Wed, Aug 14, 2013 at 6:09 PM, Alexey Mishustin
>> I'm sorry only that there is no built-in option with which one could
>> enable/disable easily assignments inside `if'. (E.g., like re 'eval'/
>> no re 'eval'). It would "provide choices"...
>>
>
> It might not be too
igning it - I have never done this at the same
> >>> time...
> >>
> >>
> >>
> >> Doing both in while statements is very common:
> >>
> >>while( my $line = <$fh> ) {
> >> ...
> >>}
> >>
gt; Doing both in while statements is very common:
>>
>>while( my $line = <$fh> ) {
>> ...
>>}
>>
>> Try to write that loop with two separate statements, one an
>> assignment
>
> and the other an if statement, and you may see the
t loop with two separate statements, one an
assignment
and the other an if statement, and you may see the advantage of the
currently-allowed syntax.
The general policy is that assignment statements return a value that
may be further used or tested.
i have a common idiom when dealing with a
s, one an assignment and the
other an if statement, and you may see the advantage of the currently-allowed
syntax.
The general policy is that assignment statements return a value that may be
further used or tested.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional command
Thanks to all,
2013/8/14 Jim Gibson :
> The problem is that the construct
>
> if( $foo = $bar ) {
> ...
>
> is not always a typo. It means: "assign value of $bar to variable $foo and
> test if the result is logically true", which is perfectly valid. If that were
> not allowed, then you wo
Or maybe he can write a perl script to check the "if/while" conditionals of his
perl script...
while(<>){
say '= is detected where == is expected at line ',"$." if
/if\s*\(\S+?=[^=]/;
}
On 15 Aug 2013, at 03:02, Rob Dixon wrote:
> On 14/08/2013 18:21, Alexey Mishustin wrote:
>>
>> If
Hi Alex,
I guess it would be very difficult and error-prone to do it. Here's my thought:
my $bar = 3;
my $assign = (my $foo = $bar);
if($assign){
say '$assign=',$assign;
}
my $equal = ($foo == $bar);
if($equal){
say '$equal=',$equal;
}
output:
$ perl tst.pl
$assign=3
$equal=1
But if $
On 14/08/2013 18:21, Alexey Mishustin wrote:
If I make a typo and write a single "equals" operator here:
if ($foo = 2) {
print "yes\n";
}
...then the "warnings" pragma works OK and tells me "Found = in
conditional, should be ==..."
But if I make the same typo and write a single "equal
On Aug 14, 2013, at 11:34 AM, Alexey Mishustin wrote:
> Hi Jing,
>
> Thanks for the reply.
>
> So, there is no built-in way to catch these typos?
The problem is that the construct
if( $foo = $bar ) {
...
is not always a typo. It means: "assign value of $bar to variable $foo and test
i
Hi Jing,
Thanks for the reply.
So, there is no built-in way to catch these typos?
--
Regards,
Alex
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Hi there,
Allow me to correct myself, the value of the assignment is the new value of the
variable. But in the end it is the same. The compiler won't be able to see what
$bar is when used in if ($foo=$bar), therefore won't throw any warnings.
Cheers,
Jing
On 15 Aug 2013, at 01:21, Alexey Mishus
Hi Alexey,
If I remember correctly, when you assign a value to an lvalue like this:
$foo = 1;
The value of the assignment is the value on the right hand side of the equal
sign.
So when you do something like:
if ($foo=2){...}
It has the same effect as this:
$foo=2;
If (2){...}
The condition
Hello all,
If I make a typo and write a single "equals" operator here:
#!/usr/bin/perl
use strict;
use warnings;
my $foo = 1;
my $bar = 2;
if ($foo = 2) {
print "yes\n";
}
else {
print "no\n";
}
...then the "warnings" pragma works OK and tells me "Found = in
conditional, shoul
On 12-03-14 12:35 AM, John W. Krahn wrote:
cmp is a binary operator just like eq, ne, gt, lt, ge and le.
See `perldoc perlop` and search for /Equality Operators/
--
Just my 0.0002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about co
Noah wrote:
Hi there,
Hello,
I am trying to get two conditions matched
how can I get if ( ($source_location eq $destination_location ) && (
$source_device < $destination_device ) ) {
That should be:
if ( $source_location eq $destination_location && $source_device lt
$destination_device )
Hi there,
I am trying to get two conditions matched
how can I get if ( ($source_location eq
$destination_location ) && ( $source_device < $destination_device ) ) {
and
if ( ($source_location eq $destination_location ) && (
$source_device > $destination_device ) ) {
On Monday 20 September 2010 12:30:55 Raj wrote:
> Hi,
>
> I am a newbie for perl.
>
> It would be fine if some explain how the following code prints first
> 10 lines of the file.
> My question here is, how/what if condition match happens? Is there
> anything related to current record number ($.
Hi,
I am a newbie for perl.
It would be fine if some explain how the following code prints first
10 lines of the file.
My question here is, how/what if condition match happens? Is there
anything related to current record number ($.) variable?
while () {
print if 1 .. 10;
}
Regards,
Raj
On Wed, Apr 15, 2009 at 6:33 AM, John W. Krahn wrote:
> Robert Citek wrote:
>>
>> You probably want ($Lang == "fr")
>
> Probably not. You are using a numerical comparison on a string which will
> convert the string to a number so that is the same as saying: ($Lang == 0)
You are correct. Serves
On Wed, Apr 15, 2009 at 07:33, John W. Krahn wrote:
> Robert Citek wrote:
>>
>> On Wed, Apr 15, 2009 at 12:08 AM, Brian wrote:
>>>
>>> could someone please help me with this little problem?
>>> I am trying to include an if statement part way through
Robert Citek wrote:
On Wed, Apr 15, 2009 at 12:08 AM, Brian wrote:
could someone please help me with this little problem?
I am trying to include an if statement part way through printing.
When the program reaches the line if ($Lang = fr ) { print "
that line gets ignored and the cgi
You probably want ($Lang == "fr")
Regards,
- Robert
On Wed, Apr 15, 2009 at 12:08 AM, Brian wrote:
> could someone please help me with this little problem?
> I am trying to include an if statement part way through printing.
> When the program reaches the line if ($Lang = fr
Thomas Bätzler wrote:
Brian wrote:
could someone please help me with this little problem?
I am trying to include an if statement part way through printing.
When the program reaches the line if ($Lang = fr ) { print "
that line gets ignored and the cgi keeps going to the end.
thanks
Brian wrote:
> could someone please help me with this little problem?
> I am trying to include an if statement part way through printing.
> When the program reaches the line if ($Lang = fr ) { print "
> that line gets ignored and the cgi keeps going to the end.
&g
Hi,
could someone please help me with this little problem?
I am trying to include an if statement part way through printing.
When the program reaches the line if ($Lang = fr ) { print "
that line gets ignored and the cgi keeps going to the end.
thanks
Brian
#! c:\perl\bin\perl.exe -
On Sat, Mar 7, 2009 at 13:44, Octavian Râşniţă wrote:
> From: "Rick"
>>
>> my ($data) = $test_s =~ /(\[(.+)\]/;
>
> I think it contains a "(" that shouldn't be there (after =~ /).
>
>>> The code above assumes you want what is between the first and last
>>> brackets in $test_s. If the string c
From: "Rick"
my ($data) = $test_s =~ /(\[(.+)\]/;
I think it contains a "(" that shouldn't be there (after =~ /).
The code above assumes you want what is between the first and last
brackets in $test_s. If the string contains more than one set of
brackets you may want to say this instead
ork
$data = ($test_s =~ m/\[.+\]/); but does not work.. I tried @data too but
still don't work..
I want to assign what was matched directly into the variable without going
through if statement.
A regex returns all captures found when it is in list context, so if
you add a capture to your rege
s hoping something like this would work
>
> $data = ($test_s =~ m/\[.+\]/); but does not work.. I tried @data too but
> still don't work..
> I want to assign what was matched directly into the variable without going
> through if statement.
A regex returns all captures found when
a too
but still don't work..
I want to assign what was matched directly into the variable without
going through if statement.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
},
substr( $guide{ $guides }->{ 'start1' }, 0, 16 ),
$guide{ $guides }->{ 'start' },
substr( $guide{ $guides }->{ 'stop1' }, 0, 16 ),
$guide{ $guides }->{ 'stop' },
$guide{ $guides }->
guide{$guides}->{'Channel'},
substr($guide{$guides}->{'start1'},0,16),
$guide{$guides}->{'start'},
substr($guide{$guides}->{'stop1'},0,16),
$guide{$guides}->{'stop'},
$guide{$guides}->{'name'},
} keys %guide){
push
@{$listings},[$guide{$guides}->{'id'},$guide{$guides}->{'Channel'},substr($guide{$guides}->{'start1'},0,16),$guide{$guides}->{'start'},substr($guide{$guides}->{'stop1'},0,16),$guide{$guides}->{'stop&
if (! defined($myvar)) {
The NULL in the database is mapped to an undef.
Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
Thank yo
Huub <[EMAIL PROTECTED]> asked:
> I'm adapting a Perl script using MySQL connectivity, and have
> to compare a variable, e.g. $myvar, with the value NULL from
> the database. In MySQL, I have to use the query 'where myvar
> is null', which works great.
> But when I try this in Perl, like 'if ($
From: Huub <[EMAIL PROTECTED]>
> I'm adapting a Perl script using MySQL connectivity, and have to compare
> a variable, e.g. $myvar, with the value NULL from the database. In
> MySQL, I have to use the query 'where myvar is null', which works great.
> But when I try this in Perl, like 'if ($myva
Hi,
I'm adapting a Perl script using MySQL connectivity, and have to compare
a variable, e.g. $myvar, with the value NULL from the database. In
MySQL, I have to use the query 'where myvar is null', which works great.
But when I try this in Perl, like 'if ($myvar == null)' or 'if ($myvar
is nu
Jesse Farrell wrote:
Is there a way to have a variable recognized as a string even if it
contains a valid integer? I have a script that is taking strings from a
file that can be numbers, including zero. I have an if statement to
simply see if the variable exists (otherwise I need to throw an
arrell
Cc: beginners@perl.org
Subject: RE: Recognizing integer as string for if statement
Unless im being very stupid in what your requirements are
If(defined $variable && $variable ne "0") {
}
-Original Message-
From: Jesse Farrell [mailto:[EMAIL PROTECTED]
Sent: 14 Au
Unless im being very stupid in what your requirements are
If(defined $variable && $variable ne "0") {
}
-Original Message-
From: Jesse Farrell [mailto:[EMAIL PROTECTED]
Sent: 14 August 2007 21:18
To: beginners@perl.org
Subject: Recognizing integer as string for if s
Is there a way to have a variable recognized as a string even if it
contains a valid integer? I have a script that is taking strings from a
file that can be numbers, including zero. I have an if statement to
simply see if the variable exists (otherwise I need to throw an error),
and if the
On 5 Jul, 00:24, [EMAIL PROTECTED] (Ken Foskey) wrote:
> On Wed, 2007-07-04 at 19:00 +0200, Martin Barth wrote:
> > Hi
>
> > > if (($DeviceType eq "Switch") || ($DeviceType eq "Router") ||
> > > ($DeviceType eq "Hub") || ($DeviceType eq "Access point"))
>
> > > what i would like to do is check each
On Wed, 2007-07-04 at 19:00 +0200, Martin Barth wrote:
> Hi
>
> > if (($DeviceType eq "Switch") || ($DeviceType eq "Router") ||
> > ($DeviceType eq "Hub") || ($DeviceType eq "Access point"))
> >
> >
> > what i would like to do is check each device type with where the first
> > letter is uppercas
On Jul 4, 3:46 am, [EMAIL PROTECTED] (Daluk) wrote:
> I have a some code that reads in a file, and then i have some if
> statements. The if statement i want to change is
>
> if (($DeviceType eq "Switch") || ($DeviceType eq "Router") ||
> ($DeviceType eq &quo
Hi
> if (($DeviceType eq "Switch") || ($DeviceType eq "Router") ||
> ($DeviceType eq "Hub") || ($DeviceType eq "Access point"))
>
>
> what i would like to do is check each device type with where the first
> letter is uppercase or lowercase
this should help:
if( $DeviceType =~ m/^([Ss]witch|[Rr
Hi ppl,
I have a some code that reads in a file, and then i have some if
statements. The if statement i want to change is
if (($DeviceType eq "Switch") || ($DeviceType eq "Router") ||
($DeviceType eq "Hub") || ($DeviceType eq "Access point"))
what i wo
>>>>> ""Amichai" == "Amichai Teumim" <[EMAIL PROTECTED]> writes:
"Amichai> I need to sort the @array from lowest to highest using TWO loops and
"Amichai> ONE if statement. That's why it's so confusing.
"Amichai> I
On 7/3/07, Amichai Teumim <[EMAIL PROTECTED]> wrote:
I forgot to add what I have done so far. I did:
#!/usr/bin/perl
use strict;
use warnings;
my @array = (5,3,2,1,4);
my $n = @array;
for my $i (0 .. $n-1) {
for my $j (0 .. $n-1) {
if ($array[$j+1] < $array[$j]) { #compare the two
On Tuesday 03 July 2007 11:55, you wrote:
> OK. So I remove temp and I get this:
>
> Use of uninitialized value in numeric lt (<) at ./obj8-2.pl line 11.
> Use of uninitialized value in numeric lt (<) at ./obj8-2.pl line 11.
> Use of uninitialized value in numeric lt (<) at ./obj8-2.pl line 11.
> U
On 07/03/2007 02:53 AM, Amichai Teumim wrote:
Hi guys
Hello Amichai.
[...]
I need to sort the @array from lowest to highest using TWO loops and
ONE if statement. That's why it's so confusing.
I could use a one liner to do all this. I need to do it however as
above mentioned.
Ho
Hi
maybe this wikipedia article can show you different sorting algorithems:
http://en.wikipedia.org/wiki/Sorting_algorithm#Summaries_of_popular_sorting_algorithms
there are examples in pseudocode.
HTH, Martin
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
On Tuesday 03 July 2007 10:43, Amichai Teumim wrote:
> I forgot to add what I have done so far. I did:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my @array = (5,3,2,1,4);
> my $n = @array;
>
> for my $i (0 .. $n-1) {
>for my $j (0 .. $n-1) {
>if ($array[$j+1] < $array[$j])
I forgot to add what I have done so far. I did:
#!/usr/bin/perl
use strict;
use warnings;
my @array = (5,3,2,1,4);
my $n = @array;
for my $i (0 .. $n-1) {
for my $j (0 .. $n-1) {
if ($array[$j+1] < $array[$j]) { #compare the two neighbors
$tmp = $array[$j]; # swap
reach $elem (@array){
print "$elem";
}
I need to sort the @array from lowest to highest using TWO loops and
ONE if statement. That's why it's so confusing.
I could use a one liner to do all this. I need to do it however as
above mentioned.
How can I do this?
Why not Perl's
!/usr/bin/perl
>
> @array = (5,3,2,1,4);
>
> ## include your code here ##
>
> foreach $elem (@array){
> print "$elem";
> }
>
> I need to sort the @array from lowest to highest using TWO loops and
> ONE if statement. That's why it's so confusin
print "$elem";
}
I need to sort the @array from lowest to highest using TWO loops and
ONE if statement. That's why it's so confusing.
I could use a one liner to do all this. I need to do it however as
above mentioned.
How can I do this?
Thanks for all your help
Amihai
On 10/19/06, Robert Hicks <[EMAIL PROTECTED]> wrote:
I am currently building the IF statement like:
if ($project_name eq 'Proj1' || $project_name eq '' && $task_name eq '')
Because logical-and is higher precedence than logical-or, that
conditi
Robert Hicks wrote:
> I am currently building the IF statement like:
>
> if ($project_name eq 'Proj1' || $project_name eq '' && $task_name eq '')
>
>
> That works but I was wondering if I can do this:
>
> if ($project_name eq (
I am currently building the IF statement like:
if ($project_name eq 'Proj1' || $project_name eq '' && $task_name eq '')
That works but I was wondering if I can do this:
if ($project_name eq ('Proj1' || '') && $task_name eq
Jason Balicki wrote:
>
> This is a piece of code taken from a larger program.
>
> I'm trying to determine that the encryption succeded, but when
> I try to evaluate the code, it always evaluates false even though
> the encryption works and produces an encrypted file.
>
> Here's the specific bit
ps...you're checking if it has a value, 256 (a typical error return
code) would pass that test.
On 5/25/06, Anthony Ettinger <[EMAIL PROTECTED]> wrote:
check $? or $!
$gp->foo() or die "$!";
my $output = $gp->foo();
print "return code: $?";
see perldoc perlvar
On 5/25/06, Jason Balicki
check $? or $!
$gp->foo() or die "$!";
my $output = $gp->foo();
print "return code: $?";
see perldoc perlvar
On 5/25/06, Jason Balicki <[EMAIL PROTECTED]> wrote:
I'm back.
This is a piece of code taken from a larger program.
I'm trying to determine that the encryption succeded, but when
I'm back.
This is a piece of code taken from a larger program.
I'm trying to determine that the encryption succeded, but when
I try to evaluate the code, it always evaluates false even though
the encryption works and produces an encrypted file.
Here's the specific bit I'm concerned with:
if ($g
please try this one:
#tested in linux
#!/usr/bin/perl -w
use strict;
my @names = qw( fred barney betty wilma dino );
print "Enter some numbers 1 to 5, one per line, then press ctrl D:\n";
chomp (my @numbers = );
foreach (@numbers){
if ($_ < 6){
print "$names[$_ - 1]\n";
}else{
Hakim Singhji wrote:
Hi All,
Hello,
This is my first post at beginners. I am working with Learning Perl
(Llama!) and I like to tweak some of the problems and create more
creative solutions to some things. I cannot figure out why this is not
working. Can anyone point out an error in my code.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi All,
This is my first post at beginners. I am working with Learning Perl
(Llama!) and I like to tweak some of the problems and create more
creative solutions to some things. I cannot figure out why this is not
working. Can anyone point out an erro
> or u can use :
>
> if($password =~ /^howard$/)
> {
> ## logic goes here
> }
>
> --
> From: James Edward Gray II[SMTP:[EMAIL PROTECTED]
> Sent: Saturday, June 14, 2003 8:58 PM
> To: deborah
> Cc: [EMAIL PROTECTED]
> S
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Deborah) writes:
>In the same line as my last question once I tried to understand how
>Perl was interpreting string comparisons, I started experimenting with
>different strings.
>
>What is Perl doing here? Why d
On Saturday, June 14, 2003, at 10:01 AM, deborah wrote:
In the same line as my last question once I tried to understand
how Perl was interpreting string comparisons, I started experimenting
with different strings.
What is Perl doing here? Why doesn't it use the "if"
Deborah wrote:
>
> In the same line as my last question once I tried to understand how
> Perl was interpreting string comparisons, I started experimenting with
> different strings.
>
> What is Perl doing here? Why doesn't it use the "if" statement as a
>
In the same line as my last question once I tried to understand how
Perl was interpreting string comparisons, I started experimenting with
different strings.
What is Perl doing here? Why doesn't it use the "if" statement as a
condition? It reassigns the variable value inst
Duane Koble wrote:
> I am working on a program that requires that three statement be true
> in order to set a hash. The problem I am having is getting the if
> statement to work correctly. I seems to me that if two of the
> statements are true it proceeds through the if statement.
-Original Message-
From: Duane Koble [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 10:34 AM
To: [EMAIL PROTECTED]
Subject: Compound if statement.
I am working on a program that requires that three statement be true in order to set a
hash. The problem I am having is getting the if
On Thursday, January 30, 2003, at 09:33 AM, Duane Koble wrote:
I am working on a program that requires that three statement be true
in order to set a hash. The problem I am having is getting the if
statement to work correctly. I seems to me that if two of the
statements are true it
I am working on a program that requires that three statement be true in order to set a
hash. The problem I am having is getting the if statement to work correctly. I seems
to me that if two of the statements are true it proceeds through the if statement. I
need all three to be true before it
From: "Paul Kraus" <[EMAIL PROTECTED]>
> Any ideas why this fails. If I remove if /aged/ and just have the if
> /Reports ... then everything works ok.
>
> Code
> #!/usr/bin/perl
> my @files;
> my %age;
> push (@files, glob "Aged*");
> push (@files, glob "Receipts*");
>
> foreach (@files){
>
]]
Sent: Thursday, December 19, 2002 09:12
To: Perl
Subject: If Statement Nested Regular Exp.
Any ideas why this fails. If I remove if /aged/ and just have the if
/Reports ... then everything works ok.
Code
#!/usr/bin/perl
my @files;
my %age;
push (@files, glob "Aged*");
push (@f
Any ideas why this fails. If I remove if /aged/ and just have the if
/Reports ... then everything works ok.
Code
#!/usr/bin/perl
my @files;
my %age;
push (@files, glob "Aged*");
push (@files, glob "Receipts*");
foreach (@files){
open FILE,"<$_";
print "$_\n";
while(){
if (
}
else
{
&generate_form("NOT A VALID LOCATION");
exit;
}
Cheers,
Rob
- Original Message -
From: "Larry Sandwick" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 27, 2002 6:17 PM
Subject: if statement not
Larry Sandwick wrote:
>
> In the program below the if statement that qualifies the IP address
> never evaluates to be false, for what ever reason the form is always
> processed. Can anybody help me with this problem?
>
> The code should only allow computers with certain IP'
In the program below the if statement that qualifies the IP address
never evaluates to be false, for what ever reason the form is always
processed. Can anybody help me with this problem?
The code should only allow computers with certain IP's to access the
data to be processed. I kn
Javeed Sar wrote:
>
> I have a small doubt;
>
> My script is given below:
> What it is doing is once the first condition is satisfied it is dieing, that
> is if (($check_out == 0)
>
> I want the if statement to compare this also:
> (($var5 == "Soarian_Con
On 12 Aug 2002, Felix Geerinckx wrote:
> If you initialize your hash-values with '1', you don't need the
> 'exists', which makes the statement even more readable:
>
> if (!$check_out && $cannot_co{$var5}) {
> die "...";
> }
Right, should have noticed that. Thanks :-)
--
To
on Mon, 12 Aug 2002 13:45:21 GMT, [EMAIL PROTECTED] (Sudarshan
Raghavan) wrote:
> Instead of these multiple conditions why not create a hash of files
> that cannot be checkedout. Something like,
> my %cannot_co = ( comEPRHelp => 1, );
>
> After this your condition will be
> if (($check_ou
On Mon, 12 Aug 2002, Javeed SAR wrote:
>
>
> I have a small doubt;
>
>
> My script is given below:
> What it is doing is once the first condition is satisfied it is dieing, that
> is if (($check_out == 0)
>
> I want the if statement to
on Mon, 12 Aug 2002 07:32:48 GMT, [EMAIL PROTECTED] (Javeed Sar)
wrote:
> I want the if statement to compare this also:
> (($var5 == "Soarian_Context_Sensitive_Coordination_File") |
> ($var5 ==
> "comEPRHelp") | ($var5 ==
> "CDMS_Context_Sensitiv
I have a small doubt;
My script is given below:
What it is doing is once the first condition is satisfied it is dieing, that
is if (($check_out == 0)
I want the if statement to compare this also:
(($var5 == "Soarian_Context_Sensitive_Coordination_File") | ($var5 ==
"comEPR
On Tue, 2002-06-25 at 03:28, David vd Geer Inhuur tbv IPlib wrote:
>
> Hello,
>
> Thanks for the solution Bob.
> Changed some stuff and have 2 questions open.
>
> my $line;
> my (%u, %g);
> open(FILE, "< ${dir}/user.perm") or print "Failed opening file $!"; ## 1
> while ($line =
> -Original Message-
> From: David vd Geer Inhuur tbv IPlib
> [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 25, 2002 6:28 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: RE: if-statement and grep in one go
>
>
>
> Hello,
on Tue, 25 Jun 2002 10:28:07 GMT, [EMAIL PROTECTED]
(David Vd Geer Inhuur Tbv Iplib) wrote:
> Changed some stuff and have 2 questions open.
> [code snipped]
> 1) I don't like to die in my script as there are many files to
>read. And if I can't open the current file I just want to
>con
quot;< ${dir}/user.perm");
> > my @users = ;
> > close FILE;
> > chomp (@users);
> >
> > my @out = grep {/$pwuser/} @users;
> > my @out1 = grep {/$group/} @users;
> > if ((!(@out)) && (!(@out1))) { print "Sorry $pwuser you have
> >
On Monday, June 24, 2002, at 06:12 , Bob Showalter wrote:
David's original file format info:
>> an example of the file user.perm would be :
>>
>> user: vdgeerd, tester
>> group: none,
>> descr: all,
> I think you need to parse this file into some structures rather
> than using the simple regex a
1 - 100 of 156 matches
Mail list logo