What is happening here -
#! /usr/bin/perl
use strict;
use warnings;
my $count;
while(1) {
(++$count) ? $count += $count-- : $count += $count++;
print "$count\n"; exit if $count > 60_000;
sleep 1;
}
__END__
-Sx-
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional com
# WARNING: This is a very basic question -
Maybe only the beginners
should answer it?
#! perl
use strict;
use warnings;
my ($first, $last, $out) = '';
while (<>)
{
if (/^-BEGIN/ .. /^-END/)
{
if (/^-BEGIN/) { $fir
[Becuase of a recent discussion on Postfix-users list]
Would anyone like to expand/explain what, exactly, is // matching below:
#! perl
use strict;
use warnings;
my $idx;
while () {
++$idx; print "Line $idx - seen $_" if //;
}
__DATA__
Line 3
Line 5
Thx/Bill
--
_Sx_ http://youve-reached-th
Hi all,
Below is a chunk of code that I don't really know what's going on?
Could some one give me a few ideas?
perl -F: -i -ape'$F[3] == 45 && s/^/*/' /etc/passwd
Regards,
Dan
==
VINTEK CONSULTING PTY LTD
(ACN 088 825 209)
Email: [EMAIL PROTECTED]
WWW:http://w
WC -Sx- Jones wrote:
What is happening here -
#! /usr/bin/perl
use strict;
use warnings;
my $count;
while(1) {
(++$count) ? $count += $count-- : $count += $count++;
print "$count\n"; exit if $count > 60_000;
sleep 1;
}
__END__
-Sx-
That is a damn good question. I'm not s
Cc:
Subject: What is happening here
What is happening here -
#! /usr/bin/perl
use strict;
use warnings;
my $count;
while(1) {
(++$count) ? $count += $count-- : $count += $count++;
Andrew Gaffney wrote:
> WC -Sx- Jones wrote:
> > What is happening here -
> >
> > #! /usr/bin/perl
> > use strict;
> > use warnings;
> >
> > my $count;
> >
> > while(1) {
> > (++$count) ? $count += $count-- : $count += $count++;
>
"R. Joseph Newton" wrote:
> Andrew Gaffney wrote:
>
> > WC -Sx- Jones wrote:
> > > What is happening here -
> > That is a damn good question. I'm not sure what results I was expecting when I ran
> > it, but
> > it sure wasn't this:
Tim Johnson wrote:
> Apparently (++$count) evaluates to 0, but I can't figure out why.
Nope. Always true. It just doesn'yt matter. Bill sorta threw us a red herring here.
Seeing the conditiional operator distracts your attention to thinking about the
product of the conditional, which is not
WC -Sx- Jones wrote:
What is happening here -
while(1) {
(++$count) ? $count += $count-- : $count += $count++;
:) May I ask a different way?
#! /usr/bin/perl
use strict;
use warnings;
my $count;
my $str;
while(1) {
(++$count) ? $count += $count--
: $count += $count++;
$str
On Mar 30, WC -Sx- Jones said:
>my $count;
>
>while(1) {
> (++$count) ? $count += $count-- : $count += $count++;
>
> print "$count\n"; exit if $count > 60_000;
> sleep 1;
>}
The main problem is the PRECEDENCE. Your ? : line is run like so:
((++$count) ? ($count += $count--) : $count) +=
#! /usr/bin/perl
use strict;
use warnings;
my $count;
my $index;
my $str;
while (++$index) {
$count = $index;
while(1) {
(++$count) ? $count += $count--
: $count += $count++;
$str = unpack("B32", pack("N", $count));
print "$count \tis binary $str\n";
last if $coun
WC -Sx- Jones <[EMAIL PROTECTED]> wrote:
:
: PS - I am admit that I am likely in the middle of
: a nervous break-down LOL :)
You should be in just the right frame of mind for delving into
Parse::RecDecent. :)
Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328
--
To unsubscribe,
WC -Sx- Jones wrote:
> WC -Sx- Jones wrote:
> > What is happening here -
> > while(1) {
> > (++$count) ? $count += $count-- : $count += $count++;
> >
>
> :) May I ask a different way?
>
> #! /usr/bin/perl
> use strict;
> use warnings;
>
>
Jeff 'japhy' Pinyan wrote:
> On Mar 30, WC -Sx- Jones said:
>
> >my $count;
> >
> >while(1) {
> > (++$count) ? $count += $count-- : $count += $count++;
> >
> > print "$count\n"; exit if $count > 60_000;
> > sleep 1;
> >}
>
> The main problem is the PRECEDENCE. Your ? : line is run like so:
On Tue, Mar 30, 2004 at 04:57:07PM -0800, R. Joseph Newton wrote:
> Jeff 'japhy' Pinyan wrote:
>
> > On Mar 30, WC -Sx- Jones said:
> >
> > >my $count;
> > >
> > >while(1) {
> > > (++$count) ? $count += $count-- : $count += $count++;
> > >
> > > print "$count\n"; exit if $count > 60_000;
> > >
On Mar 30, R. Joseph Newton said:
>Jeff 'japhy' Pinyan wrote:
>
>> The main problem is the PRECEDENCE. Your ? : line is run like so:
>>
>> ((++$count) ? ($count += $count--) : $count) += $count++;
>
>Have you tested this? I don't see the precedence issue happening here.
>Could you try duplicat
On Apr 9, 2004, at 3:52 PM, WC -Sx- Jones wrote:
# WARNING: This is a very basic question -
Maybe only the beginners
should answer it?
Spoiler Warning! Stop reading here, if you want to solve it yourself...
#! perl
use strict;
use warnings;
my ($first, $last, $out) = '';
Wc -Sx- Jones wrote:
>
> [Becuase of a recent discussion on Postfix-users list]
> Would anyone like to expand/explain what, exactly, is // matching below:
>
> #! perl
>
> use strict;
> use warnings;
>
> my $idx;
>
> while () {
> ++$idx; print "Line $idx - seen $_" if //;
> }
> __DATA__
>
>
> L
WC -Sx- Jones <[EMAIL PROTECTED]> wrote:
:
: [Becuase of a recent discussion on Postfix-users list]
: Would anyone like to expand/explain what, exactly, is //
: matching below:
The first iteration of the loop, // matches a
zero-length string. Each subsequent time it matches the
last successf
--- Daniel Falkenberg <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Below is a chunk of code that I don't really know what's going on?
> Could some one give me a few ideas?
>
> perl -F: -i -ape'$F[3] == 45 && s/^/*/' /etc/passwd
>
> Regards,
>
> Dan
Dan,
Here's a list of the command line switches
Curtis,
Cheers for that that makes alot more sense now :). Yes your are correct
about the /etc/passwd file. It's all well and good to be able to issue
that command from a command line, but what if I wanted to issue the
exact same code but from a script?
Regards,
Dan
Dan,
Here's a list of th
--- Daniel Falkenberg <[EMAIL PROTECTED]> wrote:
> Curtis,
>
> Cheers for that that makes alot more sense now :). Yes your are correct
> about the /etc/passwd file. It's all well and good to be able to issue
> that command from a command line, but what if I wanted to issue the
> exact same code
Daniel Falkenberg wrote:
>
> Curtis,
>
> Cheers for that that makes alot more sense now :). Yes your are correct
> about the /etc/passwd file. It's all well and good to be able to issue
> that command from a command line, but what if I wanted to issue the
> exact same code but from a script?
"John W. Krahn" wrote:
>
> Daniel Falkenberg wrote:
> >
> > Curtis,
> >
> > Cheers for that that makes alot more sense now :). Yes your are correct
> > about the /etc/passwd file. It's all well and good to be able to issue
> > that command from a command line, but what if I wanted to issue the
25 matches
Mail list logo