[31935] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3198 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 4 18:09:24 2010

Date: Thu, 4 Nov 2010 15:09:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 4 Nov 2010     Volume: 11 Number: 3198

Today's topics:
        "open" range operator <RjY@sp.am>
    Re: "open" range operator <tadmc@seesig.invalid>
    Re: "open" range operator sln@netherlands.com
    Re: "open" range operator <derykus@gmail.com>
        belly laff for toaday <psyop@lawyer.com>
    Re: Foreach <kst-u@mib.org>
    Re: Foreach <tadmc@seesig.invalid>
    Re: Foreach <uri@StemSystems.com>
        Malware in Strawberry Perl v5.10.1.2 <dgbethany@comcast.net>
        Malware in Strawberry Perl v5.10.1.2 <apasserby@hushmail.com>
    Re: Malware in Strawberry Perl v5.10.1.2 <uri@StemSystems.com>
    Re: Malware in Strawberry Perl v5.10.1.2 <apasserby@hushmail.com>
    Re: Malware in Strawberry Perl v5.10.1.2 <uri@StemSystems.com>
    Re: Malware in Strawberry Perl v5.10.1.2 <sherm.pendley@gmail.com>
    Re: Malware in Strawberry Perl v5.10.1.2 <sisyphus359@gmail.com>
    Re: Malware in Strawberry Perl v5.10.1.2 sln@netherlands.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 04 Nov 2010 10:11:36 GMT
From: RjY <RjY@sp.am>
Subject: "open" range operator
Message-Id: <sFvAo.61324$MZ3.38684@newsfe29.ams2>

Summary: The "flip-flop" sed/awk-style range operator includes its end
points. I would like to know if there's a way to make it not do that.

To illustrate[1], suppose I have a file like this:

blah
START
bleourgh
END
fleurgh

then feeding it into perl -ne 'print if /START/../END/;' gives

START
bleourgh
END

What I would like is a range operator suitable for shell one-liners that
does the same but is false on the endpoints rather than true, so that
the above example would not include the endpoints and so simply print
"bleourgh".

Is there a short idiom for this that I have simply missed? It seems not
to be too exotic a use-case. I tried using ... instead of .. but it had
no effect (obviously I misunderstood the difference)

[1] for the mathematically inclined: the range operator works more like
a closed interval; I would like it to work like an open one. :)

-- 
http://rjy.org.uk/


------------------------------

Date: Thu, 04 Nov 2010 09:08:31 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: "open" range operator
Message-Id: <slrnid5fvg.rr4.tadmc@tadbox.sbcglobal.net>

RjY <RjY@sp.am> wrote:
> Summary: The "flip-flop" sed/awk-style range operator includes its end
> points. I would like to know if there's a way to make it not do that.


It is ugly, but you can examine the flip-flop's return value:

    print if /START/../END/ and (/START/../END/) !~ /(^1|E0)$/
or
    $ff = /START/../END/; print if $ff and $ff !~ /(^1|E0)$/


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.


------------------------------

Date: Thu, 04 Nov 2010 14:59:28 -0700
From: sln@netherlands.com
Subject: Re: "open" range operator
Message-Id: <pra6d6hbr3ng4d1t4kunakrm1fk1gtnevt@4ax.com>

On Thu, 04 Nov 2010 10:11:36 GMT, RjY <RjY@sp.am> wrote:

>Summary: The "flip-flop" sed/awk-style range operator includes its end
>points. I would like to know if there's a way to make it not do that.
>
>To illustrate[1], suppose I have a file like this:
>
>blah
>START
>bleourgh
>END
>fleurgh
>
>then feeding it into perl -ne 'print if /START/../END/;' gives
>
>START
>bleourgh
>END
>
>What I would like is a range operator suitable for shell one-liners that
>does the same but is false on the endpoints rather than true, so that
>the above example would not include the endpoints and so simply print
>"bleourgh".
>
>Is there a short idiom for this that I have simply missed? It seems not
>to be too exotic a use-case. I tried using ... instead of .. but it had
>no effect (obviously I misunderstood the difference)
>
>[1] for the mathematically inclined: the range operator works more like
>a closed interval; I would like it to work like an open one. :)

This probably works. Same principle to check the return sequence 'string'
in scalar context:

   print if ((/START/../END/) =~ /^(?:1\d+|[2-9]\d*)$/);

-sln

-------------------
use strict;
use warnings;

while (<DATA>)
{
    print if ((/START/../END/) =~ /^(?:1\d+|[2-9]\d*)$/);
}

__DATA__

blah

blah
START
bleourgh
END
fleurgh

START
1
2
3
4
5
/(^1|E0)$/
6
7
8
9
/  \d 
0
1
2
3
4
5
6
7
8
9
0
bleourgh
before 
END
fleurgh

END

then feeding it into perl -ne 'print if /START/.
1
2
hello
3
4
 ./END/;' gives


END 

asdf

then feeding it into perl -ne 'print if /START/../END/;' gives


abdsfasdg



------------------------------

Date: Thu, 4 Nov 2010 15:00:30 -0700 (PDT)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: "open" range operator
Message-Id: <38b58d06-67a4-4777-8c16-32eca38457ee@42g2000prt.googlegroups.com>

On Nov 4, 7:08=A0am, Tad McClellan <ta...@seesig.invalid> wrote:
> RjY <R...@sp.am> wrote:
> > Summary: The "flip-flop" sed/awk-style range operator includes its end
> > points. I would like to know if there's a way to make it not do that.
>
> It is ugly, but you can examine the flip-flop's return value:
>
> =A0 =A0 print if /START/../END/ and (/START/../END/) !~ /(^1|E0)$/
> or
> =A0 =A0 $ff =3D /START/../END/; print if $ff and $ff !~ /(^1|E0)$/
>

or perhaps the magic-challenged might prefer:

  $ff =3D /START/../END/;
  print if $ff>1 and $ff =3D~ /^\d+$/;


--
Charles DeRykus



------------------------------

Date: Thu, 4 Nov 2010 13:38:58 -0700 (PDT)
From: Peter Lucas <psyop@lawyer.com>
Subject: belly laff for toaday
Message-Id: <06def9cf-ebb1-4b81-8d2d-043f7aacbb2c@e14g2000yqe.googlegroups.com>

What did the deaf dumm and blind boy get for christmas?
Cancer!

LOL and LAFF!!! :-))))))))))))

--
Peter Lucas
Brisbane
Australia

Q:Do you like Beef?
A:Well suck my C.O.C.K Its Dripping!


------------------------------

Date: Thu, 04 Nov 2010 13:02:07 -0700
From: Keith Thompson <kst-u@mib.org>
Subject: Re: Foreach
Message-Id: <ln7hgseu2o.fsf@nuthaus.mib.org>

"Uri Guttman" <uri@StemSystems.com> writes:
>>>>>> "KT" == Keith Thompson <kst-u@mib.org> writes:
>
>   KT> No, in the code I posted I need to know when I'm processing the last
>   KT> item.
>
> so use a while/shift loop instead. i stay away from indexing arrays as
> much as possible as there is usually a better way to deal with things.
>
> while( defined( my $elem = shift @array ) ) {
>
> 	last_elem( $elem) unless @array ;
>
> 	rest of code
> }

Cool.  Of course it destroys the array as you traverse it, which may or
may not be a problem.

[more good ideas snipped]

> not too fugly. and better than indexing. perl6 will be able to loop over
> indexes and elems together like each does for hashes.

Ah, yes, Perl6's "kv" operator seems to be just about exactly what
I was looking for.  For example:

for @*ARGS.kv -> $index, $value {
    say "index = $index, value = $value";
}

(Is Perl6 considered topical here?)

[more good stuff snipped]

As always, TMTOWTDI.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"


------------------------------

Date: Thu, 04 Nov 2010 15:53:16 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Foreach
Message-Id: <slrnid67mg.s6r.tadmc@tadbox.sbcglobal.net>

Keith Thompson <kst-u@mib.org> wrote:

> (Is Perl6 considered topical here?)


Yes.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.


------------------------------

Date: Thu, 04 Nov 2010 17:24:12 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Foreach
Message-Id: <87wroseq9v.fsf@quad.sysarch.com>

>>>>> "KT" == Keith Thompson <kst-u@mib.org> writes:

  KT> "Uri Guttman" <uri@StemSystems.com> writes:
  >>>>>>> "KT" == Keith Thompson <kst-u@mib.org> writes:
  >> 
  KT> No, in the code I posted I need to know when I'm processing the last
  KT> item.
  >> 
  >> so use a while/shift loop instead. i stay away from indexing arrays as
  >> much as possible as there is usually a better way to deal with things.
  >> 
  >> while( defined( my $elem = shift @array ) ) {
  >> 
  >> last_elem( $elem) unless @array ;
  >> 
  >> rest of code
  >> }

  KT> Cool.  Of course it destroys the array as you traverse it, which may or
  KT> may not be a problem.

yeah, some good ideas do need to shift off the array and destroy it. one
workaround is to copy it first and work on the copy. i just don't seem
to design code than need array indexing much nor things like first and
last handling. sometimes a better design is the solution.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Wed, 3 Nov 2010 23:42:30 -0700 (PDT)
From: David <dgbethany@comcast.net>
Subject: Malware in Strawberry Perl v5.10.1.2
Message-Id: <0872332d-59bd-4636-94d5-6e6058cc4415@v20g2000yqb.googlegroups.com>

On 2010-07-24 I uninstalled ActiveState Perl and installed Strawberry
Perl v5.10.1.2, largely on the strength of  the webpage's implied
indorsement by Larry Wall: "When I'm on Windows, I use Strawberry
Perl." I hope you don't really use this implementation, Larry, because
a couple weeks after the install I got a call from American Express
about several bogus charges to my card--including a $1 charge by a
site called strawberry.com (not strawberryperl.com, the site from
which I downloaded the product). $1 charges seem to be the preferred
method used by scammers to test a card's validity: if the small charge
goes through, these dudes pounce and run it up to the max in an hour
or so. Amex is wise to the trick so they immediately cancelled the
card and sent me a new one with a different number.

I ran ZoneAlarm against the installation and it found bad boys called
Worm.Win32.c* in both xmlcatalog.exe and \bin\dmake.exe. Naturally
when I installed the product I didn't think too much about giving it
'Net access for auto-update purposes, which probably explains how it
was able to grab a credit card number and call home without detection.

*Don't use this product!* I've gone back to ActiveState and I intent
to stay with it.


------------------------------

Date: Thu, 4 Nov 2010 00:04:04 -0700 (PDT)
From: whitesmith <apasserby@hushmail.com>
Subject: Malware in Strawberry Perl v5.10.1.2
Message-Id: <891b9f6b-e132-4807-968e-9f55aabd603c@t13g2000yqm.googlegroups.com>

On 2010-07-24 I uninstalled ActiveState Perl and installed Strawberry
Perl v5.10.1.2, largely on the strength of  the webpage's implied
indorsement by Larry Wall: "When I'm on Windows, I use Strawberry
Perl." I hope you don't really use this implementation, Larry, because
a couple weeks after the install I got a call from American Express
about several bogus charges to my card--including a $1 charge by a
site called strawberry.com (not strawberryperl.com, the site from
which I downloaded the product). $1 charges seem to be the preferred
method used by scammers to test a card's validity: if the small charge
goes through, these dudes pounce and run it up to the max in an hour
or so. Amex is wise to the trick so they immediately cancelled the
card and sent me a new one with a different number.

I ran ZoneAlarm against the installation and it found bad boys called
Worm.Win32.c* in both xmlcatalog.exe and \bin\dmake.exe. Naturally
when I installed the product I didn't think too much about giving it
'Net access for auto-update purposes, which probably explains how it
was able to grab a credit card number and call home without detection.

*Don't use this product!!* I've gone back to ActiveState and I intent
to stay with it, with or without a recommendation from Wall.


------------------------------

Date: Thu, 04 Nov 2010 03:01:00 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Malware in Strawberry Perl v5.10.1.2
Message-Id: <87bp65indf.fsf@quad.sysarch.com>

>>>>> "D" == David  <dgbethany@comcast.net> writes:

  D> On 2010-07-24 I uninstalled ActiveState Perl and installed Strawberry
  D> Perl v5.10.1.2, largely on the strength of  the webpage's implied
  D> indorsement by Larry Wall: "When I'm on Windows, I use Strawberry
  D> Perl." I hope you don't really use this implementation, Larry, because
  D> a couple weeks after the install I got a call from American Express
  D> about several bogus charges to my card--including a $1 charge by a
  D> site called strawberry.com (not strawberryperl.com, the site from
  D> which I downloaded the product). $1 charges seem to be the preferred
  D> method used by scammers to test a card's validity: if the small charge
  D> goes through, these dudes pounce and run it up to the max in an hour
  D> or so. Amex is wise to the trick so they immediately cancelled the
  D> card and sent me a new one with a different number.

  D> I ran ZoneAlarm against the installation and it found bad boys called
  D> Worm.Win32.c* in both xmlcatalog.exe and \bin\dmake.exe. Naturally
  D> when I installed the product I didn't think too much about giving it
  D> 'Net access for auto-update purposes, which probably explains how it
  D> was able to grab a credit card number and call home without detection.

  D> *Don't use this product!* I've gone back to ActiveState and I intent
  D> to stay with it.

this makes no sense. i know the strawberry perl people and they don't
put malware in there. you must have downloaded it from an infected site
or did something else wrong. your issue, not theirs.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Thu, 4 Nov 2010 00:06:22 -0700 (PDT)
From: whitesmith <apasserby@hushmail.com>
Subject: Re: Malware in Strawberry Perl v5.10.1.2
Message-Id: <a4fb2542-916a-434e-90e1-403fc64633c9@f20g2000yqi.googlegroups.com>

On Nov 4, 7:04=A0am, whitesmith <apasse...@hushmail.com> wrote:
> On 2010-07-24 I uninstalled ActiveState Perl and installed Strawberry
> Perl v5.10.1.2, largely on the strength of =A0the webpage's implied
> indorsement by Larry Wall: "When I'm on Windows, I use Strawberry
> Perl." I hope you don't really use this implementation, Larry, because
> a couple weeks after the install I got a call from American Express
> about several bogus charges to my card--including a $1 charge by a
> site called strawberry.com (not strawberryperl.com, the site from
> which I downloaded the product). $1 charges seem to be the preferred
> method used by scammers to test a card's validity: if the small charge
> goes through, these dudes pounce and run it up to the max in an hour
> or so. Amex is wise to the trick so they immediately cancelled the
> card and sent me a new one with a different number.
>
> I ran ZoneAlarm against the installation and it found bad boys called
> Worm.Win32.c* in both xmlcatalog.exe and \bin\dmake.exe. Naturally
> when I installed the product I didn't think too much about giving it
> 'Net access for auto-update purposes, which probably explains how it
> was able to grab a credit card number and call home without detection.
>
> *Don't use this product!!* I've gone back to ActiveState and I intent
> to stay with it, with or without a recommendation from Wall.

DLed directly from the big red strawberry. No mistake about it. I'm
quite careful about what and from whom I download.


------------------------------

Date: Thu, 04 Nov 2010 03:41:45 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Malware in Strawberry Perl v5.10.1.2
Message-Id: <874obxilhi.fsf@quad.sysarch.com>

>>>>> "w" == whitesmith  <apasserby@hushmail.com> writes:

  w> On Nov 4, 7:04 am, whitesmith <apasse...@hushmail.com> wrote:
  >> On 2010-07-24 I uninstalled ActiveState Perl and installed Strawberry
  >> Perl v5.10.1.2, largely on the strength of  the webpage's implied
  >> indorsement by Larry Wall: "When I'm on Windows, I use Strawberry
  >> Perl." I hope you don't really use this implementation, Larry, because
  >> a couple weeks after the install I got a call from American Express
  >> about several bogus charges to my card--including a $1 charge by a
  >> site called strawberry.com (not strawberryperl.com, the site from
  >> which I downloaded the product). $1 charges seem to be the preferred
  >> method used by scammers to test a card's validity: if the small charge
  >> goes through, these dudes pounce and run it up to the max in an hour
  >> or so. Amex is wise to the trick so they immediately cancelled the
  >> card and sent me a new one with a different number.
  >> 
  >> I ran ZoneAlarm against the installation and it found bad boys called
  >> Worm.Win32.c* in both xmlcatalog.exe and \bin\dmake.exe. Naturally
  >> when I installed the product I didn't think too much about giving it
  >> 'Net access for auto-update purposes, which probably explains how it
  >> was able to grab a credit card number and call home without detection.
  >> 
  >> *Don't use this product!!* I've gone back to ActiveState and I intent
  >> to stay with it, with or without a recommendation from Wall.

  w> DLed directly from the big red strawberry. No mistake about it. I'm
  w> quite careful about what and from whom I download.

still, your opinion isn't much given all the others who use strawberry
perl without such issues. that means it is likely something on your box
that did this and not the download.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Thu, 04 Nov 2010 08:22:39 -0400
From: Sherm Pendley <sherm.pendley@gmail.com>
Subject: Re: Malware in Strawberry Perl v5.10.1.2
Message-Id: <m262wd1do0.fsf@sherm.shermpendley.com>

whitesmith <apasserby@hushmail.com> writes:

> DLed directly from the big red strawberry. No mistake about it. I'm
> quite careful about what and from whom I download.

Given that you've now spammed the group *three times* with the same
message using two different anonymous identities, that you apparently
believe a logo image is a reliable indicator of a site's authenticity,
that you apparently believe an entity claiming to be "strawberry.com"
has some obvious connection with strawberryperl.com, that you claim
to have recently downloaded 5.10.1.2 when the latest 5.10 package
is 5.10.1.3, and that no one else out of the *many* people who build,
package, and use Strawberry Perl have reported a problem - given all
that, I frankly find your credibility quite lacking.

Quite the opposite, in fact. If you honestly believe all the things you
claim here, you're unbelievably gullible and incapable of the kind of
critical thought that careful downloading requires.

sherm--

-- 
Sherm Pendley
                                   <http://camelbones.sourceforge.net>
Cocoa Developer


------------------------------

Date: Thu, 4 Nov 2010 06:04:01 -0700 (PDT)
From: sisyphus <sisyphus359@gmail.com>
Subject: Re: Malware in Strawberry Perl v5.10.1.2
Message-Id: <1787e6d5-b571-4489-a9a1-eff61d139836@o23g2000prh.googlegroups.com>

On Nov 4, 6:04=A0pm, whitesmith <apasse...@hushmail.com> wrote:

> I ran ZoneAlarm against the installation and it found bad boys called
> Worm.Win32.c* in both xmlcatalog.exe and \bin\dmake.exe.

 Yes, I prefer ActivePerl - and if you 'ppm install MinGW' first, then
you can pretty much build any module that ships with Strawberry Perl
anyway. (Mind you, however, some of those modules aren't all that
trivial to build.)

Anyway, I've just downloaded
http://d10xg45o6p6dbl.cloudfront.net/projects/s/strawberry-perl/strawberry-=
perl-5.10.1.2-portable.zip
and extracted it.

ClamWin couldn't find any malware in either of those files (or
anywhere else in the Strawberry distro, for that matter).
Maybe I should switch to using ZoneAlarm ;-)

Incidentally, I get the following hashes for xmlcatalog.exe:

MD5: b39677b4d1731a888c909f0e4d86cf36
SHA1: e30df004575008b9b53efc99863c81121b60b01a
SHA256:
f62576f055199e4a7dba50e8e1a581834b4dcc17208ce14ba337573c588bd36b

and the following for dmake.exe:

MD5: 6ba036e4ea092150bf860fc3d9bb86dc
SHA1: b722621998333fe53190ccf6296984b120f94ccc
SHA256:
c48149051ab3393caba80d9882158b958df5825d7405a417401f638af89ed3dc

If you're getting different for those files, then I suggest that
something has corrupted them.
I don't for one moment believe that those files are corrupted at their
source.

Cheers,
Rob


------------------------------

Date: Thu, 04 Nov 2010 12:38:46 -0700
From: sln@netherlands.com
Subject: Re: Malware in Strawberry Perl v5.10.1.2
Message-Id: <5m26d6pdo7voetaqier3i8io3bme0cla9u@4ax.com>

On Thu, 4 Nov 2010 06:04:01 -0700 (PDT), sisyphus <sisyphus359@gmail.com> wrote:

>On Nov 4, 6:04 pm, whitesmith <apasse...@hushmail.com> wrote:
>
>I don't for one moment believe that those files are corrupted at their
>source.
>
^^^^
It would be a sad day indeed.

-sln


------------------------------

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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 V11 Issue 3198
***************************************


home help back first fref pref prev next nref lref last post