[27310] in Perl-Users-Digest
Perl-Users Digest, Issue: 9044 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 11 21:06:35 2006
Date: Sat, 11 Mar 2006 18:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 11 Mar 2006 Volume: 10 Number: 9044
Today's topics:
Re: A Problem With GD robic0
Re: A Problem With GD robic0
Re: FAQ 2.6 What modules and extensions are available f robic0
Perl sucks FAQ robic0
Re: Regex: All except leading global substitution... robic0
Re: Toggle flags (WAS: A Problem With GD) robic0
Re: Toggle flags (WAS: A Problem With GD) robic0
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 11 Mar 2006 16:01:18 -0800
From: robic0
Subject: Re: A Problem With GD
Message-Id: <u5p6125fbavkrhblrncr3c01jl1o90f4br@4ax.com>
On 11 Mar 2006 21:20:50 GMT, Abigail <abigail@abigail.nl> wrote:
>Abigail (abigail@abigail.nl) wrote on MMMMDLXXV September MCMXCIII in
><URL:news:slrne163ac.p75.abigail@alexandra.abigail.nl>:
>:) Mark Manning (markem@airmail.net) wrote on MMMMDLXXV September MCMXCIII
>:) in <URL:news:1215ur1bndeb911@corp.supernews.com>:
>:) <> Glenn Jackman wrote:
>:) <> > At 2006-03-08 04:48AM, Dave Weaver <zen13097@zen.co.uk> wrote:
>:) <> >
>:) <> > However,
>:) <> > $i = -1
>:) <> > while (++$i < 10) {...
>:) <> > does.
>:) <> >
>:) <>
>:) <> What is your favorite method for implementing a toggle switch? Mine is:
>:) <>
>:) <> $var = ($var + 1) % 2;
>:)
>:)
>:) If I'm going to use the switch in boolean context only:
>:)
>:) $var = !$var;
>:)
>:) else:
>:)
>:) $var = 1 - $var;
>:)
>:) or:
>:)
>:) ($var += 1) %= 2;
>
>
>$var = [1, 0] -> [$var];
meaningless..
>
>
>Abigail
------------------------------
Date: Sat, 11 Mar 2006 17:20:43 -0800
From: robic0
Subject: Re: A Problem With GD
Message-Id: <qqt612lkk6gto4hgdu5cfptn84r61s0pl1@4ax.com>
On Sat, 11 Mar 2006 20:18:12 +0100, "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de> wrote:
>Also sprach Mark Manning:
>
>> What is your favorite method for implementing a toggle switch? Mine is:
>>
>> $var = ($var + 1) % 2;
>
>The one best suited for Perl golf is of course:
>
> $|--;
>
>Tassilo
Perl sucks !!!!!!
------------------------------
Date: Sat, 11 Mar 2006 17:11:29 -0800
From: robic0
Subject: Re: FAQ 2.6 What modules and extensions are available for Perl? What is CPAN? What does CPAN/src/... mean?
Message-Id: <g6t612hb7au5he7fi7ob9q7u4i464l8v1b@4ax.com>
On Sat, 11 Mar 2006 12:03:02 -0800, PerlFAQ Server <brian@stonehenge.com> wrote:
>This is an excerpt from the latest version perlfaq2.pod, which
>comes with the standard Perl distribution. These postings aim to
>reduce the number of repeated questions as well as allow the community
>to review and update the answers. The latest version of the complete
>perlfaq is at http://faq.perl.org .
>
>--------------------------------------------------------------------
>
>2.6: What modules and extensions are available for Perl? What is CPAN? What does CPAN/src/... mean?
>
> CPAN stands for Comprehensive Perl Archive Network, a ~1.2Gb archive
> replicated on nearly 200 machines all over the world. CPAN contains
> source code, non-native ports, documentation, scripts, and many
> third-party modules and extensions, designed for everything from
> commercial database interfaces to keyboard/screen control to web walking
> and CGI scripts. The master web site for CPAN is http://www.cpan.org/
> and there is the CPAN Multiplexer at http://www.cpan.org/CPAN.html which
> will choose a mirror near you via DNS. See http://www.perl.com/CPAN
> (without a slash at the end) for how this process works. Also,
> http://mirror.cpan.org/ has a nice interface to the
> http://www.cpan.org/MIRRORED.BY mirror directory.
>
> See the CPAN FAQ at http://www.cpan.org/misc/cpan-faq.html for answers
> to the most frequently asked questions about CPAN including how to
> become a mirror.
>
> CPAN/path/... is a naming convention for files available on CPAN sites.
> CPAN indicates the base directory of a CPAN mirror, and the rest of the
> path is the path from that directory to the file. For instance, if
> you're using ftp://ftp.funet.fi/pub/languages/perl/CPAN as your CPAN
> site, the file CPAN/misc/japh is downloadable as
> ftp://ftp.funet.fi/pub/languages/perl/CPAN/misc/japh .
>
> Considering that there are close to two thousand existing modules in the
> archive, one probably exists to do nearly anything you can think of.
> Current categories under CPAN/modules/by-category/ include Perl core
> modules; development support; operating system interfaces; networking,
> devices, and interprocess communication; data type utilities; database
> interfaces; user interfaces; interfaces to other languages; filenames,
> file systems, and file locking; internationalization and locale; world
> wide web support; server and daemon utilities; archiving and
> compression; image manipulation; mail and news; control flow utilities;
> filehandle and I/O; Microsoft Windows modules; and miscellaneous
> modules.
>
> See http://www.cpan.org/modules/00modlist.long.html or
> http://search.cpan.org/ for a more complete list of modules by category.
>
> CPAN is not affiliated with O'Reilly Media.
>
>
>
>--------------------------------------------------------------------
>
>The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
>are not necessarily experts in every domain where Perl might show up,
>so please include as much information as possible and relevant in any
>corrections. The perlfaq-workers also don't have access to every operating
>system or platform, so please include relevant details for corrections
>to examples that do not work on particular platforms. Working code is
>greatly appreciated.
>
>If you'd like to help maintain the perlfaq, see the details in
>perlfaq.pod.
>*** Free account sponsored by SecureIX.com ***
>*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***
It means %99 shit, %1 workable..
------------------------------
Date: Sat, 11 Mar 2006 17:22:23 -0800
From: robic0
Subject: Perl sucks FAQ
Message-Id: <nst612tv6k3lp45atc0f7rqkups1tpln2q@4ax.com>
Ask the "Anal-Izer" a question....
------------------------------
Date: Sat, 11 Mar 2006 17:51:32 -0800
From: robic0
Subject: Re: Regex: All except leading global substitution...
Message-Id: <67v612l9ndvddudsabefquhb4gotlr4hgj@4ax.com>
On Fri, 10 Mar 2006 04:51:08 GMT, "Peter Hill" <peter.hill@modulus.com.au> wrote:
>I think I am misunderstanding how /g works; the following (incorrect)
>program does not remove all non-leading vowels, just the 1st non-leading
>vowel. Corrections please?
>
>#! /usr/bin/perl -w
>use strict;
>#remove all non-leading vowels
>my $word = 'ABEDU';
>$word =~ s/(^..*?)[AEIOU](.*)/$1$2/g;
>print qq{$word\n};
>
>tia
>Peter Hill
>
>
I might be missing some hidden detail in yur explaination.
It might be a convolution of the sample 'ABEDU' with the
problem statement "does not remove all non-leading vowels,
just the 1st non-leading vowel."
This removes *ALL* of the character class defined.
You can't say all non leading vowels without defining
what "leading" is, and you certaintly don't do that here.
use strict;
#remove all non-leading vowels
my $word = 'ABEDU';
$word =~ s/[AEIOU]//g;
print qq{$word\n};
Back to class pigmy!!
-robic0-
------------------------------
Date: Sat, 11 Mar 2006 17:03:47 -0800
From: robic0
Subject: Re: Toggle flags (WAS: A Problem With GD)
Message-Id: <m4s612dt70rcnrbn0r7qc3bblromsn4sk2@4ax.com>
On Sat, 11 Mar 2006 14:26:57 -0600, Mark Manning <markem@airmail.net> wrote:
>
>
>Jürgen Exner wrote:
>> Mark Manning wrote:
>>
>>>What is your favorite method for implementing a toggle switch? Mine
>>>is:
>>>$var = ($var + 1) % 2;
>>
>>
>> Why not a simple
>>
>> $var = ! $var;
>>
>> Then it's obvious that you are not doing numerics but a simple logical
>> toggle.
>>
>> jue
>
>Yes, we had to be assured of it being zero or one only. We came across a three
>way switch at one point and simply changing the line to:
>
>$var = ($var + 1) % 3;
>
>Allowed us to be able to handle the toggle switch on the simulator. :-)
There is no such thing as a "boolean" type in Perl.
This:
"$var = !$var;" ,
is exactly:
$var = 1 - $var;
in Perl, I think, if $var == 0 or 1.
Some language constructs produce TRUE if the result is not-zero,
ie: nagative or positive. But, who can follow that shit.
So in Perl, !(not) as a TRUE referrs to it being 0.
For example, what does this translate to in Perl (?):
$var = -7;
$var = !$var;
Some situations you have to be careful, the construct could change the
$var idom into 0 (zero), which could result in error processing in the
downstream code as what is expected isin't as such...
Just my 2 cent's. The big question is the simpler question as stated...
-robic0-
------------------------------
Date: Sat, 11 Mar 2006 17:06:13 -0800
From: robic0
Subject: Re: Toggle flags (WAS: A Problem With GD)
Message-Id: <rus6125va4rm2tn1hcfuh8e18s4cbco5bh@4ax.com>
On Sat, 11 Mar 2006 17:03:47 -0800, robic0 wrote:
>On Sat, 11 Mar 2006 14:26:57 -0600, Mark Manning <markem@airmail.net> wrote:
>
>>
>>
>>Jürgen Exner wrote:
>>> Mark Manning wrote:
>>>
>>>>What is your favorite method for implementing a toggle switch? Mine
>>>>is:
>>>>$var = ($var + 1) % 2;
>>>
>>>
>>> Why not a simple
>>>
>>> $var = ! $var;
>>>
>>> Then it's obvious that you are not doing numerics but a simple logical
>>> toggle.
>>>
>>> jue
>>
>>Yes, we had to be assured of it being zero or one only. We came across a three
>>way switch at one point and simply changing the line to:
>>
>>$var = ($var + 1) % 3;
>>
>>Allowed us to be able to handle the toggle switch on the simulator. :-)
>
>There is no such thing as a "boolean" type in Perl.
>
>This:
> "$var = !$var;" ,
>is exactly:
> $var = 1 - $var;
>in Perl, I think, if $var == 0 or 1.
>
>Some language constructs produce TRUE if the result is not-zero,
>ie: nagative or positive. But, who can follow that shit.
>
>So in Perl, !(not) as a TRUE referrs to it being 0.
^^^^^^^
not being 0
>For example, what does this translate to in Perl (?):
>
> $var = -7;
> $var = !$var;
>
>Some situations you have to be careful, the construct could change the
>$var idom into 0 (zero), which could result in error processing in the
>downstream code as what is expected isin't as such...
>
>Just my 2 cent's. The big question is the simpler question as stated...
>
>-robic0-
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 9044
***************************************