[29820] in Perl-Users-Digest
Perl-Users Digest, Issue: 1063 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 26 06:09:45 2007
Date: Mon, 26 Nov 2007 03:09:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 26 Nov 2007 Volume: 11 Number: 1063
Today's topics:
Article Directory script <ajauctionpro@gmail.com>
Re: Display the answer in HTML code because CGI-SCript <news@lawshouse.org>
Re: Get my IP address? <ben@morrow.me.uk>
How to append a file accordingly? <ytlim1@gmail.com>
Re: How to append a file accordingly? <stoupa@practisoft.cz>
Re: How to append a file accordingly? <ytlim1@gmail.com>
Re: How to append a file accordingly? <s.denaxas@gmail.com>
Re: How to append a file accordingly? <peter@makholm.net>
Re: How to set a global on the command line? <glennj@ncf.ca>
new CPAN modules on Mon Nov 26 2007 (Randal Schwartz)
Re: opendir mydir/??/??/?? <krahnj@telus.net>
page 124 of the camel book <wade@zaxfuuq.net>
Re: page 124 of the camel book <krahnj@telus.net>
Re: page 124 of the camel book <wade@zaxfuuq.net>
perl ftp and hidden partitions schmmichael@gmail.com
Re: regex instead of a new lover. . . <aardvarkman@gmail.com>
Re: searching for a pattern for multiple matches <zen13097@zen.co.uk>
Spidering Hacks <alexxx.magni@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 26 Nov 2007 03:05:29 -0800 (PST)
From: "ajauctionpro@gmail.com" <ajauctionpro@gmail.com>
Subject: Article Directory script
Message-Id: <c8904d1a-30a4-4ec3-8ef4-2093e0585ba1@i29g2000prf.googlegroups.com>
AJ Article is developed using PHP, MySql. The core concept of the
script is to share the knowledge between the users in a group.
Professionals on various domains can post their articles. All the site
users can read the posting made by the professionals can rate the
articles and can select the best article.
http://www.ajsquare.com/products/article/index.php
------------------------------
Date: Sun, 25 Nov 2007 21:20:29 +0000
From: Henry Law <news@lawshouse.org>
Subject: Re: Display the answer in HTML code because CGI-SCript could not hide
Message-Id: <1196025624.9180.0@proxy02.news.clara.net>
kwan wrote:
> It is possible to send the questions and answers to the browser, and
> the users have to choose the answer in each question, then the answers
> have to compare to the correct answer in the database.
>
> I still consider not secure, because the users could copy the
> questions and answers in the html code form that easy accessable via
> the view source code; furthermore,by storing the questions and answers
> which users could access, it is possible for bad guys who can write a
> program to copy all the questions and answer while taking the exam.
This is getting silly, and is nothing to do with perl. Let's try once
more: maybe different words will help since I realise that English is
not your first language.
(1) If you send information about the correct answer down with the
question then anyone who knows how can find it in the HTML. I know you
know that.
(2) Therefore the correct answer has to stay at the server until the
student has made her choice.
(3) Once the student has made her choice you have to tell her whether or
not it's right (you tell us): and if you allow the student to have more
than one go at the question then she can copy all the questions and the
correct answers. There is nothing you can do about that: it's a
fundamental part of the algorithm: tell the student anything,
information leaks out. And nothing to do with the choice of language,
Perl or otherwise.
(4) You could make it a bit harder for an individual student by only
letting her have one go at the question, and when she's wrong not
telling her which answer was right; by logging all quiz interactions;
and by not offering an option to take the quiz a second time. But
information still leaks each time the student interacts with the system.
--
Henry Law Manchester, England
------------------------------
Date: Mon, 26 Nov 2007 01:36:53 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Get my IP address?
Message-Id: <likp15-3r3.ln1@osiris.mauzo.dyndns.org>
Quoth "John W. Krahn" <krahnj@telus.net>:
> Ben Morrow wrote:
> >
> > # h2ph gets SIOCGIFADDR wrong on my system.
> > # Modern systems have complicated ioctl definitions that encode the
> > # sizes of the types used, and h2ph can't cope.
> > # h2ph is evil anyway. Use h2xs instead. ;)
>
> I just looked the numbers up in the header file.
>
> > my $SIOCGIFADDR = 3223349537;
>
> That seems like a rather large number, on my Linux system its 0x8915.
> (Although I would probably use SIOCGIFDSTADDR instead.)
It's defined as (more-or-less)
(IOC_IN | IOC_OUT | (sizeof(struct ifreq) << 16) | ('i' << 8) | 33)
where 'i' means 'Internet ioctls' and 33 is the real ioctl number, for
the benefit of the unpacking code in the kernel. IIRC Linux defines most
of its ioctls like this; for some reason the networking ones must be
different <shrug>.
struct ifreq contains a union, so it's hardly surprising h2ph gets the
value wrong.
> > # struct ifreq is 16 bytes of name, null-padded, followed by 16
> > # bytes of answer. In the case of SIOCGIFADDR, that answer is a
> > # packed address.
> >
> > my $ifreq = pack 'a32', 'xl0';
>
> I found that this:
>
> my $ifreq = 'eth0';
>
> works fine for me (I don't have an 'x10' interface.) Perl will expand
> the string to the required size.
It will when it can. It always can on BSDish systems (due to the
encoding above); 5.8.8 and later sometimes can on Linux (but not in this
case, as the Linux networking ioctls don't encode the size). Otherwise
perl just assumes 256 bytes is enough, which may or may not be true.
It's always safer to preallocate enough memory yourself.
> Thanks a lot Ben. Now if I could figure out SIOCGIFCONF to get the list
> of interfaces! :-)
Calling SIOCGIFCONF is very hard, because the ifconf structure contains
a list of ifreqs, which are not all the same length. Not only are IPv6
address longer than 32 bytes, SIOCGIFCONF returns link-level addresses
which are a different length again. You would need to go poking around
in the struct sockaddr to find out how long it actually is. See
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/net/getifaddrs.c?rev=1.6
for an example of how to call it correctly, and note that that depends
on struct sockaddr having a sa_len member, which I don't think is the
case under Linux.
Ben
------------------------------
Date: Sun, 25 Nov 2007 18:30:52 -0800 (PST)
From: Why Tea <ytlim1@gmail.com>
Subject: How to append a file accordingly?
Message-Id: <25ff2698-f111-4563-bc43-145770017c40@e25g2000prg.googlegroups.com>
How to append to a text file based on the following conditions:
1) if the last characters of the file are "\n" or "\r\n", simply
print FH "$some_text";
2) if the last characters are none of "\n" or "\r" or "\r\n", do
print FH "\n$some_text";
/Why Tea
------------------------------
Date: Mon, 26 Nov 2007 03:46:32 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: How to append a file accordingly?
Message-Id: <fidcrg$16f3$1@ns.felk.cvut.cz>
Why Tea wrote:
> How to append to a text file based on the following conditions:
> 1) if the last characters of the file are "\n" or "\r\n", simply
> print FH "$some_text";
> 2) if the last characters are none of "\n" or "\r" or "\r\n", do
> print FH "\n$some_text";
>
> /Why Tea
Maybe this way?
if($some_text =~ m/(\r\n|\n|\r)$/s)
{
print FH "$some_text";
}
else
{
print FH "\n$some_text";
}
--
Petr
Skype: callto://fidokomik
Na mail uvedeny v headeru zpravy nema cenu nic posilat, konci to v PR*
:-)
Odpovidejte na petr na practisoft cz
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: Sun, 25 Nov 2007 21:26:39 -0800 (PST)
From: Why Tea <ytlim1@gmail.com>
Subject: Re: How to append a file accordingly?
Message-Id: <c7917b91-ce58-45ba-8f5e-8e7c95bb8aaf@e6g2000prf.googlegroups.com>
On Nov 26, 1:46 pm, "Petr Vileta" <sto...@practisoft.cz> wrote:
> Why Tea wrote:
> > How to append to a text file based on the following conditions:
> > 1) if the last characters of the file are "\n" or "\r\n", simply
> > print FH "$some_text";
> > 2) if the last characters are none of "\n" or "\r" or "\r\n", do
> > print FH "\n$some_text";
>
> > /Why Tea
>
> Maybe this way?
>
> if($some_text =~ m/(\r\n|\n|\r)$/s)
> {
> print FH "$some_text";
> }
> else
> {
> print FH "\n$some_text";
> }
>
Petr, your code checks for white spaces at the end of $some_text, but
I was talking about white spaces at the end of the opened file, i.e.
open(FH, $some_file)
------------------------------
Date: Mon, 26 Nov 2007 02:01:25 -0800 (PST)
From: Spiros Denaxas <s.denaxas@gmail.com>
Subject: Re: How to append a file accordingly?
Message-Id: <054e6c0a-3d4e-48ef-96ed-7e0d75464194@g21g2000hsh.googlegroups.com>
On Nov 26, 5:26 am, Why Tea <ytl...@gmail.com> wrote:
> On Nov 26, 1:46 pm, "Petr Vileta" <sto...@practisoft.cz> wrote:
>
>
>
> > Why Tea wrote:
> > > How to append to a text file based on the following conditions:
> > > 1) if the last characters of the file are "\n" or "\r\n", simply
> > > print FH "$some_text";
> > > 2) if the last characters are none of "\n" or "\r" or "\r\n", do
> > > print FH "\n$some_text";
>
> > > /Why Tea
>
> > Maybe this way?
>
> > if($some_text =~ m/(\r\n|\n|\r)$/s)
> > {
> > print FH "$some_text";
> > }
> > else
> > {
> > print FH "\n$some_text";
> > }
>
> Petr, your code checks for white spaces at the end of $some_text, but
> I was talking about white spaces at the end of the opened file, i.e.
> open(FH, $some_file)
Why Tea,
I believe Petr's solution involves slurping the file and then
checking.
You could use:
File::Slurp http://search.cpan.org/perldoc?Perl6::Slurp
Perl6::Slurp http://search.cpan.org/perldoc?File::Slurp
How big is the file? I believe this is a crucial factor since
for very long and/or large files, the majority of common methods
might not be applicable.
Spiros
------------------------------
Date: Mon, 26 Nov 2007 10:20:36 +0000
From: Peter Makholm <peter@makholm.net>
Subject: Re: How to append a file accordingly?
Message-Id: <87abp1jojv.fsf@hacking.dk>
Why Tea <ytlim1@gmail.com> writes:
> How to append to a text file based on the following conditions:
> 1) if the last characters of the file are "\n" or "\r\n", simply
> print FH "$some_text";
> 2) if the last characters are none of "\n" or "\r" or "\r\n", do
> print FH "\n$some_text";
Untested and without error handling:
use Fcntl qw(:seek);
my $last;
open my $fh, '+<', $filename;
seek $fh, -1, SEEK_END;
read $fh, $last, 1;
seek $fh, 0, SEEK_END; # Probably not needed.
print {$fh} "\n" unless $last eq "\n";
print {$fh} $some_text;
------------------------------
Date: 26 Nov 2007 05:52:13 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: How to set a global on the command line?
Message-Id: <slrnfkknoe.qp6.glennj@smeagol.ncf.ca>
At 2007-11-25 09:51AM, "kj" wrote:
> % mp3cat --output=all.mp3 /some/dir/*.mp3
>
> mp3cat works great most of the time, but lately it has been giving
> me problems. I've traced these problems to the value of a certain
> global variable, $MPEG::Audio::Frame::free_bitrate. This variable
> is undef by default, and mp3cat leaves it unchanged. I discovered
[...]
> but I wondered, is there was a less "invasive" way to specify the
> value of a global variable, e.g. on the command line?
untested: create a wrapper script
#!/usr/bin/perl --
$MPEG::Audio::Frame::free_bitrate = 'whatever';
do '/path/to/mp3cat';
__END__
Invoke as: mp3catwrapper.pl --output=...
--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry
------------------------------
Date: Mon, 26 Nov 2007 05:42:15 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Nov 26 2007
Message-Id: <Js3MIF.E4L@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.
Angerwhale-0.062
http://search.cpan.org/~jrockway/Angerwhale-0.062/
filesystem-based blog with integrated cryptography
----
AnyEvent-2.8
http://search.cpan.org/~mlehmann/AnyEvent-2.8/
provide framework for multiple event loops
----
BrLock-0.1
http://search.cpan.org/~ribamar/BrLock-0.1/
Distributed Lock with minimal messages exchanges over a reliable network.
----
Business-Address-POBox-0.05
http://search.cpan.org/~marcel/Business-Address-POBox-0.05/
Check whether an address looks like a P.O.Box
----
Catalyst-Model-JDBI-Schemas-0.01
http://search.cpan.org/~ishigaki/Catalyst-Model-JDBI-Schemas-0.01/
Jifty::DBI Model Class with some magic on top
----
Constant-Runtime-0.0099_01
http://search.cpan.org/~berle/Constant-Runtime-0.0099_01/
Generates constants at runtime
----
Coro-4.21
http://search.cpan.org/~mlehmann/Coro-4.21/
coroutine process abstraction
----
Data-Validate-URI-0.04
http://search.cpan.org/~sonnen/Data-Validate-URI-0.04/
common url validation methods
----
EV-1.3
http://search.cpan.org/~mlehmann/EV-1.3/
perl interface to libev, a high performance full-featured event loop
----
ExtUtils-MakeMaker-6.37_01
http://search.cpan.org/~mschwern/ExtUtils-MakeMaker-6.37_01/
Create a module Makefile
----
File-Stata-DtaReader-0.31
http://search.cpan.org/~reckon/File-Stata-DtaReader-0.31/
CPAN release history
----
Glib-EV-1.0
http://search.cpan.org/~mlehmann/Glib-EV-1.0/
Coerce Glib into using the EV module as event loop.
----
Gtk2-CV-1.5
http://search.cpan.org/~mlehmann/Gtk2-CV-1.5/
----
HTML-Menu-TreeView-0.8.2
http://search.cpan.org/~lze/HTML-Menu-TreeView-0.8.2/
----
HTML-Template-Compiled-Filter-Whitespace-0.01
http://search.cpan.org/~steffenw/HTML-Template-Compiled-Filter-Whitespace-0.01/
whitespace filter for HTML output
----
HTML-Template-Compiled-Plugin-VBEscape-0.01
http://search.cpan.org/~steffenw/HTML-Template-Compiled-Plugin-VBEscape-0.01/
VB-Script-Escaping for HTC
----
LaTeX-Pod-0.14
http://search.cpan.org/~schubiger/LaTeX-Pod-0.14/
Transform LaTeX source files to POD (Plain old documentation)
----
Lingua-ZH-CCDICT-0.03
http://search.cpan.org/~drolsky/Lingua-ZH-CCDICT-0.03/
An interface to the CCDICT Chinese dictionary
----
Mail-Toaster-5.09
http://search.cpan.org/~msimerson/Mail-Toaster-5.09/
turns a computer into a secure, full-featured, high-performance mail server.
----
Mindcal-0.01
http://search.cpan.org/~mschilli/Mindcal-0.01/
Calculate day-of-week of any given date in your head
----
MooseX-ClassAttribute-0.02
http://search.cpan.org/~drolsky/MooseX-ClassAttribute-0.02/
Declare class attributes Moose-style
----
Net-Address-Ethernet-1.103
http://search.cpan.org/~mthurn/Net-Address-Ethernet-1.103/
find hardware ethernet address
----
Object-Lazy-0.02
http://search.cpan.org/~steffenw/Object-Lazy-0.02/
create objects late from non-owned classes
----
Parse-Eyapp-1.093
http://search.cpan.org/~casiano/Parse-Eyapp-1.093/
Extensions for Parse::Yapp
----
Parse-Marpa-0.001_047
http://search.cpan.org/~jkegl/Parse-Marpa-0.001_047/
(pre-Alpha) Jay Earley's general parsing algorithm, with LR(0) precomputation
----
Proc-Simple-Async-0.03
http://search.cpan.org/~berle/Proc-Simple-Async-0.03/
Keyword sugar for Proc::Simple
----
Scalar-Defer-0.11
http://search.cpan.org/~audreyt/Scalar-Defer-0.11/
Lazy evaluation in Perl
----
Swarmage-0.00008
http://search.cpan.org/~dmaki/Swarmage-0.00008/
A Distributed Job Queue
----
Test-Aggregate-0.01
http://search.cpan.org/~ovid/Test-Aggregate-0.01/
Aggregate *.t tests to make them run faster.
----
Text-Pipe-0.06
http://search.cpan.org/~marcel/Text-Pipe-0.06/
Common text filter API
----
Vim-Snippet-Converter-0.03
http://search.cpan.org/~cornelius/Vim-Snippet-Converter-0.03/
A Converter for Slippery Snippet Vim Plugin
----
Vim-Snippet-Converter-0.04
http://search.cpan.org/~cornelius/Vim-Snippet-Converter-0.04/
A Template Converter for Slippery Snippet Vim Plugin
----
WWW-Facebook-API-v0.4.9
http://search.cpan.org/~unobe/WWW-Facebook-API-v0.4.9/
Facebook API implementation
----
WWW-Mixi-Scraper-0.11
http://search.cpan.org/~ishigaki/WWW-Mixi-Scraper-0.11/
yet another mixi scraper
----
WWW-NicoVideo-0.02
http://search.cpan.org/~hirata/WWW-NicoVideo-0.02/
Perl interface to Nico Nico Video service
----
Web-Scraper-0.24
http://search.cpan.org/~miyagawa/Web-Scraper-0.24/
Web Scraping Toolkit inspired by Scrapi
----
Web-Scraper-Filter-Pipe-0.01
http://search.cpan.org/~marcel/Web-Scraper-Filter-Pipe-0.01/
Web::Scraper filter to use Text::Pipe segments
----
perl-5.10.0-RC2
http://search.cpan.org/~rgarcia/perl-5.10.0-RC2/
Practical Extraction and Report Language
----
re-engine-Oniguruma-0.01
http://search.cpan.org/~andya/re-engine-Oniguruma-0.01/
Use the Oniguruma regex engine with Perl
----
re-engine-Oniguruma-0.02
http://search.cpan.org/~andya/re-engine-Oniguruma-0.02/
Use the Oniguruma regex engine with Perl
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/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Sun, 25 Nov 2007 23:21:48 GMT
From: "John W. Krahn" <krahnj@telus.net>
Subject: Re: opendir mydir/??/??/??
Message-Id: <474A0377.39B40616@telus.net>
"avilella@gmail.com" wrote:
>
> I have a group of dirs and subdirs that look like mydir/00/00/00,
> mydir/00/00/01 ... mydir 11/55/99.
>
> In the same way I can do an "ls mydir/??/??/??/*.ext", is there a way
> that I can do an opendir like:
>
> opendir(DIR, "mydir/??/??/??")
my @files = glob "mydir/??/??/??/*.ext";
perldoc -f glob
perldoc File::Glob
John
--
use Perl;
program
fulfillment
------------------------------
Date: Sun, 25 Nov 2007 22:14:31 -0700
From: "Wade Ward" <wade@zaxfuuq.net>
Subject: page 124 of the camel book
Message-Id: <1196053629_6639@sp12lax.superfeed.net>
I am trying to write something in perl that has on outer while, an inner
while, and an if block within the inner while that causes execution to pass
from the inner block to the outer.
I think that the syntax I'm looking for is on page 124 in the first two code
snippets:
{
do {
last if $x = $y ** 2;
# do something here
} while $x++ <= $z;
}
and DO_LAST ...DO_NEXT immediately following.
1) Don't you want '==' instaed of '=' on the test condition?
2) What are the outside curly braces doing here? What do they belong to?
Control structures in perl look like clothing on the Dallas Cowboy
cheerleaders.
--
wade ward
wade@zaxfuuq.net
435 -838-7760
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: Mon, 26 Nov 2007 07:17:46 GMT
From: "John W. Krahn" <krahnj@telus.net>
Subject: Re: page 124 of the camel book
Message-Id: <474A7303.4E10C53B@telus.net>
Wade Ward wrote:
>
> I am trying to write something in perl that has on outer while, an inner
> while, and an if block within the inner while that causes execution to pass
> from the inner block to the outer.
>
> I think that the syntax I'm looking for is on page 124 in the first two code
> snippets:
>
> {
> do {
> last if $x = $y ** 2;
> # do something here
> } while $x++ <= $z;
> }
>
> and DO_LAST ...DO_NEXT immediately following.
>
> 1) Don't you want '==' instaed of '=' on the test condition?
It depends on what the variables $x and $y are doing inside the loop.
> 2) What are the outside curly braces doing here? What do they belong to?
They create a loop so that 'last' will work, do {} is not a loop.
perldoc perlsyn
John
--
use Perl;
program
fulfillment
------------------------------
Date: Mon, 26 Nov 2007 01:40:09 -0700
From: "Wade Ward" <wade@zaxfuuq.net>
Subject: Re: page 124 of the camel book
Message-Id: <1196065940_6725@sp12lax.superfeed.net>
"John W. Krahn" <krahnj@telus.net> wrote in message
news:474A7303.4E10C53B@telus.net...
> Wade Ward wrote:
>>
>> I am trying to write something in perl that has on outer while, an inner
>> while, and an if block within the inner while that causes execution to
>> pass
>> from the inner block to the outer.
>>
>> I think that the syntax I'm looking for is on page 124 in the first two
>> code
>> snippets:
>>
>> {
>> do {
>> last if $x = $y ** 2;
>> # do something here
>> } while $x++ <= $z;
>> }
>>
>> and DO_LAST ...DO_NEXT immediately following.
>>
>> 1) Don't you want '==' instaed of '=' on the test condition?
>
> It depends on what the variables $x and $y are doing inside the loop.
>
>
>> 2) What are the outside curly braces doing here? What do they belong
>> to?
>
> They create a loop so that 'last' will work, do {} is not a loop.
>
> >
>
Yeah, it might well be in something called perlsyn that I can bring up in an
untoward dos fashion. What's the answer to the Perl question in terms of
its primary reference, the camel book in 17 pieces on my bed?
do is a gloop. I call it a while control for usenet purposes.
Thanks for your response. The code that I'm going to hook up with this
control mechanism follows.
###### fortran prog to translate
# program contract4
# implicit none
#integer, parameter :: dp=kind(1.0d0)
#real(kind=dp):: x_calc, x_sought, base, term
#real(kind=dp):: penultimate
#integer:: power
#x_calc = 5.3_dp
#x_sought = log(160.0_dp)/log(2.0_dp)
#write (*, '(A , F20.15)') " sought = ", x_sought
#base= .5_dp
#power = 1
#outer: do
#term = base**power
#inner: do
#penultimate = x_calc
#x_calc = x_calc + term
#exceed_target: if (10_dp*(2.0_dp**x_calc) .gt. 1600.0_dp) then
#x_calc = penultimate
#power = power + 1
#write (*, '(A , F20.15)') " current= ", x_calc
#write (*, '(A , F20.15)') " term = ", term
#write (*, '(A , I4)') " power = ", (power-1)
#exit
#endif exceed_target
#end do inner
#if (power .gt. 35) exit
#end do outer
#end program contract4
# current= 7.321928094880422
# term = 0.000000000029104
# power = 35
# final = 7.321928094880422
# sought = 7.321928094887362
# 1.2345678911234567892123456.
###### fortran prog to translate
# perl contract53.pl
# perl contract19.pl 2>text55.txt >text56.txt
__END__
--
wade ward
wade@zaxfuuq.net
435 -838-7760
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: Mon, 26 Nov 2007 03:03:38 -0800 (PST)
From: schmmichael@gmail.com
Subject: perl ftp and hidden partitions
Message-Id: <11d5ed0b-22ee-4b65-a335-dd14c963694e@y5g2000hsf.googlegroups.com>
Hi all
I have an automation problem with perl and a ftp server.
The server is running on a B&R-SPS. This contains a flash memory (2GB)
for data logging.
The files will be on a hidden partition called "F".
I tried to log in on different ways:
e.g.:
my $ftp=Net::FTP->new($host,Port => 21, Debug => 1, Passive => 1) or
die "Couldn't connect: $@\n";
print "Connected\n";
$ftp->login('br','br',"/F:/") or die $ftp->message;
my $type = $ftp->binary;
my @files = $ftp->ls();
foreach (@files)
{
print "$_\n";
}
$ftp->quit;
print "closed ftp connection\n";
The problem is that I can login, but get only the file list of
partition "C", which isn't a hidden one. So I don't know
how I can login into the hidden partition with perl
Best thanks for any help
------------------------------
Date: Sun, 25 Nov 2007 17:52:53 -0800 (PST)
From: "aardvarkman@gmail.com" <aardvarkman@gmail.com>
Subject: Re: regex instead of a new lover. . .
Message-Id: <7060cdff-381b-4713-a136-168978cdf833@d21g2000prf.googlegroups.com>
Thanks! Turns out many of these regexs worked. The new ones you
provided taught me something.
However, the problem was in some other code. My match ended up getting
sent to a sub that creates LabEntry widgets on the fly. So when a
value with a non-word character went into $textvar, my validation
string removed it from the entry field. So I was getting the correct
stuff, but it just wasn't showing up in user interface.
sub createLabEntry {
my $parentwidget = $_[0];
my $label = $_[1];
my $textvar = $_[2];
my $width = $_[3];
if ( $$textvar !~ /^[\w+\|]*$/i ) { $$_textvar = ''; }
$parentwidget->LabEntry(
-label => $label,
-labelPack => [ "-side" => "left" ],
-textvariable => $textvar,
-width => $width,
-background => 'white',
-validate => 'key',
-validatecommand => sub { $_[0] =~ /^[\w+\|]*$/i },
-invalidcommand => sub { $parentwidget->bell }
);
}
------------------------------
Date: 26 Nov 2007 10:49:39 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: searching for a pattern for multiple matches
Message-Id: <474aa4c3$0$13939$fa0fcedb@news.zen.co.uk>
On Sat, 24 Nov 2007 11:12:54 -0800 (PST), jhu <jhu4399@yahoo.com> wrote:
> Ok I did not understand that I can still view Perl docs online.
You don't even have to be online.
Just bring up a command prompt window and use the "perldoc" command.
e.g.:
perldoc perl
perldoc perldoc
If you installed ActiveState's distribution, just go to your Start
Menu -> ActivePerl -> Documentation to get the HTML version.
------------------------------
Date: Mon, 26 Nov 2007 02:28:49 -0800 (PST)
From: "alexxx.magni@gmail.com" <alexxx.magni@gmail.com>
Subject: Spidering Hacks
Message-Id: <cc342250-5114-4579-b6e7-24821c3b1ff3@t47g2000hsc.googlegroups.com>
Working on a project for a spider able to gather info for my books
list,
I read a bit of "Spidering Hacks" (OReilly) - which fortunately is all
in Perl.
I was deciding to use the Google API, so I looked also to "Google
Hacks".
Up to now I never registered for a Google API, so when going to the
place suggested by the book (http://www.google.com/apis/download.html)
I was redirected to http://code.google.com, where a huge number of
possible APIs are present.
Do you know where I have to look, to simply obtain the (authorization?
key?) to use the Google search api?
thanks!
Alessandro
------------------------------
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 1063
***************************************