[28496] in Perl-Users-Digest
Perl-Users Digest, Issue: 9860 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 17 18:05:55 2006
Date: Tue, 17 Oct 2006 15:05:07 -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 Tue, 17 Oct 2006 Volume: 10 Number: 9860
Today's topics:
Re: ActivePerl Module Install <sherm@Sherm-Pendleys-Computer.local>
Re: ActivePerl Module Install <bradbrockman@yahoo.com>
Re: ActivePerl Module Install <christoph.lamprecht.no.spam@web.de>
Re: ActivePerl Module Install <sisyphus1@nomail.afraid.org>
Re: ActivePerl Module Install <sherm@Sherm-Pendleys-Computer.local>
Re: alarm() - SIGALRM sent too eariy? anno4000@radom.zrz.tu-berlin.de
Re: alarm() - SIGALRM sent too eariy? <nospam-abuse@ilyaz.org>
END{} block capabilities ? <ynl@nsparks.net>
Re: END{} block capabilities ? anno4000@radom.zrz.tu-berlin.de
Re: END{} block capabilities ? xhoster@gmail.com
Re: How to access a property within a class (reading news)
How to print "0A" LF or "03" ETX characters to a fileha jeffpierce12@hotmail.com
Re: How to print "0A" LF or "03" ETX characters to a fi <1usa@llenroc.ude.invalid>
Re: How to print "0A" LF or "03" ETX characters to a fi <jgibson@mail.arc.nasa.gov>
Re: I have no problems eating cereal...after it softens <bwilkins@gmail.com>
Re: I have no problems eating cereal...after it softens <jgibson@mail.arc.nasa.gov>
Re: I have no problems eating cereal...after it softens <bwilkins@gmail.com>
Re: modify posting guidelines to allow MIME charset=utf (reading news)
Re: modify posting guidelines to allow MIME charset=utf (Randal L. Schwartz)
Re: Need a Perl Scripting <jl_post@hotmail.com>
Re: Need a Perl Scripting <mark.clementsREMOVETHIS@wanadoo.fr>
question about cpan module <jialinli1981@gmail.com>
Re: strange behavior of -s $filename <jl_post@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 17 Oct 2006 14:12:01 -0400
From: Sherm Pendley <sherm@Sherm-Pendleys-Computer.local>
Subject: Re: ActivePerl Module Install
Message-Id: <m27iyyrevi.fsf@Sherm-Pendleys-Computer.local>
Ch Lamprecht <christoph.lamprecht.no.spam@web.de> writes:
> Sherm Pendley schrieb:
>>
>> So, to install Text::CSV::Separator (spelling is important!), you'd do:
>>
>> ppm install Text::CSV::Separator
>
> s/::/-/
Are you certain of that? Looks to me like either one will work.
From the PPM man page:
"ppm install pkg [ --area area ] [ --force ] [ --nodeps ]
ppm install module [ --area area ] [ --force ] [ --nodeps ]
ppm install file.ppd [ --area area ] [ --nodeps ]
ppm install url [ --area area ] [ --nodeps ]
ppm install num [ --area area ] [ --nodeps ]
Install a package and its dependencies.
The argument to ppm install can be the name of a package, the name of a
module provided by the package, the file name or the URL of a PPD file,
or the associated number for the package returned by the last ppm search
command."
It's been quite a while since I've used Windows, but Text::CSV::Separator sure
looks like the name of a module to me.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: 17 Oct 2006 11:35:14 -0700
From: "banker123" <bradbrockman@yahoo.com>
Subject: Re: ActivePerl Module Install
Message-Id: <1161110113.965022.216930@m7g2000cwm.googlegroups.com>
I installed the module using PPM GUI, thanks for the direction to use
PPM.
Sherm Pendley wrote:
> Ch Lamprecht <christoph.lamprecht.no.spam@web.de> writes:
>
> > Sherm Pendley schrieb:
> >>
> >> So, to install Text::CSV::Separator (spelling is important!), you'd do:
> >>
> >> ppm install Text::CSV::Separator
> >
> > s/::/-/
>
> Are you certain of that? Looks to me like either one will work.
>
> From the PPM man page:
>
> "ppm install pkg [ --area area ] [ --force ] [ --nodeps ]
> ppm install module [ --area area ] [ --force ] [ --nodeps ]
> ppm install file.ppd [ --area area ] [ --nodeps ]
> ppm install url [ --area area ] [ --nodeps ]
> ppm install num [ --area area ] [ --nodeps ]
>
> Install a package and its dependencies.
>
> The argument to ppm install can be the name of a package, the name of a
> module provided by the package, the file name or the URL of a PPD file,
> or the associated number for the package returned by the last ppm search
> command."
>
> It's been quite a while since I've used Windows, but Text::CSV::Separator sure
> looks like the name of a module to me.
>
> sherm--
>
> --
> Web Hosting by West Virginians, for West Virginians: http://wv-www.net
> Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Tue, 17 Oct 2006 20:57:13 +0200
From: Ch Lamprecht <christoph.lamprecht.no.spam@web.de>
Subject: Re: ActivePerl Module Install
Message-Id: <eh3929$5k2$1@online.de>
Sherm Pendley wrote:
> Ch Lamprecht <christoph.lamprecht.no.spam@web.de> writes:
>
>
>>Sherm Pendley schrieb:
>>
>>>So, to install Text::CSV::Separator (spelling is important!), you'd do:
>>>
>>> ppm install Text::CSV::Separator
>>
>>s/::/-/
>
>
> Are you certain of that? Looks to me like either one will work.
I am certain as far as my version is concerned:
PPM - Programmer's Package Manager version 3.3.
...
ppm> i Text::CSV::Separator
Searching for 'Text::CSV::Separator' returned no results. Try a broader search f
irst.
ppm> s text-csv-sep
Searching in Active Repositories
1. Text-CSV-Separator [0.07] Text-CSV-Separator
Christoph
--
perl -e "print scalar reverse q/ed.enilno@ergn.l.hc/"
------------------------------
Date: Wed, 18 Oct 2006 04:54:12 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: ActivePerl Module Install
Message-Id: <453527f0$0$5109$afc38c87@news.optusnet.com.au>
"banker123" <bradbrockman@yahoo.com> wrote in message
news:1161106047.734265.266650@m7g2000cwm.googlegroups.com...
.
.
> What I have tried:
> 1. Dowloaded the module to the directory above
> 2. From the directory above run makefile.pl (writing makefile for
> Text::CSV::Seperator
> 3. Run dmake (file mot found)
> 4. Include dmake directory in Path (c:\perl\libConfig.pm not found)
I don't know of any Win32 version of perl that ships *without* Config.pm.
Seems an odd thing to happen.
What you tried should have worked - if you're running a perl that was built
using dmake, or an ActiveState build of perl 5.8.8 that's more recent than
build 816.
The fact that it *didn't* work may not bother you if you stick to using PPM,
though if it were me I'd want to know why Config.pm was not found.
Cheers,
Rob
------------------------------
Date: Tue, 17 Oct 2006 15:28:25 -0400
From: Sherm Pendley <sherm@Sherm-Pendleys-Computer.local>
Subject: Re: ActivePerl Module Install
Message-Id: <m2zmbupwrq.fsf@Sherm-Pendleys-Computer.local>
Ch Lamprecht <christoph.lamprecht.no.spam@web.de> writes:
> Sherm Pendley wrote:
>> Ch Lamprecht <christoph.lamprecht.no.spam@web.de> writes:
>>
>>
>>>Sherm Pendley schrieb:
>>>
>>>>So, to install Text::CSV::Separator (spelling is important!), you'd do:
>>>>
>>>> ppm install Text::CSV::Separator
>>>
>>>s/::/-/
>>
>>
>> Are you certain of that? Looks to me like either one will work.
> I am certain as far as my version is concerned:
>
> PPM - Programmer's Package Manager version 3.3.
That's the difference. The docs I quoted were for version 4, shipped with
ActivePerl 5.8. Sorry for the confusion, I should have mentioned that.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: 17 Oct 2006 18:51:46 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: alarm() - SIGALRM sent too eariy?
Message-Id: <4pkn22Fj4f22U1@news.dfncis.de>
<xhoster@gmail.com> wrote in comp.lang.perl.misc:
> anno4000@radom.zrz.tu-berlin.de wrote:
> > <anno4000@radom.zrz.tu-berlin.de> wrote in comp.lang.perl.misc:
> > > Peter J. Holzer <hjp-usenet2@hjp.at> wrote in comp.lang.perl.misc:
> > > > On 2006-10-15 20:48, anno4000@radom.zrz.tu-berlin.de
> > > > <anno4000@radom.zrz.tu-berlin.de> wrote:
> >
> > > > I've seen the bug with Time::HiRes 1.59 and 1.86, so I'd be surprised
> > > > if it wasn't present in any version between them. It might be
> > > > platform-specific, though: I have tested it only on Linux/i386, and I
> > > > haven't looked at the source code yet.
> > >
> > > Okay, I'll check again when I have a few hours :)
> >
> > Right, the bug is still in bleadperl (5.9.4). It ought to be reported.
> > Anyone?
>
> I looked into the source code, and I doesn't look like a trivial fix.
> I ultimately turns the time into a int holding the number of microseconds,
> and that is where the problem occurs as the int can't hold the full
> precision. I guess you would need to propagate the system setitimer
> argument method (one long for seconds, one long for microseconds) farther
> up the call stack, instead of decomposing a single int into those
> immediately before the system call.
Non-trivial indeed. Every routine that expects a time in microseconds
as an integer would have to be replaced with one that expects two
integers, and it looks like that's most of the routines in T::H.
Then the originals must be reconstructed with a routine that splits
a perl number accordingly.
Who needs high resolution over long time intervals anyway? Document
the restriction and be done :)
Anno
------------------------------
Date: Tue, 17 Oct 2006 21:16:53 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: alarm() - SIGALRM sent too eariy?
Message-Id: <eh3h85$2lte$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
<anno4000@radom.zrz.tu-berlin.de>], who wrote in article <4pkn22Fj4f22U1@news.dfncis.de>:
> Non-trivial indeed. Every routine that expects a time in microseconds
> as an integer would have to be replaced with one that expects two
> integers, and it looks like that's most of the routines in T::H.
Please do not. There WAS some thought given to design of
high-resolution time routines; do not move it to the dumpster.
Use a Hires_Timer_t pointer instead of these integers, NOT hardwire
time-interval-as-two-integers.
> Then the originals must be reconstructed with a routine that splits
> a perl number accordingly.
*This part* is trivial to do via a typemap.
> Who needs high resolution over long time intervals anyway? Document
> the restriction and be done :)
I hope this smiley means that you won't do it this way... :-(
Hope this helps,
Ilya
------------------------------
Date: Tue, 17 Oct 2006 20:38:42 +0200
From: Yohan N Leder <ynl@nsparks.net>
Subject: END{} block capabilities ?
Message-Id: <MPG.1f9f419ed62f85439898e5@news.tiscali.fr>
Does a END{} block can :
- appear in a sub ?
- be conditional to the value of a scalar ?
- be composed by different parts at different locations in code ?
------------------------------
Date: 17 Oct 2006 18:56:12 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: END{} block capabilities ?
Message-Id: <4pknacFj4f22U2@news.dfncis.de>
Yohan N Leder <ynl@nsparks.net> wrote in comp.lang.perl.misc:
> Does a END{} block can :
>
> - appear in a sub ?
Probably yes, but it won't matter. The END block will run whether
the sub has been called or not.
> - be conditional to the value of a scalar ?
No, but its contents can.
> - be composed by different parts at different locations in code ?
See perldoc perlmod, which implicitly answers your first two questions
too.
Anno
------------------------------
Date: 17 Oct 2006 21:33:45 GMT
From: xhoster@gmail.com
Subject: Re: END{} block capabilities ?
Message-Id: <20061017173441.968$fs@newsreader.com>
Yohan N Leder <ynl@nsparks.net> wrote:
> Does a END{} block can :
>
> - appear in a sub ?
Yes, although doing so might not accomplish what you want it to, and it is
hard to see why you would want to do this. What do you want this to
accomplish?
> - be conditional to the value of a scalar ?
You can do somehting like this:
END {
if ($scalar eq "foo") {
#...
}
}
Is this what you mean?
> - be composed by different parts at different locations in code ?
No. You can have more than one END block, but they are separate blocks,
they do not get coallesced into one END super-block.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Tue, 17 Oct 2006 19:42:12 GMT
From: "Mumia W. (reading news)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: How to access a property within a class
Message-Id: <omaZg.14974$UG4.11420@newsread2.news.pas.earthlink.net>
On 10/17/2006 12:41 PM, Arved Sandstrom wrote:
> [...]
> 5. Be cognizant of scoping when it comes to how you set up your class data.
> It's fine that you are using a file lexical - this is ordinarily better than
> using a package global. But if you are going to inherit from this module,
> say a MyDerivedPM which "uses" myPM and has @ISA=("myPM"), be aware that
> $aProperty is visible only to methods defined in myPM. This is covered in
> perltoot, and if you do use class data *and* inheritance, read the manpage.
>
> AHS
>
>
How to deal with inheritable class data is discussed in perltooc.
--
paduille.4060.mumia.w@earthlink.net
------------------------------
Date: 17 Oct 2006 13:24:04 -0700
From: jeffpierce12@hotmail.com
Subject: How to print "0A" LF or "03" ETX characters to a filehandle
Message-Id: <1161116644.199649.83670@i42g2000cwa.googlegroups.com>
I am trying to read/write to the COM1 serial port on my Linux system.
I have the following code snippet created:
open (ABC, "+< /dev/ttyS0") or die "Can't open serial port: $!";
binmode ABC;
print (ABC "2");
......
After this line, I would like to send a hex "0A" which is an ASCII "LF"
or a hex "03" which is an ASCII "ETX". I have done much searching on
the net and through my reference books but I'm unable to figure out how
to do this. When I use the "\n" it sends a CR LF, and when I try the
"\f" it sends a FF (form feed). How do I send the ASCII "LF"
character?
Thanks.
------------------------------
Date: Tue, 17 Oct 2006 21:52:50 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to print "0A" LF or "03" ETX characters to a filehandle
Message-Id: <Xns985FB5F66C5A7asu1cornelledu@127.0.0.1>
jeffpierce12@hotmail.com wrote in news:1161116644.199649.83670
@i42g2000cwa.googlegroups.com:
> I am trying to read/write to the COM1 serial port on my Linux system.
> I have the following code snippet created:
>
> open (ABC, "+< /dev/ttyS0") or die "Can't open serial port: $!";
> binmode ABC;
> print (ABC "2");
> ......
>
> After this line, I would like to send a hex "0A" which is an ASCII "LF"
> or a hex "03" which is an ASCII "ETX". I have done much searching on
> the net and through my reference books but I'm unable to figure out how
> to do this. When I use the "\n" it sends a CR LF, and when I try the
> "\f" it sends a FF (form feed). How do I send the ASCII "LF"
> character?
print ABC 0x0A, 0x03;
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Tue, 17 Oct 2006 14:55:06 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: How to print "0A" LF or "03" ETX characters to a filehandle
Message-Id: <171020061455062517%jgibson@mail.arc.nasa.gov>
In article <1161116644.199649.83670@i42g2000cwa.googlegroups.com>,
<jeffpierce12@hotmail.com> wrote:
> I am trying to read/write to the COM1 serial port on my Linux system.
> I have the following code snippet created:
>
> open (ABC, "+< /dev/ttyS0") or die "Can't open serial port: $!";
> binmode ABC;
> print (ABC "2");
> ......
>
> After this line, I would like to send a hex "0A" which is an ASCII "LF"
> or a hex "03" which is an ASCII "ETX". I have done much searching on
> the net and through my reference books but I'm unable to figure out how
> to do this. When I use the "\n" it sends a CR LF, and when I try the
> "\f" it sends a FF (form feed). How do I send the ASCII "LF"
> character?
print ABC "\012";
or
print ABC "\x0a";
or
print ABC "\cJ";
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: 17 Oct 2006 12:03:44 -0700
From: "Brian Wilkins" <bwilkins@gmail.com>
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <1161111823.750001.50070@b28g2000cwb.googlegroups.com>
I suggest you take a look at the Perl module HTML:Parser here :
http://search.cpan.org/~gaas/HTML-Parser-3.35/Parser.pm
I have example code of what exactly you want to do at home, but I am at
work now. If I remember, I will post it here later.
samiam@mytrashmail.com wrote:
> In other areas of my life, like eating oatmeal and getting dressed, I
> have no real problems. Some might even say I am a savant.
>
> But I am just beginning Perl, and things I think are easy turn out not
> to me. Now, (said in Scarface voice) Let me introduce you to my lil'
> friend!
>
> My task is sooo deceptively simple: Just replace a simple string with
> another string. How hard could that be?
>
> My data file is here: http://home.comcast.net/~tankomail/preg.htm
> And a sample is at the very bottom of this post. I just want to replace
> /<form[.*]?*\/form>/ with the word "block"
>
> Basically I just want to replace all <form> </form> fields and
> everything in between with nothing, but in testing, I wanted to see my
> work so I chose the word "block" as a good simple substitute which I
> could then replace with nothing.
>
> Way Below is my base code. But here, just under is the pulled line from
> the base code that seems to be the issue:
> $orgtext = Whey; # this one right here
> $newtext = Popcorn;
>
> The above works. I reduced it to it's simplest form as a sanity check.
> Then I tried:
>
> $orgtext = /[Ww]hey/; # this one right here
> $newtext = Popcorn;
>
> But beyond the most primitive replacement, I invariably get:
>
> Use of uninitialized value in pattern match (m//) at
> C:\russ\scripts\_Master_Snippets\clean_2_input_output_file.pl line 9.
>
> Eventually I want to try:
>
> $orgtext = /<form[.*]?*\/form>/; # this one right here
> $newtext = block;
>
> But I can't get past the staring blocks. I know this code works in
> general, but my modifications seem to break it.
>
> I also tried some while (<$intext>) variations, even removing the undef
> $/ slurp line, so that the intext would receive the data line by line -
> but no luck anywhere. I have spent quite a bit of research time trying
> various things - but apparently it's not a trivial task.
>
> Any suggestions as to:
>
> 1.) Is my basic model okay, slurping the whole file into a variable? or
> 2.) Should I use a while <> structure?
>
> And even when I do get the simple Whey replaced with Popcorn - it only
> does the first instance, basically, I am guessing, because there is no
> iterative code in this script. And the only iterative examples I've
> seen are not with a whole file in one "intext" variable, but always
> with a while <> structure.
>
> Your input and examples are GREATLY appreciated because the red spot on
> my banging against the cubicle wall head is growing.
>
> L,
> Sam
>
> ---------------------------
>
> Here is my base code.
>
> $infile = 'C:\russ\weights\preg.htm';
> $outfile = 'C:\russ\weights\preg_clean.htm';
>
> # No, I am not pregnant, but I am helping a pregnant woman out!
> No...not just helping her get
> # her start either :)
>
> $orgtext = Whey;
> $newtext = Popcorn;
>
> undef $/; #slurp mode, read files in a whole
>
> open IN, $infile or die $!;
> $intext = <IN>;
> close IN;
>
> $intext =~ s/$orgtext/$newtext/ms;
> # the ms is for coping correctly with newlines (that can easily appear
> in a binary).
>
> open OUT, ">$outfile" or die $!;
> print OUT $intext;
> close OUT;
>
> # replaces ALL occurrences of orgtext with newtext and places the
> number of occurences in $count
>
>
>
>
> --------data sample. link to complete data above
>
>
>
> <table width="100%" border="0" align="center" cellpadding="0"
> cellspacing="0">
> <tr>
> <td width="24%" rowspan="2" valign="top"><table width="198"
> border="0" align="center" cellpadding="1" cellspacing="0">
> <tr>
> <td><div align="center"><img src="images/ls_logo.gif"
> width="192" height="91"></div></td>
> </tr>
> <tr>
> <td valign="top"><table width="200" border="0" align="center"
> cellpadding="2" cellspacing="3">
> <tr>
> <td width="197" valign="top"><table width="100%"
> border="0" align="center" cellpadding="0" cellspacing="0">
> <tr>
> <td><div align="center"><a
> href="all-products.html"><img src="2005-menu/all-prods.gif" name="all"
> width="177" height="33" border="0"></a></div></td>
> </tr>
> <tr>
> <td><div align="center"><a
> href="vitamins-supplements.html"><img src="2005-menu/vits-supl.gif"
> name="vitamins" width="177" height="33" border="0"></a></div></td>
> </tr>
> <tr>
> <td><div align="center"><a
> href="liquid-supplements.html"><img src="2005-menu/liquid-vit.gif"
> name="liquid" width="177" height="33" border="0"></a></div></td>
> </tr>
> <tr>
> <td><div align="center"><a
> href="body-building.html"><img src="2005-menu/body-build.gif"
> name="bodybuild" width="177" height="33" border="0"></a></div></td>
> </tr>
> <tr>
> <td><div align="center"><a
> href="weightloss.html"><img src="2005-menu/diet.gif" name="diet"
> width="177" height="33" border="0"></a></div></td>
> </tr>
> <tr>
> <td><div align="center"><a
> href="body-essentials.html"><img src="2005-menu/body-ess.gif"
> name="bodyess" width="177" height="33" border="0"></a></div></td>
> </tr>
> <tr>
> <td><div align="center"><a
> href="articles.html"><img src="2005-menu/articles.gif" alt="Articles of
> Interest" name="articles" width="177" height="33"
> border="0"></a></div></td>
> </tr>
> </table></td>
> </tr>
> <tr>
> <td><div align="center">
>
> </div></td>
> </tr>
> <tr>
> <td><div align="center"> <form method=POST
> style="margin-bottom: 0"
> action="https://www.linkpointcart.net/cgi-bin/cart.cgi">
> <input type=hidden name="ViewCart"
> value="ThreadsCart">
> <input type=submit value="View Cart">
> </form></div></td>
> </tr>
> <tr>
> <td><div align="center"><form method=POST
> style="margin-bottom: 0"
> action="https://www.linkpointcart.net/cgi-bin/cart.cgi">
> <input type=hidden name="CheckOut" value="Online">
> <input type=hidden name="CartID" value="ThreadsCart">
> <input type=submit value="Check Out">
> </form></div></td>
> </tr>
> <tr>
> <td><table width="100%" border="0" cellspacing="0"
> cellpadding="0">
> <tr>
> <td><br><div align="center"><a
> href="catalog.html"><img src="2005-menu/catalog-banner.gif" width="196"
> height="50" border="0"></a></div></td>
> </tr>
> </table>
> <div align="center"><font size="2" face="Arial,
> Helvetica, sans-serif"><strong><br>
> We want to hear from you.<br>
> Suggest a NEW PRODUCT!!<br>
> <a href="suggest.htm">:: click
> here::</a></strong></font></div></td>
> </tr>
> </table></td>
> </tr>
> </table></td>
> <td width="76%" height="28" valign="top"><div align="right"><img
> src="2005-menu/top-image.gif" width="604" height="98" border="0"
> usemap="#Map"></div></td>
> </tr>
> <tr>
> <td valign="top"><br> <!-- InstanceBeginEditable name="content" -->
> <table width="90%" border="0" align="center" cellpadding="1"
> cellspacing="1">
> <tr>
> <td><table width="560" border="0" align="center"
> cellpadding="3" cellspacing="0">
> <tr>
> <td rowspan="2" valign="top"><div align="center"><img
> src="bottles/whey-chocolate-s.gif" width="102" height="150"
> border="0"><br>
> <font color="#666666" size="1" face="Arial,
> Helvetica, sans-serif"></font></div></td>
> <td><div align="left"><font size="2" face="Arial,
> Helvetica, sans-serif"><strong><font size="3">Whey
> Protein<br>
> Chocolate 3.3 lbs.</font><br>
> 54 grams of protein per serving<br>
> <br>
> </strong></font><font face="Verdana, Arial,
> Helvetica, sans-serif"><strong><font size="3" face="Arial, Helvetica,
> sans-serif">$
> 39.99</font></strong></font></div></td>
> <td rowspan="2" valign="top"><div align="center"><img
> src="bottles/whey-vanilla-s.gif" width="102" height="150"
> border="0"><br>
> </div></td>
> <td><div align="left"><font size="2" face="Arial,
> Helvetica, sans-serif"><strong><font size="3">Whey
> Protein<br>
> Vanilla </font><font size="2" face="Arial,
> Helvetica, sans-serif"><strong><font size="3">3.3
> lbs.</font></strong></font><br>
> 54 grams of protein per serving.<br>
> <br>
> </strong></font><font face="Verdana, Arial,
> Helvetica, sans-serif"><strong><font size="3" face="Arial, Helvetica,
> sans-serif">$
> 39.99</font></strong></font><font size="2"
> face="Arial, Helvetica, sans-serif"><strong>
> </strong></font></div></td>
> </tr>
> <tr>
> <td><form method="post"
> action="https://www.linkpointcart.net/cgi-bin/cart.cgi">
> <table border="0" cellpadding="0" cellspacing="0">
> <tr>
> <td><font size="2" face="Arial, Helvetica,
> sans-serif">Quantity:</font></td>
> <td><font face="Verdana, Arial, Helvetica,
> sans-serif">
> <input type="text" name="VARQuantity"
> value="1" size="4" />
> </font></td>
> </tr>
> <tr>
> <td colspan="2" align="center"> <font
> face="Verdana, Arial, Helvetica, sans-serif">
> <input type="hidden" name="VAR000" value="|"
> />
> <input type="hidden" name="AddItem"
> value="ThreadsCart|Lifesource Labs - Whey Protein Powder Chocolate
> VAR000 $39.99|VARQuantity|||price5|||||||" />
> <input name="submit" type="submit" value="Add
> To Cart" />
> </font></td>
> </tr>
> </table>
> </form></td>
> <td><form method="post"
> action="https://www.linkpointcart.net/cgi-bin/cart.cgi">
> <table border="0" cellpadding="0" cellspacing="0">
> <tr>
> <td><font size="2" face="Arial, Helvetica,
> sans-serif">Quantity:</font></td>
> <td><font face="Verdana, Arial, Helvetica,
> sans-serif">
> <input type="text" name="VARQuantity2"
> value="1" size="4" />
> </font></td>
> </tr>
> <tr>
> <td colspan="2" align="center"> <font
> face="Verdana, Arial, Helvetica, sans-serif">
> <input type="hidden" name="VAR000" value="|"
> />
> <input type="hidden" name="AddItem"
> value="ThreadsCart|Lifesource Labs - Whey Protein Powder Vanilla VAR000
> $39.99|VARQuantity|||price5|||||||" />
> <input name="submit" type="submit" value="Add
> To Cart" />
> </font></td>
> </tr>
> </table>
> </form></td>
------------------------------
Date: Tue, 17 Oct 2006 13:26:18 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <171020061326187225%jgibson@mail.arc.nasa.gov>
In article <1161105326.573605.300410@i42g2000cwa.googlegroups.com>,
<samiam@mytrashmail.com> wrote:
> I don't know what TOFU means. I did a quick lookup and it said
> something about quoting over the top of something.
It means adding your responses to a previous post above the text to
which you are responding. It is the norm in most Usenet groups to put
your responses _below_ the text to which you are responding. This is
done for the convenience of your readers so we can tell to what you are
responding without having to divine your intentions.
>
> All I did was hit reply in google, express gratitude and add a smiley.
Just use your down-arrow key until the cursor is below the text to
which you are responding. Be sure and delete any text that is not
relevant to your reply. Leave in attribution lines ('so-and-so wrote:')
so people can tell who said what. And don't quote signatures.
These rules may seem complicated, but complying with them will increase
your chances for getting useful help here. Please read the guidelines
for this group and try to follow them. It really is in your own best
interest. I am afraid that already some of the most helpful people in
this group are now ignoring your posts.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: 17 Oct 2006 14:09:33 -0700
From: "Brian Wilkins" <bwilkins@gmail.com>
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <1161119373.779330.181620@m7g2000cwm.googlegroups.com>
Brian Wilkins wrote:
> I suggest you take a look at the Perl module HTML:Parser here :
> http://search.cpan.org/~gaas/HTML-Parser-3.35/Parser.pm
>
> I have example code of what exactly you want to do at home, but I am at
> work now. If I remember, I will post it here later.
>
Here is some code for you to examine. It strips the <span> tags and
leaves everything between <span> and </span>
# This function connects to Extern via the dispatch script
# and returns the CDRs for a specified period (based on BillingCycle)
sub connect_via_dispatch {
my $curl = Curl::easy::init();
if(!$curl) {
die "curl init failed!\n";
}
my ($temp_dc) = @_;
my ($DC) = "DC0".$temp_dc; # Add the string DC0 to the front since
the database stores
# DC numbers differently
$DC_NUM = $DC;
my $url = "https://www.mundotel.cc/cgi-bin/dispatch.cgi";
my $rawHTML = ""; # Stores the HTML returned from
dispatch.cgi?Service=CDR
$::errbuf = "";
Curl::easy::setopt($curl, CURLOPT_ERRORBUFFER, "::errbuf");
Curl::easy::setopt($curl, CURLOPT_URL, $url);
Curl::easy::setopt($curl, CURLOPT_NOPROGRESS, 1);
Curl::easy::setopt($curl, CURLOPT_TIMEOUT, 30);
Curl::easy::setopt($curl, CURLOPT_HEADERFUNCTION, \&header_callb);
Curl::easy::setopt($curl, CURLOPT_WRITEFUNCTION, \&body_callb);
Curl::easy::setopt($curl, CURLOPT_POST, 1);
Curl::easy::setopt($curl,
CURLOPT_POSTFIELDS,"Service=CDR&PIN=$DC&StartDate=$prev_m-$prev_d-$prev_y&EndDate=$endmonth-$endday-$endyear&PageItems=99999999&Offset=-6");
# Curl::easy::setopt($curl,
CURLOPT_POSTFIELDS,"Service=CDR&PIN=$DC&StartDate=$prev_m-$prev_d-$prev_y&EndDate=$month-$day-$year&PageItems=99999999");
# USE THE LINE BELOW IF YOU WANT TO MANUALLY RUN INVOICES FOR A DATE
RANGE
# MONTH MUST BE TWO DIGITS IN LENGTH
# Curl::easy::setopt($curl,
CURLOPT_POSTFIELDS,"Service=CDR&PIN=$DC&StartDate=08-1-2004&EndDate=08-31-2004&PageItems=99999999");
Curl::easy::setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
Curl::easy::setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
Curl::easy::setopt($curl, CURLOPT_SSL_VERIFYHOST, 1);
Curl::easy::setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0");
Curl::easy::perform($curl);
Curl::easy::cleanup($curl);
}
# Used with cURL; stores the raw HTML retrieved from Extern
sub body_callb {
my($chunk,$handle)=@_;
${handle} .= $chunk;
$rawHTML .= $chunk;
return length($chunk);
}
# Used with cURL; gets header for debugging purposes.
sub header_callb {
return length($_[0]);
}
# When we reach a </tr> tag, that means
# that we have reach the EOL and append
# a new line char to the end of $result
sub parse_html {
my $tp = HTML::TokeParser->new(\$rawHTML) or die "Can't open $!";
while (my $tag = $tp->get_tag) {
if($tag->[0] eq 'span') {
$result .= $tp->get_text("/span").",";
}
else {
if ($tag->[0] eq '/tr') {
$result .= "\n";
}
}
}
}
------------------------------
Date: Tue, 17 Oct 2006 19:42:13 GMT
From: "Mumia W. (reading news)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: modify posting guidelines to allow MIME charset=utf8
Message-Id: <pmaZg.14975$UG4.601@newsread2.news.pas.earthlink.net>
On 10/17/2006 11:49 AM, Ted Zlatanov wrote:
> On 17 Oct 2006, scobloke2@infotop.co.uk wrote:
>
> Ted Zlatanov wrote:
>>> So is there a consensus
>> How could you tell?
>
> By the lack of dissent. Seriously, how else can you get 37K+
> passive-aggressive people to agree? :)
>
>>> that MIME with charset=utf8 and a suitable
>>> 8-bit-safe content-transfer-encoding should be acceptable in
>>> comp.lang.perl.misc?
>> It gets my vote. Now you just have to find out what the other 37,292
>> readers of this newsgroup think :-)
>
> I think it's 2006, not 1996; let's just start a new thread to put it
> in the posting guidelines and if people complain, we'll argue
> viciously about it and then there will be a shootout in front of the
> saloon.
>
> Ted
Allowing UTF8 with the proper content-transfer encoding gets my vote too.
In fact, MIME on usenet makes sense--despite the fact that the word
"Mail" is in MIME :-)
--
paduille.4060.mumia.w@earthlink.net
------------------------------
Date: 17 Oct 2006 14:00:34 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: modify posting guidelines to allow MIME charset=utf8
Message-Id: <86r6x6d5e5.fsf@blue.stonehenge.com>
>>>>> "Mumia" == Mumia W (reading news) <paduille.4060.mumia.w@earthlink.net> writes:
Mumia> Allowing UTF8 with the proper content-transfer encoding gets my vote too.
An individual group cannot vote on this. This is a news.admin-level problem,
and the news-admins must be involved.
Otherwise, it's like a group of inmates "voting" to be allowed to run
outside the walls for 30 minutes a day. It's pointless.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: 17 Oct 2006 13:29:40 -0700
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: Need a Perl Scripting
Message-Id: <1161116980.634127.58860@b28g2000cwb.googlegroups.com>
senatorcool2002@gmail.com wrote:
>
> I need a Perl Scripting just which check for any
> URL's and give me a positive or negative response
> if the URL is available or not repectively.
Dear Arun,
If you read the SYNOPSIS section of "perldoc LWP::Simple" you'll
find a three-line script that begins with the line "use LWP::Simple;".
This simple script will do mostly what you want, except for two things:
1. The script only reports if a link is invalid. But you want to
report valid links as well. For this you need to use a condition (most
likely with an "if" block).
2. The script only checks to see if "http://www.sn.no/" is a valid
link. Since you want to check a list of URLs, you'll want to wrap some
of the code in a "while" or "foreach" loop.
Adding these two extra features won't take too long -- provided you
know how to construct "if" blocks and "while"/"foreach" loops. If you
don't know how, I recommend reading through the O'Reilly book "Learning
Perl" (by Randal Schwartz and Tom Phoenix) and doing all the
excercises. (Don't worry; the book is a fairly fast read and its
excercises are easy.)
It's always possible for someone else to do the work for you, but
then any small change you need to make will take hours and hours
(instead of seconds) if you aren't familiar with the basics of Perl
programming that are covered in "Learning Perl."
So do yourself a favor and learn some good Perl basics by reading
that book. You'll be glad you did.
I hope this helps, Arun.
-- Jean-Luc
------------------------------
Date: Tue, 17 Oct 2006 23:11:53 +0200
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Need a Perl Scripting
Message-Id: <45354716$0$27389$ba4acef3@news.orange.fr>
David K. Wall wrote:
> Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr> wrote:
>
>> senatorcool2002@gmail.com wrote:
>>> Hi Paul,
>>>
>>> First of all i would like to thank u for the reply.
>>> I have been trying for the code for the past two days,but the
>>> deadline for my project is already gone,atleast not later than
>>> 2 days i have to submit it.
>>> Thats y i m in need of the script,i m also new to perl
>>> environment. They gave me basic training in Perl and put me
>>> into a project. This is my situtaion,hope u can understand
>>> mine.
>> Check out Net::DNS. You can find it at search.cpan.org . If you
>> can't work out something using this module from its
>> documentation, then your "basic training" was far too basic and
>> you should report this to your employer.
>
> Net::DNS? Isn't that pretty far upstream? For something quick and
> dirty I'd just use LWP::Simple. Or do you have some other purpose
> for suggesting Net::DNS?
>
I totally misread the question and thought the OP wanted to check for
validity of DNS addresses. I'd agree with your LWP::Simple suggestion.
Apologies to all: my bad.
Mark
------------------------------
Date: Tue, 17 Oct 2006 14:22:38 -0500
From: Jialin Li <jialinli1981@gmail.com>
Subject: question about cpan module
Message-Id: <eh3aiv$576$1@joe.rice.edu>
I am using interactive shell of cpan modules with
perl -MCPAN -e shell
inside the shell, how can have the function like 'less'
when browsing with a,b,d,m?
Thanks,
Jialin
------------------------------
Date: 17 Oct 2006 11:13:00 -0700
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: strange behavior of -s $filename
Message-Id: <1161108780.841081.326220@k70g2000cwa.googlegroups.com>
markpark wrote:
>i probably spent 3 or 4 hours
> looking fore the bug wheras if i would
> have known to do perldoc -f
> readdir, i would have saved tons of time.
Don't be too hard on yourself. Like I said before, this is a common
mistake people make, and at least you had the foresight to include the
"use warnings;" line, which all too many "Perl programmers" don't do.
(Too many times I've seen programmers make intricate work-arounds to
simple bugs like yours, and don't even even include a one-line comment
explaining why a dozen lines of complicated code were used to implement
such a simple concept.)
> like in this one, you would have to know that the "error"
> is coming from readdir
> in order to do a perldoc -f readdir.
I sympathize with you. It's not always easy to find the
documentation you need, even if it is documented in a logical place.
In this case, experience (and posting to this newsgroup like you just
did) helps a lot.
But in such cases I strongly recommend reading O'Reilly's book
entitled "Learning Perl" by Randal L. Schwartz and Tom Phoenix (known
affectionately as the "Llama Book"). It's the book I learned Perl on,
and since I believe it's really well written, I currently believe that
all Perl programmers should be responsible for knowing at least 90% of
the contents of that book.
I mean, it's good to learn Perl however you can, but "Learning Perl"
is a very straighforward book that's full of helpful programming
concepts that every Perl programmer should know. For instance, it
addresses your very issue with readdir() in Chapter 12 (Directory
Operations):
Now we'll look at the part that gets most people mixed
up, so play close attention. The filenames returned by
the 'readdir' operator have *no* pathname component. It's
just the *name* within the directory. ... (And because
this is another difference from the globbing operation,
it's easy to see how people get confused.)
There you have it. Even the "Llama Book" admits that your error is
faily common, and because of that it tries to educate the beginning
Perl programmer about it.
So if you're a little frustrated or puzzled about these simple
little errors that are not trivial to find in the perldocs, try reading
through "Learning Perl" and doing its (very simple) excercises at the
end of each chapter (the excercises will teach you some very elegant
ways of doing things that you probably wouldn't come up with by
yourself). It's a quick read, so you should be able to read it and
comprehend it in a relatively short time period, espcecially since you
already have a little Perl experience under your belt.
I'm not saying that "Learning Perl" should be the only book you need
to read about Perl. There are other books that are good (especially
the onces that teach advanced Perl concepts). But if you should ever
use one book to learn Perl with, I strongly recommend the book
"Learning Perl."
(Even if you don't read it, I still believe that Perl programmers
should be responsible for knowing at least 90% of what it teaches --
whether they learn those concepts from that book or not. Otherwise,
there are too many useful Perl concepts a programmer won't know which
will prohibit him/her from using straightforward Perl code and being a
decent Perl programmer.)
Happy Perling!
-- Jean-Luc
------------------------------
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 9860
***************************************