looking at parsing procedures
looking at parsing procedures
am 17.09.2007 09:41:10 von merl the perl
I have posted in the memorable past about using the Perl Programming
Language to make a unBuckeyesque yikes.
Instead of something thnt has to do with Ohio; im looking to develop my
first if statemnet. Hot here in the desert.
I would lijke to use tppl to test for a condition.
The condition for which I would like to test is whether the dude ho sends it
is 'Wade Ward'.
This person must use perl programming . Sometimes blind.
, and, for good measure, tja.
--
tja
and
Re: looking at parsing procedures
am 17.09.2007 20:10:54 von merl the perl
"merl the perl" wrote in message
news:0tKdnQDBi4kFvHPbnZ2dnUVZ_h6vnZ2d@comcast.com...
>I have posted in the memorable past about using the Perl Programming
>Language to make a unBuckeyesque yikes.
>
> Instead of something thnt has to do with Ohio; im looking to develop my
> first if statemnet. Hot here in the desert.
>
> I would lijke to use tppl to test for a condition.
>
> The condition for which I would like to test is whether the dude ho sends
> it is 'Wade Ward'.
>
> This person must use perl programming . Sometimes blind.
>
> , and, for good measure, tja.
Nice spelling, dude.
Instead, let's look at the subject line using the following script:
#!/usr/bin/perl -w
use strict;
use Net::NNTP ();
use constant NUMBER_OF_ARTICLES => 10;
use constant GROUP_NAME => 'alt.solaris.x86';
use constant SERVER_NAME => 'newsgroups.comcast.net';
use constant NNTP_DEBUG => 0;
my $nntp = Net::NNTP->new(SERVER_NAME, 'Debug' => NNTP_DEBUG) or die;
my $USER = '';
my $PASS = '';
$nntp->authinfo($USER,$PASS) or die $!;
my($article_count, $first_article, $last_article) =
$nntp->group(GROUP_NAME) or die;
# Which XOVER fields contain Subject: and From:?
my $count = 0;
my %xover_fmt = map( ($_, $count++), @{ $nntp->overview_fmt or die} );
die unless exists $xover_fmt{'Subject:'};
my $subject_offset = $xover_fmt{'Subject:'};
my $from_offset = $xover_fmt{'From:'};
my(@xover, $start_article);
RETRIEVE: while ($#xover+1 < NUMBER_OF_ARTICLES and $last_article >=
$first_article) {
# How many articles do we need? Stop retrieving if we have enough
my $articles_required = NUMBER_OF_ARTICLES - ($#xover+1) or last
RETRIEVE;
# Fetch overview information for the articles
$start_article = $last_article - ($articles_required-1);
$start_article = $start_article > $first_article ? $start_article :
$first_article;
my $xover_query = $start_article == $last_article ?
$start_article :
[$start_article, $last_article];
my $xover_ref = $nntp->xover($xover_query) or die;
# Store headers for the articles we've retrieved
foreach (sort {$b <=> $a} keys %$xover_ref) {
push @xover, $xover_ref->{$_};
}
} continue {
# Move the pointer forward to fetch previous articles
$last_article = $start_article - 1;
}
# Disconnect from the NNTP server
$nntp->quit;
print join("\n", map ($_->[$subject_offset].' from
'.$_->[$from_offset], @xover)),"\n";
# end script begin output
Re: Solaris compile problems from jjnunes@sonic.net
vmware tools for solaris 10 from apogeusistemas@gmail.com
Re: Question On Endianness And Solaris Sparc Versus IA32 File Systems from
andrew@cucumber.demon.co.uk (Andrew Gabriel)
Re: Question On Endianness And Solaris Sparc Versus IA32 File Systems from
Thomas Tornblom
Question On Endianness And Solaris Sparc Versus IA32 File Systems from
Thomas Dineen
Re: Dual boot from "Canuck57"
Re: yikes: OS 10 install from "Wade Ward"
video prpbs from "Trevor Dunstan"
Hot Jobs - HCL - Noida/Chennai/Gurgaon/Mumbai from simmidas2007@yahoo.co.in
Re: NICs and hyperthreading... from "Gary R. Schmidt"
How do I test the subject line to see whether 'Solaris' occurs?
--
Wade Ward
wade@zaxfuuq.net
"I ain't got time to bleed."
--Jesse the Chomco
Re: looking at parsing procedures
am 17.09.2007 21:00:03 von Michele Dondi
On Mon, 17 Sep 2007 11:10:54 -0700, "Wade Ward"
wrote:
>How do I test the subject line to see whether 'Solaris' occurs?
/Solaris/
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
Re: looking at parsing procedures
am 18.09.2007 08:02:34 von merl the perl
I've got backlash syndrom. After looking at linux and windows for twenty
years my chance of getting one or the other is fifty fifty, when the
difference matters.
So one indicates a string literal by bracketing with backslash?
--
Wade Ward
wade@zaxfuuq.net
"I ain't got time to bleed."
"Michele Dondi" wrote in message
news:vkjte31tvcgba67vpr7ej9f3rh089plceh@4ax.com...
> On Mon, 17 Sep 2007 11:10:54 -0700, "Wade Ward"
> wrote:
>
>>How do I test the subject line to see whether 'Solaris' occurs?
>
> /Solaris/
>
>
> Michele
> --
> {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
> (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^
> .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER
> 256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
Re: looking at parsing procedures
am 18.09.2007 11:40:42 von Michele Dondi
On Mon, 17 Sep 2007 23:02:34 -0700, "Wade Ward"
wrote:
>I've got backlash syndrom. After looking at linux and windows for twenty
Please try to quote properly. It's getting increasingly difficult to
reply to your posts. I had written:
: >How do I test the subject line to see whether 'Solaris' occurs?
:
: /Solaris/
Then you go on:
>years my chance of getting one or the other is fifty fifty, when the
>difference matters.
>
I just meant that if $str is your string then to test whether it
contains "Solaris" you can do
if ($str =~ /Solaris/) { ... }
If the string is in $_ you can just do
if (/Solaris/) { ... }
Or else you can use the specialized index() function about which you
can read in
perldoc -f index
But *IIRC* the regex engine optimizes the above match to index()
anyway.
>So one indicates a string literal by bracketing with backslash?
Huh?!? No, one specifies a literal string with the q() and qq()
operators, commonly disguised as '' and "" respectively. Instead you
can use the m() match operator to check for a pattern which needs not
be a literal string, but if it is (i.e. it contains no metacharachters
having a special meaning in regexen) then it is treated as a pattern
as well. If you use forward slashes as delimiters, then you can omit
the "m".
At this point I strongly recommend you to carefully read the "Quote
and Quote-like Operators" section in
perldoc perlop
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
Re: looking at parsing procedures
am 19.09.2007 08:25:01 von merl the perl
"Michele Dondi" wrote in message
news:v96ve3190qo083jkl2trbp4v9q3ob6kh5s@4ax.com...
> On Mon, 17 Sep 2007 23:02:34 -0700, "Wade Ward"
> wrote:
>
>>I've got backlash syndrom. After looking at linux and windows for twenty
>
> Please try to quote properly. It's getting increasingly difficult to
> reply to your posts. I had written:
>
> : >How do I test the subject line to see whether 'Solaris' occurs?
> :
> : /Solaris/
>
> Then you go on:
>
>>years my chance of getting one or the other is fifty fifty, when the
>>difference matters.
>>
>
>
> I just meant that if $str is your string then to test whether it
> contains "Solaris" you can do
>
> if ($str =~ /Solaris/) { ... }
>
> If the string is in $_ you can just do
>
> if (/Solaris/) { ... }
>
> Or else you can use the specialized index() function about which you
> can read in
>
> perldoc -f index
>
> But *IIRC* the regex engine optimizes the above match to index()
> anyway.
>
>>So one indicates a string literal by bracketing with backslash?
>
> Huh?!? No, one specifies a literal string with the q() and qq()
> operators, commonly disguised as '' and "" respectively. Instead you
> can use the m() match operator to check for a pattern which needs not
> be a literal string, but if it is (i.e. it contains no metacharachters
> having a special meaning in regexen) then it is treated as a pattern
> as well. If you use forward slashes as delimiters, then you can omit
> the "m".
>
> At this point I strongly recommend you to carefully read the "Quote
> and Quote-like Operators" section in
>
> perldoc perlop
>
>
I'll take a look tomorrow. I can't wait to get a printer. I'm gonna spend
a hundred bucks on the best perl reference. Ques que say?
--
Wade Ward
wade@zaxfuuq.net
"I ain't got time to bleed."
Re: looking at parsing procedures
am 21.09.2007 09:06:08 von merl the perl
"Wade Ward" wrote in message
news:O4-dncwwILFfL23bnZ2dnUVZ_rSinZ2d@comcast.com...
>
>
>
> "Michele Dondi" wrote in message
> news:v96ve3190qo083jkl2trbp4v9q3ob6kh5s@4ax.com...
>> On Mon, 17 Sep 2007 23:02:34 -0700, "Wade Ward"
>> wrote:
>>
>>>I've got backlash syndrom. After looking at linux and windows for twenty
>>
>> Please try to quote properly. It's getting increasingly difficult to
>> reply to your posts. I had written:
>>
>> : >How do I test the subject line to see whether 'Solaris' occurs?
>> :
>> : /Solaris/
>>
>> Then you go on:
>>
>>>years my chance of getting one or the other is fifty fifty, when the
>>>difference matters.
>>>
>>
>>
>> I just meant that if $str is your string then to test whether it
>> contains "Solaris" you can do
>>
>> if ($str =~ /Solaris/) { ... }
>>
>> If the string is in $_ you can just do
>>
>> if (/Solaris/) { ... }
>>
>> Or else you can use the specialized index() function about which you
>> can read in
>>
>> perldoc -f index
>>
>> But *IIRC* the regex engine optimizes the above match to index()
>> anyway.
>>
>>>So one indicates a string literal by bracketing with backslash?
>>
>> Huh?!? No, one specifies a literal string with the q() and qq()
>> operators, commonly disguised as '' and "" respectively. Instead you
>> can use the m() match operator to check for a pattern which needs not
>> be a literal string, but if it is (i.e. it contains no metacharachters
>> having a special meaning in regexen) then it is treated as a pattern
>> as well. If you use forward slashes as delimiters, then you can omit
>> the "m".
>>
>> At this point I strongly recommend you to carefully read the "Quote
>> and Quote-like Operators" section in
>>
>> perldoc perlop
>>
>>
> I'll take a look tomorrow. I can't wait to get a printer. I'm gonna
> spend a hundred bucks on the best perl reference. Ques que say?
http://www.zaxfuuq.net/perl2.htm
A little bit of technical art here. I had a big day that didn't involve me
doing what I said, as it regards perl. Instead, I'm using perl to provide
verification of Keith Thompson's c.l.c. troll nature.
One of the hardest things to teach people about picking up perl can use this
screendump as a reference. You could use text to describe it to a windows
user who doesn't know its significance, but a picture says a thousand words.
Of course, Keith can beat that that with either 2000/today or 2000/every
time he opens his fucking mouth.
--
Wade Ward
wade@zaxfuuq.net
"I ain't got time to bleed."