Hello,
I would like to know, how to force perl unfold foreach expression during the
compilation, i.e. I want next code:
foreach (1..100) {
block
}
to be compiled like this:
block[$_ = 1]
block[$_ = 2]
block[$_ = 3]
.
.
.
block[$_ = 100]
Where block[$_ = n] means block with all
Please help...
*This is the original line in outFile*
*This goes into inFile*
I was expecting to find the two lines above in the file *outFile* after
running the code below:
#!/usr/bin/env perl
use 5.010;
`touch inFile`;
`touch outFile`;
`chmod 744 inFile`;
`chmod 744 outFile`;
`echo
On 4/16/09 Thu Apr 16, 2009 1:39 PM, edw...@yandex.ru edw...@yandex.ru
scribbled:
Hello,
I would like to know, how to force perl unfold foreach expression during the
compilation, i.e. I want next code:
foreach (1..100) {
block
}
to be compiled like this:
block[$_ =
Hi
I had this semi-working, changed something and can't remember where I
went right, so would appreciate some help getting back on top.
I know 1..10 and 2..10 probably won't work in the following example, I
have just changed lines to show what I am trying to get.
$mystart = -2;
$i = 1;
for
On 4/17/09 Fri Apr 17, 2009 10:02 AM, Brian brian5432...@yahoo.co.uk
scribbled:
Hi
I had this semi-working, changed something and can't remember where I
went right, so would appreciate some help getting back on top.
I know 1..10 and 2..10 probably won't work in the following example, I
Joseph Mwesigwa Bbaale wrote:
Please help...
*This is the original line in outFile*
*This goes into inFile*
I was expecting to find the two lines above in the file *outFile* after
running the code below:
#!/usr/bin/env perl
use warnings;
use strict;
use 5.010;
`touch inFile`;
`touch
-Original Message-
From: Brian [mailto:brian5432...@yahoo.co.uk]
Sent: Friday, April 17, 2009 11:03
To: Perl Beginners
Subject: help needed to get over endless loop
Hi
I had this semi-working, changed something and can't remember where I
went right, so would appreciate some
Wagner, David --- Senior Programmer Analyst --- CFS wrote:
-Original Message-
From: Brian [mailto:brian5432...@yahoo.co.uk]
Sent: Friday, April 17, 2009 11:03
To: Perl Beginners
Subject: help needed to get over endless loop
Hi
I had this semi-working, changed something and can't
On Fri, Apr 17, 2009 at 12:16, Jim Gibson jimsgib...@gmail.com wrote:
On 4/16/09 Thu Apr 16, 2009 1:39 PM, edw...@yandex.ru edw...@yandex.ru
scribbled:
Hello,
I would like to know, how to force perl unfold foreach expression during
the
compilation, i.e. I want next code:
snip
Can you
This is what I'm using upto the code that is giving me a headache.
I know it's messy, but I have no training in PERL, I am trying to
forward-engineer this cgi by back-engineering from html templates I
created and which were chosen using $t-src
thanks for any help
Brian
#!
Brian wrote:
oops, should read..
$Year_out = $Year_in;
while ($Year_out 100) {$Year_out -= 100;}
if (($Year_out 00) ($Year_out = 25)) {$string = $string1;}
if (($Year_out 25) ($Year_out = 50)) {$Year_out -=
25;$string = $string2;}
if (($Year_out 50)
Brian,
Your while loops aren't actually performing any operation on the variable
that is being tested as part of their condition. With while loops, if the
condition ($i in this case) is true at the start of the loop, and doesn't
change, they will loop forever. They aren't like for loops, where
On 4/16/09 Thu Apr 16, 2009 2:25 PM, Chas. Owens chas.ow...@gmail.com
scribbled:
2009/4/16 Jim Gibson jimsgib...@gmail.com:
snip
This calls the new method in package vpu and assigns the return value, which
should be a blessed scalar of some type, usually a reference to a hash, but
it could
Kevin Ponds wrote:
Brian,
Your while loops aren't actually performing any operation on the variable
I did actually state that the loops wouldn't work.
I adjusted them to better show what I want to achieve, not to show how I
am trying to achieve it.
that is being tested as part of their
On Fri, Apr 17, 2009 at 18:01, Jim Gibson jimsgib...@gmail.com wrote:
On 4/16/09 Thu Apr 16, 2009 2:25 PM, Chas. Owens chas.ow...@gmail.com
scribbled:
2009/4/16 Jim Gibson jimsgib...@gmail.com:
snip
This calls the new method in package vpu and assigns the return value, which
should be a
On 4/17/09 Fri Apr 17, 2009 1:50 PM, Brian brian5432...@yahoo.co.uk
scribbled:
Brian wrote:
oops, should read..
$Year_out = $Year_in;
while ($Year_out 100) {$Year_out -= 100;}
if (($Year_out 00) ($Year_out = 25)) {$string = $string1;}
if
Jim Gibson wrote:
On 4/17/09 Fri Apr 17, 2009 1:50 PM, Brian brian5432...@yahoo.co.uk
scribbled:
Brian wrote:
oops, should read..
$Year_out = $Year_in;
while ($Year_out 100) {$Year_out -= 100;}
if (($Year_out 00) ($Year_out = 25)) {$string = $string1;}
Brian wrote:
This is what I'm using upto the code that is giving me a headache.
I know it's messy, but I have no training in PERL, I am trying to
forward-engineer this cgi by back-engineering from html templates I
created and which were chosen using $t-src
thanks for any help
Brian
#!
17.04.09, 20:16, Jim Gibson jimsgib...@gmail.com:
On 4/16/09 Thu Apr 16, 2009 1:39 PM, edw...@yandex.ru edw...@yandex.ru
scribbled:
Hello,
I would like to know, how to force perl unfold foreach expression during
the
compilation, i.e. I want next code:
foreach
Brian wrote:
This is what I'm using upto the code that is giving me a headache.
I know it's messy, but I have no training in PERL, I am trying to
forward-engineer this cgi by back-engineering from html templates I
created and which were chosen using $t-src
[ *SNIP* ]
John W. Krahn wrote:
Brian wrote:
This is what I'm using upto the code that is giving me a headache.
I know it's messy, but I have no training in PERL, I am trying to
forward-engineer this cgi by back-engineering from html templates I
created and which were chosen using $t-src
#!
Brian wrote:
John W. Krahn wrote:
Brian wrote:
chomp($Lang = $val1);
chomp($Year_in = $val2);
chomp() removes the contents of the $/ variable from the end of the
string. What makes you think that $val1 and $val2 need to be chomp()ed?
Oops, they are leftovers from when I was using STDIN
John W. Krahn wrote:
Brian wrote:
This is what I'm using upto the code that is giving me a headache.
I know it's messy, but I have no training in PERL, I am trying to
forward-engineer this cgi by back-engineering from html templates I
created and which were chosen using $t-src
[ *SNIP* ]
Brian wrote:
John W. Krahn wrote:
Brian wrote:
This is what I'm using upto the code that is giving me a headache.
I know it's messy, but I have no training in PERL, I am trying to
forward-engineer this cgi by back-engineering from html templates I
created and which were chosen using $t-src
Perl sucks...go Ruby...I did and I am much happier!
- Original Message
From: Michael Alipio daem0n...@yahoo.com
To: Perl Beginners beginners@perl.org; John W. Krahn jwkr...@shaw.ca
Sent: Tuesday, April 14, 2009 10:06:39 AM
Subject: Re: Turn off $ anchor greedy behavior
Aha, found
On Fri, Apr 17, 2009 at 21:26, oryann9 orya...@yahoo.com wrote:
Perl sucks...go Ruby...I did and I am much happier!
snip
I looked at Ruby. You couldn't pay me to go back to a language
that uses a stupid visual pun for a concatenation operator or
forces me to cast variables into different
John W. Krahn wrote:
Brian wrote:
John W. Krahn wrote:
Brian wrote:
This is what I'm using upto the code that is giving me a headache.
I know it's messy, but I have no training in PERL, I am trying to
forward-engineer this cgi by back-engineering from html templates I
created and which
On Fri, Apr 17, 2009 at 21:35, Brian brian5432...@yahoo.co.uk wrote:
snip
LOL, I didn't understand any of that. :-)
Apart from the last sentence ;-)
snip
Think of a clock, they hands can go around as many times as you like
but they can never point to anything higher than 12. Modulus works
the
Now that I am learning how to work with complex data structures, I
find myself writing things like this a lot:
my $foo = ( defined $very_long_expression ? $very_long_expression :
n/a );
or
my $foo = ( $very_long_expression 0 ? $very_long_expression : 0 );
(Where the long
2009/4/17 Chap Harrison c...@pobox.com:
Now that I am learning how to work with complex data structures, I find myself
writing things like this a lot:
my $foo = ( defined $very_long_expression ? $very_long_expression : n/a );
or
my $foo = ( $very_long_expression 0 ?
30 matches
Mail list logo