[30711] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1956 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 1 16:09:54 2008

Date: Sat, 1 Nov 2008 13:09:17 -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           Sat, 1 Nov 2008     Volume: 11 Number: 1956

Today's topics:
        !!!! Boobie Battle Armor Protect Womans Breasts Video P rapidshareboobs1@gmail.com
        /^From:.*?([\w.-]+@[\w.-]+)/ <xiaoxia2005a@yahoo.com>
    Re: /^From:.*?([\w.-]+@[\w.-]+)/ <tim@burlyhost.com>
    Re: /^From:.*?([\w.-]+@[\w.-]+)/ <jurgenex@hotmail.com>
    Re: /^From:.*?([\w.-]+@[\w.-]+)/ <tadmc@seesig.invalid>
    Re: /^From:.*?([\w.-]+@[\w.-]+)/ <tim@burlyhost.com>
    Re: /^From:.*?([\w.-]+@[\w.-]+)/ <xiaoxia2005a@yahoo.com>
    Re: /^From:.*?([\w.-]+@[\w.-]+)/ <jurgenex@hotmail.com>
    Re: /^From:.*?([\w.-]+@[\w.-]+)/ <xiaoxia2005a@yahoo.com>
    Re: /^From:.*?([\w.-]+@[\w.-]+)/ <xiaoxia2005a@yahoo.com>
    Re: /^From:.*?([\w.-]+@[\w.-]+)/ <tim@burlyhost.com>
    Re: /^From:.*?([\w.-]+@[\w.-]+)/ <jurgenex@hotmail.com>
    Re: /^From:.*?([\w.-]+@[\w.-]+)/ <jurgenex@hotmail.com>
        Distribution description on CPAN <sun_tong_001@users.sourceforge.net>
    Re: How to overwrite or mock -e for testing? <someone@example.com>
    Re: How to overwrite or mock -e for testing? <nospam-abuse@ilyaz.org>
    Re: if ($line == $count++) <xiaoxia2005a@yahoo.com>
    Re: if ($line == $count++) <tim@burlyhost.com>
        new CPAN modules on Sat Nov  1 2008 (Randal Schwartz)
    Re: out of memory (fidokomik\)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 1 Nov 2008 02:06:01 -0700 (PDT)
From: rapidshareboobs1@gmail.com
Subject: !!!! Boobie Battle Armor Protect Womans Breasts Video Pics Download
Message-Id: <b60aa045-ba9a-45a0-bc54-6f2d3a386fd4@e38g2000prn.googlegroups.com>

Download http://militarybodyarmor.blogspot.com/2008/10/law-enforcement-certifications.html
- Hilarious Home video of Naked Chicks taking bullets to the boobs and
shooting guns naked !!!


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

Date: Fri, 31 Oct 2008 20:00:57 -0700 (PDT)
From: April <xiaoxia2005a@yahoo.com>
Subject: /^From:.*?([\w.-]+@[\w.-]+)/
Message-Id: <19c6cc6f-ddbc-46f6-8d0b-ef1613856894@d36g2000prf.googlegroups.com>

found this re which claimed to match an email address:

/^From:.*?([\w.-]+@[\w.-]+)/

not sure I fully understand it, any help would be highly appreciated!

-- I especially having issues with the ".*?" part and also could not
find the meaning of "-" here.


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

Date: Fri, 31 Oct 2008 21:21:45 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: /^From:.*?([\w.-]+@[\w.-]+)/
Message-Id: <uPQOk.14893$f_7.6215@newsfe01.iad>

April wrote:

> found this re which claimed to match an email address:
> 
> /^From:.*?([\w.-]+@[\w.-]+)/
> 
> not sure I fully understand it, any help would be highly appreciated!
> 
> -- I especially having issues with the ".*?" part and also could not
> find the meaning of "-" here.

^ start of string.
From: Start of string that starts with From:
 .*? zero or more characters (. is any character) non greedy (?)
anything in (...) is captured.
[ ] is a character class of \w (any word character a-z and underscores
_) or a dash (hyphen)
[...]+  wher e+ is one or more of the characters in the []
@ speaks for itself, though it should be \@, I'm sure (escaped).
Another char class, with one or more characters.

Unfortunately, that regular expression isn't very good.  Not that a
regex is able to always accurately tell if it looks acceptable (and
certainly it can't know it's a real address), that above fails to do
some reasonable checks.  After all, someone could put it as From: -@-
and it would be seen as valid... and so on.  I'd recommend using a
different script or regular expression if you plan to use that script.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Fri, 31 Oct 2008 21:37:42 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: /^From:.*?([\w.-]+@[\w.-]+)/
Message-Id: <82nng45m9p5tj3bu8v2oc0d6ud800etev8@4ax.com>

April <xiaoxia2005a@yahoo.com> wrote:
>found this re which claimed to match an email address:

Well, it might, for some. And it will match many non-email addresses and
will fail to match many actual addresses, too.

>/^From:.*?([\w.-]+@[\w.-]+)/
>
>not sure I fully understand it, any help would be highly appreciated!

It is a very(!) poor attempt. See 'perldoc -q valid' 
	"How do I check a valid mail address?"
for a discussion of the problems and more appropriate options.

jue


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

Date: Fri, 31 Oct 2008 23:41:17 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: /^From:.*?([\w.-]+@[\w.-]+)/
Message-Id: <slrnggnnfd.8ff.tadmc@tadmc30.sbcglobal.net>

Tim Greer <tim@burlyhost.com> wrote:
> April wrote:
>
>> found this re which claimed to match an email address:
>> 
>> /^From:.*?([\w.-]+@[\w.-]+)/
>> 
>> not sure I fully understand it, any help would be highly appreciated!
>> 
>> -- I especially having issues with the ".*?" part and also could not
>> find the meaning of "-" here.


hyphen here means a hyphen character, ie. it is not a metacharacter.


> [ ] is a character class of \w (any word character a-z and underscores
> _) 


\w also includes the digit characters.


> or a dash (hyphen)


or a dot character.


> @ speaks for itself, though it should be \@, I'm sure (escaped).


Why are you sure?

It does not need to be escaped, so you must misunderstand something...


> Unfortunately, that regular expression isn't very good.


That is for sure.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Fri, 31 Oct 2008 23:22:29 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: /^From:.*?([\w.-]+@[\w.-]+)/
Message-Id: <FASOk.4430$Dm5.275@newsfe01.iad>

Tad J McClellan wrote:

> Tim Greer <tim@burlyhost.com> wrote:
>> April wrote:
>>
>>> found this re which claimed to match an email address:
>>> 
>>> /^From:.*?([\w.-]+@[\w.-]+)/
>>> 
>>> not sure I fully understand it, any help would be highly
>>> appreciated!
>>> 
>>> -- I especially having issues with the ".*?" part and also could not
>>> find the meaning of "-" here.
> 
> 
> hyphen here means a hyphen character, ie. it is not a metacharacter.
> 
> 
>> [ ] is a character class of \w (any word character a-z and
>> [ underscores
>> _)
> 
> 
> \w also includes the digit characters.

> 
>> or a dash (hyphen)
> 
> 
> or a dot character.
> 
>> @ speaks for itself, though it should be \@, I'm sure (escaped).
> 
> 
> Why are you sure?
> 
> It does not need to be escaped, so you must misunderstand something...
> 


I don't know what I was thinking earlier.  Thanks for pointing out those
flaws in my response.

-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Sat, 1 Nov 2008 06:54:59 -0700 (PDT)
From: April <xiaoxia2005a@yahoo.com>
Subject: Re: /^From:.*?([\w.-]+@[\w.-]+)/
Message-Id: <784fe8c0-ca2c-4d01-b616-26d5dbefbd08@p10g2000prf.googlegroups.com>

On Nov 1, 2:22=A0am, Tim Greer <t...@burlyhost.com> wrote:
> Tad J McClellan wrote:
> > Tim Greer <t...@burlyhost.com> wrote:
> >> April wrote:
>
> >>> found this re which claimed to match an email address:
>
> >>> /^From:.*?([\w.-]+@[\w.-]+)/
>
> >>> not sure I fully understand it, any help would be highly
> >>> appreciated!
>
> >>> -- I especially having issues with the ".*?" part and also could not
> >>> find the meaning of "-" here.
>
> > hyphen here means a hyphen character, ie. it is not a metacharacter.
>
> >> [ ] is a character class of \w (any word character a-z and
> >> [ underscores
> >> _)
>
> > \w also includes the digit characters.
>
> >> or a dash (hyphen)
>
> > or a dot character.
>
> >> @ speaks for itself, though it should be \@, I'm sure (escaped).
>
> > Why are you sure?
>
> > It does not need to be escaped, so you must misunderstand something...
>
> I don't know what I was thinking earlier. =A0Thanks for pointing out thos=
e
> flaws in my response.
>
> --
> Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
> Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
> and Custom Hosting. =A024/7 support, 30 day guarantee, secure servers.
> Industry's most experienced staff! -- Web Hosting With Muscle!- Hide quot=
ed text -
>
> - Show quoted text -

Thanks Tim, Tad and Jue .. now it's much clear to me!  One thing left
is whether .*? simply means anything appears before (...)?  April


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

Date: Sat, 01 Nov 2008 09:34:36 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: /^From:.*?([\w.-]+@[\w.-]+)/
Message-Id: <at0pg4dp8gslhcpsl7qtktv9nm8j8vrkqm@4ax.com>

April <xiaoxia2005a@yahoo.com> wrote:
>> >> April wrote:
>>
>> >>> /^From:.*?([\w.-]+@[\w.-]+)/
>>
>> --
>> Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
>> Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
>> and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
>> Industry's most experienced staff! -- Web Hosting With Muscle!- Hide quoted text -

[Please do not quote signatures]

>> - Show quoted text -

Is this line meant to mean anything?

>Thanks Tim, Tad and Jue .. now it's much clear to me!  One thing left
>is whether .*? simply means anything appears before (...)?  April

<quoted from Tim>
 .*? zero or more characters (. is any character) non greedy (?)
</quote>
:
Why don't you go and check 'perldoc perlre'? There you will find
        .   Match any character (except newline)
        *      Match 0 or more times
And the meaning of ? is explained two paragraphs down from there.

jue


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

Date: Sat, 1 Nov 2008 11:25:03 -0700 (PDT)
From: April <xiaoxia2005a@yahoo.com>
Subject: Re: /^From:.*?([\w.-]+@[\w.-]+)/
Message-Id: <55483950-83e3-4592-860f-2975c038ddf8@p31g2000prf.googlegroups.com>

On Nov 1, 12:34=A0pm, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> April <xiaoxia20...@yahoo.com> wrote:
> >> >> April wrote:
>
> >> >>> /^From:.*?([\w.-]+@[\w.-]+)/
>
> >> --
> >> Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
> >> Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
> >> and Custom Hosting. =A024/7 support, 30 day guarantee, secure servers.
> >> Industry's most experienced staff! -- Web Hosting With Muscle!- Hide q=
uoted text -
>
> [Please do not quote signatures]
>
> >> - Show quoted text -
>
> Is this line meant to mean anything?
>
> >Thanks Tim, Tad and Jue .. now it's much clear to me! =A0One thing left
> >is whether .*? simply means anything appears before (...)? =A0April
>
> <quoted from Tim>
> .*? zero or more characters (. is any character) non greedy (?)
> </quote>
> :
> Why don't you go and check 'perldoc perlre'? There you will find
> =A0 =A0 =A0 =A0 . =A0 Match any character (except newline)
> =A0 =A0 =A0 =A0 * =A0 =A0 =A0Match 0 or more times
> And the meaning of ? is explained two paragraphs down from there.
>
> jue

not sure what viewer you are using, I'm using Google group and what
you gets is the default.

Also, no one learns a language by reading docs alone I guess .. I
appreciate your input when you care, otherwise you may choose to skip
please.




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

Date: Sat, 1 Nov 2008 11:43:42 -0700 (PDT)
From: April <xiaoxia2005a@yahoo.com>
Subject: Re: /^From:.*?([\w.-]+@[\w.-]+)/
Message-Id: <373c9887-923c-4020-ab68-3df2381dae50@n33g2000pri.googlegroups.com>

On Nov 1, 9:54=A0am, April <xiaoxia20...@yahoo.com> wrote:
> On Nov 1, 2:22=A0am, Tim Greer <t...@burlyhost.com> wrote:
>
>
>
>
>
> > Tad J McClellan wrote:
> > > Tim Greer <t...@burlyhost.com> wrote:
> > >> April wrote:
>
> > >>> found this re which claimed to match an email address:
>
> > >>> /^From:.*?([\w.-]+@[\w.-]+)/
>
> > >>> not sure I fully understand it, any help would be highly
> > >>> appreciated!
>
> > >>> -- I especially having issues with the ".*?" part and also could no=
t
> > >>> find the meaning of "-" here.
>
> > > hyphen here means a hyphen character, ie. it is not a metacharacter.
>
> > >> [ ] is a character class of \w (any word character a-z and
> > >> [ underscores
> > >> _)
>
> > > \w also includes the digit characters.
>
> > >> or a dash (hyphen)
>
> > > or a dot character.
>
> > >> @ speaks for itself, though it should be \@, I'm sure (escaped).
>
> > > Why are you sure?
>
> > > It does not need to be escaped, so you must misunderstand something..=
 .
>
> > I don't know what I was thinking earlier. =A0Thanks for pointing out th=
ose
> > flaws in my response.
>
> > --
> > Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
> > Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
> > and Custom Hosting. =A024/7 support, 30 day guarantee, secure servers.
> > Industry's most experienced staff! -- Web Hosting With Muscle!- Hide qu=
oted text -
>
> > - Show quoted text -
>
> Thanks Tim, Tad and Jue .. now it's much clear to me! =A0One thing left
> is whether .*? simply means anything appears before (...)? =A0April- Hide=
 quoted text -
>
> - Show quoted text -

The reason I wasn't sure is that the following cannot be picked up by
an if test:

    From wrw@bayview.com Tue Apr 24 11:02:41 2002

if test:  elsif ($header && /^From:.*?([\w.-]+@[\w.-]+)/)

I modified From: to From in the above and also checked still in the
header secton.

In fact this is from the bayview website, Exercise "Analyze Mail
Folder", solution and auxilary files, but seems the solution is not
working for this part.






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

Date: Sat, 01 Nov 2008 12:02:23 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: /^From:.*?([\w.-]+@[\w.-]+)/
Message-Id: <4J1Pk.28435$f_7.16351@newsfe01.iad>

April wrote:

> if test:  elsif ($header && ^From:.*?([\w.-]+@[\w.-]+))

The above isn't showing any delimiters for me.  Anyway, the From in your
example doesn't have a colon (:) following it in the actual email
"from" line you posted.  Where/what is $_ coming from for your check? 
If $_ isn't what you want to check against, you might want $variable
=~ /m/.  Anyway, try chaning it to  /^From:?.*?([\w.-]+@[\w.-]+)/  :?
makes ":" optional in the regex match.

Also, do you want to capture the address?  If not, you don't need to use
() in the regex.  Again, I'd suggest a better check, especially if you
want to ensure it makes some attempt to verify it's at least a
legitimate _looking_ email address, but if you're not doing that, then
I suppose thw above should work for capturing most.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Sat, 01 Nov 2008 12:36:08 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: /^From:.*?([\w.-]+@[\w.-]+)/
Message-Id: <fi9pg4tql55dtbp43g7purrtdonslnb9eu@4ax.com>

April <xiaoxia2005a@yahoo.com> wrote:
>On Nov 1, 12:34 pm, Jürgen Exner <jurge...@hotmail.com> wrote:
>> [Please do not quote signatures]
>> >> - Show quoted text -
>> Is this line meant to mean anything?

>not sure what viewer you are using,

I am not using any viewer. As you can easily see in the headers
currently I am using Forte Agent as my newsreader.

>I'm using Google group and what

If you prefer a crude web page interface lacking any features and having
poor performance then of course that's your choice. 

>you gets is the default.

It has been customary for the past 25+ years to trim quotes to those
parts that are relevant to your reply. If Google Groups doesn't allow
you to do that then this is one more reason to avoid it.

Also I can only guess that your comment was related to those parts that
I quoted above and not to those that I snipped, because you didn't
bother to remove those that were irrelevant to your reply.

>Also, no one learns a language by reading docs alone I guess .. I
>appreciate your input when you care, otherwise you may choose to skip
>please.

http://www.catb.org/~esr/faqs/smart-questions.html, in particular
http://www.catb.org/~esr/faqs/smart-questions.html#examples

You didn't show any indication about if or what you tried already to
answer the question yourself and neither what your underlying goals
where. This leaves the door wide open to all kinds of guesses including
but not limited to someone is too lazy to read TFM for himself, someone
is fishing for free lunch, someone did read TFM but didn't understand it
(too bad he didn't say which parts he has trouble with), someone didn't
know where to find TFM, ...

The case of  "I am learning the language and just got stuck at this
specific spot and need a little help with it" unfortunately is the least
common case and therefore typically not the default assumption when all
indications for background and motivation are missing.

A suggestion: 
If you want to learn about REs, then you could have sad so easily.
'I am learning REs and found this example: /^From:.*?([\w.-]+@[\w.-]+)/
Although I checked 'perldoc perlre' I still don't understand the '.*?'.
Could someone explain, please?'

This is very different from your question. Now people know what you are
after (so there is no need to go off on irrelevant tangents like the FAQ
answer on validating email addresses), what you tried already (so there
is no need to repeat that), and they know exactly where you got stuck
(so the answer can be specific and targeted).

jue


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

Date: Sat, 01 Nov 2008 12:42:51 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: /^From:.*?([\w.-]+@[\w.-]+)/
Message-Id: <f6cpg4tjk6p9lc1n95482sjlv666btpms8@4ax.com>

April <xiaoxia2005a@yahoo.com> wrote:
>The reason I wasn't sure is that the following cannot be picked up by
>an if test:
>
>    From wrw@bayview.com Tue Apr 24 11:02:41 2002
>
>if test:  elsif ($header && /^From:.*?([\w.-]+@[\w.-]+)/)
>
>I modified From: to From in the above 

Well, the RE is explicitely asking for that colon. If it doesn't exist
in the text, then the RE won't match.

>and also checked still in the header secton.

No idea what you mean by that sentence.

jue


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

Date: Sat, 01 Nov 2008 12:31:41 -0500
From: * Tong * <sun_tong_001@users.sourceforge.net>
Subject: Distribution description on CPAN
Message-Id: <WIydnUeEk9XgD5HUnZ2dnUVZ_jWdnZ2d@golden.net>

Hi,

The "Distribution" entries on my CPAN page don't have the description.  
How can I make sure that my uploaded module have the description in the 
"Distribution" entry?

thanks


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

Date: Fri, 31 Oct 2008 18:39:43 -0700
From: "John W. Krahn" <someone@example.com>
Subject: Re: How to overwrite or mock -e for testing?
Message-Id: <yrOOk.18611$sh3.6258@newsfe01.iad>

Michele Dondi wrote:
> On Fri, 31 Oct 2008 20:50:28 +0000 (UTC), Ilya Zakharevich
> <nospam-abuse@ilyaz.org> wrote:
> 
>>>> that the inverse implication does not hold[*].
>> ...   And where is [*]?
> 
> It was in the twice quoted message. Pasted hereafter:
> 
> : [*] E.g. require() returns undef() but I have *seen* it duly
> : overridden.
> 
>>>> Anyway, as they say, the proof of the pudding is in the eating: the
>>>> above in fact would imply that -X functions are *not* overridable.
>> This is what I would like to change if I ever work on Perl again: it
>> must have a concept of IFS in the core...
> 
> And... What is IFS supposed to mean?

Input Field Separator



John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


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

Date: Sat, 1 Nov 2008 06:59:51 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: How to overwrite or mock -e for testing?
Message-Id: <gegup7$212q$1@agate.berkeley.edu>

[A complimentary Cc of this posting was NOT [per weedlist] sent to
Michele Dondi 
<bik.mido@tiscalinet.it>], who wrote in article <p2tmg49ohjh6u3rrtmu9o7oobrh4btdp6e@4ax.com>:
> >> >Anyway, as they say, the proof of the pudding is in the eating: the
> >> >above in fact would imply that -X functions are *not* overridable.
> >
> >This is what I would like to change if I ever work on Perl again: it
> >must have a concept of IFS in the core...

> And... What is IFS supposed to mean?

Something like

  my $fs = Installible::FileSystem::FTP->new('ftp://ftp/perl.org/CPAN');
  chdir $fs;
  # After this all filesystem operators are redirected as method calls
  # on $fs

So you can use File::Find to traverse FTP directories, etc.

Hope this helps,
Ilya


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

Date: Sat, 1 Nov 2008 11:56:22 -0700 (PDT)
From: April <xiaoxia2005a@yahoo.com>
Subject: Re: if ($line == $count++)
Message-Id: <c9a2c79d-5eac-48df-be2a-0e62e2877d87@x16g2000prn.googlegroups.com>

On Oct 30, 4:27=A0pm, Tim Greer <t...@burlyhost.com> wrote:
> April wrote:
> > looking at the following, if $line has values of 1, 2, 3, ... will the
> > if test ever tests true when $line equals 1? =A0It seems it won't as
> > $count starts as 1 and then the test with $count++ (=3D2), but the
> > execution suggests otherwise ...
>
> > =A0 =A0 my $count =3D 1;
> > =A0 =A0 while(<IN>)
> > =A0 =A0 {
> > =A0 =A0 =A0 =A0 if ($line =3D=3D $count++)
> > =A0 =A0 =A0 =A0 {
> > =A0 =A0 =A0 =A0 =A0 =A0 $deleted =3D $_;
> > =A0 =A0 =A0 =A0 =A0 =A0 next;
> > =A0 =A0 =A0 =A0 }
> > =A0 =A0 =A0 =A0 print OUT;
> > =A0 =A0 }
>
> See the difference (for example) between $count++ and ++$count.
> --
> Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
> Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
> and Custom Hosting. =A024/7 support, 30 day guarantee, secure servers.
> Industry's most experienced staff! -- Web Hosting With Muscle!- Hide quot=
ed text -
>
> - Show quoted text -

thanks Tim, haven't tested but guess ++$count would increment first?


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

Date: Sat, 01 Nov 2008 12:12:02 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: if ($line == $count++)
Message-Id: <7S1Pk.28438$f_7.6403@newsfe01.iad>

April wrote:

> On Oct 30, 4:27 pm, Tim Greer <t...@burlyhost.com> wrote:
>> April wrote:
>> > looking at the following, if $line has values of 1, 2, 3, ... will
>> > the if test ever tests true when $line equals 1?  It seems it won't
>> > as $count starts as 1 and then the test with $count++ (=2), but the
>> > execution suggests otherwise ...
>>
>> > my $count = 1;
>> > while(<IN>)
>> > {
>> > if ($line == $count++)
>> > {
>> > $deleted = $_;
>> > next;
>> > }
>> > print OUT;
>> > }
>>
>> See the difference (for example) between $count++ and ++$count.
<please don't quote signatures>
>>
>> - Show quoted text -
> 
> thanks Tim, haven't tested but guess ++$count would increment first?

perldoc perlop:

       Auto-increment and Auto-decrement

       "++" and "--" work as in C.  That is, if placed before a
variable, they increment or decrement the variable by one before
returning the value, and if placed after, increment or decrement after
returning the value.

           $i = 0;  $j = 0;
           print $i++;  # prints 0
           print ++$j;  # prints 1

Now, if this will work for you, your purposes and your code, and how you
want, is something I can't say, but that is the general idea.  As
another poster stated, using $. for line counting is probably a better
idea, but it really depends on what you're doing.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Sat, 1 Nov 2008 04:42:22 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Nov  1 2008
Message-Id: <K9n12M.1BI6@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Acme-CPANAuthors-0.06
http://search.cpan.org/~ishigaki/Acme-CPANAuthors-0.06/
We are CPAN authors 
----
Acme-PlayCode-0.10
http://search.cpan.org/~fayland/Acme-PlayCode-0.10/
Play code to win 
----
Apache2-ASP-2.00_14
http://search.cpan.org/~johnd/Apache2-ASP-2.00_14/
ASP for Perl, reloaded. 
----
Bread-Board-0.04
http://search.cpan.org/~stevan/Bread-Board-0.04/
A solderless way to wire up you application components 
----
CGI-Session-Driver-memcached-0.03
http://search.cpan.org/~oinume/CGI-Session-Driver-memcached-0.03/
CGI::Session driver for memcached 
----
CGI-Utils-0.11
http://search.cpan.org/~dowens/CGI-Utils-0.11/
Utilities for retrieving information through the Common Gateway Interface 
----
CHI-Driver-MemcachedFast-0.01
http://search.cpan.org/~kitano/CHI-Driver-MemcachedFast-0.01/
Distributed cache via memcached (memory cache daemon) 
----
CPAN-Checksums-2.02
http://search.cpan.org/~andk/CPAN-Checksums-2.02/
Write a CHECKSUMS file for a directory as on CPAN 
----
CPAN-PackageDetails-0.12
http://search.cpan.org/~bdfoy/CPAN-PackageDetails-0.12/
Create or read 02.packages.details.txt.gz 
----
ClearPress-263
http://search.cpan.org/~rpettett/ClearPress-263/
Simple, fresh & fruity MVC framework 
----
Data-Peek-0.24
http://search.cpan.org/~hmbrand/Data-Peek-0.24/
A collection of low-level debug facilities 
----
Data-Taxi-0.95
http://search.cpan.org/~miko/Data-Taxi-0.95/
Taint-aware, XML-ish data serialization 
----
Devel-DLMProf-0.01
http://search.cpan.org/~kitano/Devel-DLMProf-0.01/
----
Devel-DLMProf-0.02
http://search.cpan.org/~kitano/Devel-DLMProf-0.02/
----
Devel-NYTProf-2.06_RC1
http://search.cpan.org/~timb/Devel-NYTProf-2.06_RC1/
Powerful feature-rich perl source code profiler 
----
Devel-PPPort-3.14_05
http://search.cpan.org/~mhx/Devel-PPPort-3.14_05/
Perl/Pollution/Portability 
----
File-Similars-1.7
http://search.cpan.org/~suntong/File-Similars-1.7/
----
Gtk2-Ex-TickerView-9
http://search.cpan.org/~kryde/Gtk2-Ex-TickerView-9/
scrolling ticker display widget 
----
HTML-QRCode-0.01
http://search.cpan.org/~hide/HTML-QRCode-0.01/
Generate HTML based QR Code 
----
KiokuDB-0.04
http://search.cpan.org/~nuffin/KiokuDB-0.04/
Object Graph storage engine 
----
KiokuDB-0.05
http://search.cpan.org/~nuffin/KiokuDB-0.05/
Object Graph storage engine 
----
KiokuDB-0.06
http://search.cpan.org/~nuffin/KiokuDB-0.06/
Object Graph storage engine 
----
KiokuDB-0.07
http://search.cpan.org/~nuffin/KiokuDB-0.07/
Object Graph storage engine 
----
KiokuDB-Backend-BDB-0.03
http://search.cpan.org/~nuffin/KiokuDB-Backend-BDB-0.03/
----
KiokuDB-Backend-JSPON-0.02
http://search.cpan.org/~nuffin/KiokuDB-Backend-JSPON-0.02/
JSON file backend with JSPON reference semantics 
----
KiokuDB-Backend-JSPON-0.03
http://search.cpan.org/~nuffin/KiokuDB-Backend-JSPON-0.03/
JSON file backend with JSPON reference semantics 
----
LEOCHARRE-Dev-1.09
http://search.cpan.org/~leocharre/LEOCHARRE-Dev-1.09/
----
LWPx-ParanoidAgent-1.04
http://search.cpan.org/~bradfitz/LWPx-ParanoidAgent-1.04/
subclass of LWP::UserAgent that protects you from harm 
----
Linux-Ext2-FileAttributes-0.01
http://search.cpan.org/~dwilson/Linux-Ext2-FileAttributes-0.01/
Access to Ext2/3 filesystem extended attributes 
----
Locale-Country-Multilingual-0.10
http://search.cpan.org/~graf/Locale-Country-Multilingual-0.10/
mapping ISO codes to localized country names 
----
MP3-Tag-0.9713
http://search.cpan.org/~ilyaz/MP3-Tag-0.9713/
Module for reading tags of MP3 audio files 
----
Mail-SMTP-Honeypot-0.08
http://search.cpan.org/~miker/Mail-SMTP-Honeypot-0.08/
Dummy mail server 
----
Mail-SpamCannibal-0.97
http://search.cpan.org/~miker/Mail-SpamCannibal-0.97/
A tool to stop SPAM 
----
Math-SymbolicX-FastEvaluator-0.01
http://search.cpan.org/~smueller/Math-SymbolicX-FastEvaluator-0.01/
Fast, XS, stack-based formula evaluator 
----
Method-Cached-0.02
http://search.cpan.org/~boxphere/Method-Cached-0.02/
The return value of the method is cached to your storage 
----
Module-Install-DBICx-AutoDoc-0.03
http://search.cpan.org/~jmmills/Module-Install-DBICx-AutoDoc-0.03/
Use your Makefile to run DBICx::AutoDoc 
----
MojoMojo-0.999021
http://search.cpan.org/~mramberg/MojoMojo-0.999021/
A Catalyst & DBIx::Class powered Wiki. 
----
MooseX-CurriedHandles-0.03
http://search.cpan.org/~rataxis/MooseX-CurriedHandles-0.03/
Delegate methods to member objects, curried with more methods! 
----
MyCPAN-Indexer-1.17_04
http://search.cpan.org/~bdfoy/MyCPAN-Indexer-1.17_04/
Index a Perl distribution 
----
Net-Bind-rbldnsdAccessor-0.05
http://search.cpan.org/~miker/Net-Bind-rbldnsdAccessor-0.05/
access rbldnsd files with Perl or BIND 
----
Net-Connection-Sniffer-0.27
http://search.cpan.org/~miker/Net-Connection-Sniffer-0.27/
gather stats on network connections 
----
Net-DNSBL-Monitor-0.04
http://search.cpan.org/~miker/Net-DNSBL-Monitor-0.04/
Monitor DNSBL response 
----
Net-DNSBL-Statistics-0.06
http://search.cpan.org/~miker/Net-DNSBL-Statistics-0.06/
gather DNSBL Statistics 
----
Net-IMAP-Client-0.5
http://search.cpan.org/~mishoo/Net-IMAP-Client-0.5/
Not so simple IMAP client library 
----
Net-IMAP-Simple-Plus-1.17006
http://search.cpan.org/~jettero/Net-IMAP-Simple-Plus-1.17006/
NIS 1.71 plus a couple patches 
----
Net-SFTP-Foreign-1.45_04
http://search.cpan.org/~salva/Net-SFTP-Foreign-1.45_04/
SSH File Transfer Protocol client 
----
Net-SIP-0.50
http://search.cpan.org/~sullr/Net-SIP-0.50/
Framework SIP (Voice Over IP, RFC3261) 
----
Perlwikipedia-1.3.6
http://search.cpan.org/~dcollins/Perlwikipedia-1.3.6/
a Wikipedia bot framework written in Perl 
----
Pod-2-DocBook-0.02
http://search.cpan.org/~jkutej/Pod-2-DocBook-0.02/
Convert Pod data to DocBook SGML 
----
RT-Authen-ExternalAuth-0.06_03
http://search.cpan.org/~zordrak/RT-Authen-ExternalAuth-0.06_03/
RT Authentication using External Sources 
----
RT-Extension-ExtractCustomFieldValues-1.8
http://search.cpan.org/~alexmv/RT-Extension-ExtractCustomFieldValues-1.8/
----
Rose-DBx-Object-Indexed-0.001
http://search.cpan.org/~karman/Rose-DBx-Object-Indexed-0.001/
full-text search for RDBO classes 
----
SWISH-Prog-0.21
http://search.cpan.org/~karman/SWISH-Prog-0.21/
information retrieval application framework 
----
Search-GIN-0.03
http://search.cpan.org/~nuffin/Search-GIN-0.03/
Generalized Inverted Indexing 
----
TAP-Harness-JUnit-0.24
http://search.cpan.org/~lkundrak/TAP-Harness-JUnit-0.24/
Generate JUnit compatible output from TAP results 
----
TM-Corpus-0.05
http://search.cpan.org/~drrho/TM-Corpus-0.05/
Topic Maps, Document Corpus 
----
Term-QRCode-0.01
http://search.cpan.org/~yappo/Term-QRCode-0.01/
Generate terminal base QR Code 
----
Text-CSV_XS-0.58
http://search.cpan.org/~hmbrand/Text-CSV_XS-0.58/
comma-separated values manipulation routines 
----
Text-QRCode-0.01
http://search.cpan.org/~kurihara/Text-QRCode-0.01/
Generate text base QR Code 
----
Tk-Pod-0.9939_54
http://search.cpan.org/~srezic/Tk-Pod-0.9939_54/
Pod browser toplevel widget 
----
Win32-PowerPoint-0.09
http://search.cpan.org/~ishigaki/Win32-PowerPoint-0.09/
helps to convert texts to PP slides 
----
excel2txt-0.02
http://search.cpan.org/~kclark/excel2txt-0.02/
convert Excel data to delimited text files 
----
file_similars-1.6
http://search.cpan.org/~suntong/file_similars-1.6/
----
ikiwiki-plugin-syntax_0.24
http://search.cpan.org/~vmoral/ikiwiki-plugin-syntax_0.24/
----
re-engine-LPEG-0.02
http://search.cpan.org/~perrad/re-engine-LPEG-0.02/
LPEG regular expression engine 


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Sat, 1 Nov 2008 02:20:38 +0100
From: "Petr Vileta \(fidokomik\)" <stoupa@practisoft.cz>
Subject: Re: out of memory
Message-Id: <gegb66$1rct$1@ns.felk.cvut.cz>

friend.05@gmail.com wrote:
> Hi,
>
> I want to parse large log file (in GBs)
>
> and I am readin 2-3 such files in hash array.
>
> But since it will very big hash array it is going out of memory.
>
> what are the other approach I can take.
>
>
If you want to compare lines in whole file or something similar then don't use 
array or hash but try to use MySQL and appropriate Perl module (DBI).
-- 
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail.
Send me your mail from another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>



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

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 V11 Issue 1956
***************************************


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