[28515] in Perl-Users-Digest
Perl-Users Digest, Issue: 9879 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 23 06:05:58 2006
Date: Mon, 23 Oct 2006 03:05:06 -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 Mon, 23 Oct 2006 Volume: 10 Number: 9879
Today's topics:
Re: A very nice free browser to try... <kst-u@mib.org>
Re: ability to match / detect acronyms ? <josef.moellers@fujitsu-siemens.com>
Re: bug challenge <uri@stemsystems.com>
Re: FTP to a windows file share? <mattjones@hotmail.co.uk>
HTML::Mason scripts coming up as plain text on apache s <tidusx2@cogeco.ca>
Re: HTML::Mason scripts coming up as plain text on apac <peace.is.our.profession@gmx.de>
new CPAN modules on Mon Oct 23 2006 (Randal Schwartz)
Re: New lightweight block cipher algorithm <pom@imbei.uni-mainz.de>
Re: Parsing and regex <bol@adv.magwien.gv.at>
Re: Reverse algorithm with tangent <bart@nijlen.com>
Re: Reverse algorithm with tangent <nospam-abuse@ilyaz.org>
Re: string substitution for a file, without replacing p <bootiack@yahoo.com>
Switch module misbehavior <graffiti@yahoo.com>
Re: Switch module misbehavior (reading news)
Re: Trying to get past code error in Perl book I'm lear <uri@stemsystems.com>
Re: unable to calculate large file size <josef.moellers@fujitsu-siemens.com>
Re: unable to calculate large file size <hjp-usenet2@hjp.at>
Re: Use system to start a server then execute commands (reading news)
Re: Use system to start a server then execute commands <nospam@somewhere.com>
Re: Use system to start a server then execute commands <veatchla@yahoo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 23 Oct 2006 03:48:21 GMT
From: Keith Thompson <kst-u@mib.org>
Subject: Re: A very nice free browser to try...
Message-Id: <lnlkn7bsl7.fsf@nuthaus.mib.org>
Michele Dondi <bik.mido@tiscalinet.it> writes:
> On 22 Oct 2006 00:42:45 -0700, bj_private@yahoo.com wrote:
>>There's a very nice browser that is called [snip]. I think this
>>browser is the best browser in the market. It has:
[snip]
>
> 8. And how is it relevant here?
It isn't. The article was spammed to dozens of newsgroups.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
------------------------------
Date: Mon, 23 Oct 2006 11:18:48 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: ability to match / detect acronyms ?
Message-Id: <ehi1ih$d6l$1@nntp.fujitsu-siemens.com>
John W. Kennedy wrote:
> anno4000@radom.zrz.tu-berlin.de wrote:
>=20
>> Jack <jack_posemsky@yahoo.com> wrote in comp.lang.perl.misc:
>>
>>> Jack wrote:
>>>
>>>> Hi I was wondering if anyone had any code to detect / match / identi=
fy
>>>> acronyms (AAA, BD) , essentially these are non words..besides just
>>>> detecting the capitals of course.
>>
>>
>> Some acronyms are words,
>=20
>=20
> All acronyms are words, by definition.
There are acronyms that
1. you couldn't pronounce, e.g. WWW,
2. you can pronounce (in some language) but they aren't "proper words"=20
in most languages, e.g. "USA"
3. you can pronounce and they are "proper words" in at least some=20
language, e.g. "ARM: Advanced RISC machine, RISC: Reduced Instruction=20
Set Computer".
I guess Anno was referring to 3.
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: Sun, 22 Oct 2006 18:46:44 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: bug challenge
Message-Id: <x7zmbo2ckr.fsf@mail.sysarch.com>
>>>>> "askc" == attn steven kuo@gmail com <attn.steven.kuo@gmail.com> writes:
askc> As a matter of habit I never pass around
askc> references to $1, $2 variables. So this part of the module
askc> looked a bit funny to me:
askc> I took a quick shot in the dark and changed it
askc> to use a copy of $2:
askc> $rendered =~ s{$self->{chunk_re}}
askc> {
askc> # print "CHUNK $1\nBODY\n----\n<$2>\n\n------\n" ;
askc> ${$self->_render_chunk( \"$2", $href->{$1} ) }}gex ;
askc> (with quotes around $2), The warnings go
askc> away and I get "bart" and "marge" in the output. The existing
askc> regression tests all pass as well.
that was my fix too. what was my big clue was when i was doing extra
copies and prints for debugging, i got a can't modify read only value
which got me looking at $2 since i know those are readonly.
my problem was i was trying to pass scalar refs for a template whereever
i could and i did it one time too many.
good work! wanna fix more of my bugs in the future! :)
now i can release template::simple .02.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: 23 Oct 2006 03:04:27 -0700
From: "MattJ83" <mattjones@hotmail.co.uk>
Subject: Re: FTP to a windows file share?
Message-Id: <1161597867.167520.113070@b28g2000cwb.googlegroups.com>
> I just started to read this thread so I'm sorry if this was discussed
> and I just missed it. I'm guessing that windows server ukbr1234 has a
> shared directory called 'shared' with a sub-directory called test. This
> share is physically located on the server, for example, at d:\share\test
> on ukbr1234. Correct?
\\ukbr1234\share\test is the location yes......so when it is mapped to
a drive it becomes Y:\test
>
> You need to copy some unix files to \\ukbr1234\share\text. Correct?
>
yes. Im logged onto the unix server through hummingbird and want the
files to copy to a windows server.
> Is ftp installed on the windows server?
not sure
> If not, can ftp be installed on this server?
not sure
^^^^^^^^^ the server is a storage server and doesn't allow anyone to
login remotely. You have to be at the machine (which I don't have
access to) so apart from not being able to easily find out - I think
the installing of items would be hard!
>
> If ftp is or can be installed, then you can create an virtual ftp
> directory pointing to d:\share\test. The unix server can then ftp to
> the windows server just like you ftp to a unix server using Net::FTP.
> The windows share \\ukbr1234\share\test will contain the unix files when
> accessing from your desktop. Is this what you are looking for?
>
this is spot on what i am looking for.......
i was orignally looking at mapping to a windows share in perl and then
transfering files across that way thats why i was looking at
Win32::NetResource:
http://www.codecomments.com/archive210-2004-3-154919.html
> --
>
> Len
------------------------------
Date: Mon, 23 Oct 2006 01:46:45 -0400
From: Adam Lawson <tidusx2@cogeco.ca>
Subject: HTML::Mason scripts coming up as plain text on apache server
Message-Id: <eHY_g.172845$sS1.69338@read1.cgocable.net>
I've been trying different routes in order to get HTML::Mason scripts to
work....but the scripts come up as plain text in the browser
I have mod_perl and HTML::Mason loaded and Apache httpd-2.2.3
here is my what is added in my httpd.conf
LoadModule perl_module /usr/local/apache2/modules/mod_perl.so
PerlModule HTML::Mason::ApacheHandler
<Location /usr/local/apache2/htdocs/mason>
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</Location>
------------------------------
Date: Mon, 23 Oct 2006 09:29:27 +0200
From: Mirco Wahab <peace.is.our.profession@gmx.de>
Subject: Re: HTML::Mason scripts coming up as plain text on apache server
Message-Id: <ehhr92$t5c$1@mlucom4.urz.uni-halle.de>
Thus spoke Adam Lawson (on 2006-10-23 07:46):
> I've been trying different routes in order to get HTML::Mason scripts to
> work....but the scripts come up as plain text in the browser
>
> I have mod_perl and HTML::Mason loaded and Apache httpd-2.2.3
> here is my what is added in my httpd.conf
> LoadModule perl_module /usr/local/apache2/modules/mod_perl.so
>
> PerlModule HTML::Mason::ApacheHandler
> <Location /usr/local/apache2/htdocs/mason>
> SetHandler perl-script
> PerlHandler HTML::Mason::ApacheHandler
> </Location>
1) are you sure, you installed mod_perl2 (two!) - otherwise
you have to enable 1.0 compatibility use Apache::compat ();
2) what extension did you use for Mason (top-) files (.htm?)
3) what did you tell apache2 about this extension (DirectoryIndex?)
What receipt did you follow this one?
http://modperlbook.org/html/index.html
Regards
Mirco
------------------------------
Date: Mon, 23 Oct 2006 04:42:01 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Oct 23 2006
Message-Id: <J7Knq1.uKy@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.
Apache-Wyrd-0.94
http://search.cpan.org/~wyrd/Apache-Wyrd-0.94/
HTML embeddable perl objects under mod_perl
----
Audio-XMMSClient-XMLRPC-0.01
http://search.cpan.org/~flora/Audio-XMMSClient-XMLRPC-0.01/
XMLRPC interface to xmms2
----
Audio-XMMSClient-XMLRPC-0.02
http://search.cpan.org/~flora/Audio-XMMSClient-XMLRPC-0.02/
XMLRPC interface to xmms2
----
Audio-XMMSClient-XMLRPC-0.03
http://search.cpan.org/~flora/Audio-XMMSClient-XMLRPC-0.03/
XMLRPC interface to xmms2
----
BSD-Sysctl-0.07
http://search.cpan.org/~dland/BSD-Sysctl-0.07/
Manipulate kernel sysctl variables on BSD-like systems
----
CPAN-1.88_56
http://search.cpan.org/~andk/CPAN-1.88_56/
query, download and build perl modules from CPAN sites
----
Chart-Clicker-1.1.3
http://search.cpan.org/~gphat/Chart-Clicker-1.1.3/
Powerful, extensible charting.
----
Config-XPath-0.01
http://search.cpan.org/~pevans/Config-XPath-0.01/
a module for retrieving configuration data
----
DateTime-0.35
http://search.cpan.org/~drolsky/DateTime-0.35/
A date and time object
----
DateTime-Locale-0.3
http://search.cpan.org/~drolsky/DateTime-Locale-0.3/
Localization support for DateTime.pm
----
DateTime-Locale-0.31
http://search.cpan.org/~drolsky/DateTime-Locale-0.31/
Localization support for DateTime.pm
----
DateTime-Natural-Parse-0.01
http://search.cpan.org/~schubiger/DateTime-Natural-Parse-0.01/
Create machine readable time with natural parsing logic
----
DateTime-TimeZone-0.52
http://search.cpan.org/~drolsky/DateTime-TimeZone-0.52/
Time zone object base class and factory
----
Games-Perlwar-0.02
http://search.cpan.org/~yanick/Games-Perlwar-0.02/
----
List-Pairwise-0.20
http://search.cpan.org/~tdrugeon/List-Pairwise-0.20/
map/grep arrays and hashes pairwise
----
MIME-Charset-0.042
http://search.cpan.org/~nezumi/MIME-Charset-0.042/
Charset Informations for MIME
----
MIME-EncWords-0.03.2
http://search.cpan.org/~nezumi/MIME-EncWords-0.03.2/
deal with RFC-1522 encoded words (improved)
----
MIME-Encwords-0.032
http://search.cpan.org/~nezumi/MIME-Encwords-0.032/
----
Nagios-Object-0.13
http://search.cpan.org/~tobeya/Nagios-Object-0.13/
----
Nagios-Object-0.14
http://search.cpan.org/~tobeya/Nagios-Object-0.14/
----
PadWalker-1.1
http://search.cpan.org/~robin/PadWalker-1.1/
play with other peoples' lexical variables
----
Parse-DMIDecode-0.02
http://search.cpan.org/~nicolaw/Parse-DMIDecode-0.02/
Interface to SMBIOS under Linux using dmidecode
----
Perl-Repository-APC-1.220
http://search.cpan.org/~andk/Perl-Repository-APC-1.220/
Class modelling "All Perl Changes" repository
----
Template-Provider-Encoding-0.06
http://search.cpan.org/~miyagawa/Template-Provider-Encoding-0.06/
Explicitly declare encodings of your templates
----
Template-Provider-Encoding-0.07
http://search.cpan.org/~miyagawa/Template-Provider-Encoding-0.07/
Explicitly declare encodings of your templates
----
Test-Trap-v0.0.20
http://search.cpan.org/~ebhanssen/Test-Trap-v0.0.20/
Trap exit codes, exceptions, output, etc.
----
UNIVERSAL-to_json-0.02
http://search.cpan.org/~kentaro/UNIVERSAL-to_json-0.02/
to_json() method for all objects
----
W3C-LinkChecker-4.3
http://search.cpan.org/~scop/W3C-LinkChecker-4.3/
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: Mon, 23 Oct 2006 10:24:11 +0200
From: Klaus Pommerening <pom@imbei.uni-mainz.de>
Subject: Re: New lightweight block cipher algorithm
Message-Id: <ehi1qv$2m5$1@news1.zdv.uni-mainz.de>
Julio C. Hernandez Castro wrote:
> We have just developped a new block cipher called Raiden,
http://www.schneier.com/crypto-gram-9810.html#cipherdesign
--
Klaus Pommerening [http://www.staff.uni-mainz.de/pommeren/]
Institut für Medizinische Biometrie, Epidemiologie und Informatik
Johannes-Gutenberg-Universität, 55101 Mainz
------------------------------
Date: Mon, 23 Oct 2006 09:53:44 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: Parsing and regex
Message-Id: <1161590024.856100@proxy.dienste.wien.at>
Brian Mc Cauley:
> The qr// operator does do interpolation. (Unless you use the qr'' form)
I wrote about _string_ interpolation, not _variable_
interpolation.
In a double-quoted string, the '\' has a special meaning,
for example \U means "uppercase", \Q quotes special
characters, and so on. And for characters without
special meaning, like 's', the '\' is simply removed.
With qr, string interpolation will not occur, so a '\s+'
will passed literally to the regex engine.
Greetings, Ferry
--
Ing Ferry Bolhar
Magistrat der Stadt Wien - MA 14
A-1010 Wien
E-Mail: bol@adv.magwien.gv.at
------------------------------
Date: 23 Oct 2006 01:45:05 -0700
From: "Bart Van der Donck" <bart@nijlen.com>
Subject: Re: Reverse algorithm with tangent
Message-Id: <1161593105.486812.171700@m73g2000cwd.googlegroups.com>
Ilya Zakharevich wrote:
[IZ]
>>> So do the calcs in some higher-precision-math Perl module.
[BVdD]
>> I've a feeling that this must be the core of the problem, yes. I just
>> hope it's possible to perform such hi-res calculations in the first
>> place.
[IZ]
> No NEED to. Alternatively, since you know the approximate answer, it
> is easy to increase its precision by binary search. Your function is
> monotonic, after all (on small intervals)...
> [...]
Yes. As per my test:
START VALUE CRYPTED DECRYPTED CRYPTED BACK
0.235689444576 -0.02695168550062 -0.217378385791554 -0.02695168552053
0.864201354575 -0.3410699000001 -0.217376072921599 -0.34106990007059
0.840037468 -0.52586445007622 -0.217376789431016 -0.52586445014133
0.23 0.62204008845158 0.994466053557457 0.622040088514515
0.540398781463 0.299718068673499 0.994464173617474 0.29971806865337
0.5778 0.625447420438520 0.994466072360211 0.625447420458046
0.568846 0.2893342697752 0.994464111168694 0.289334269649148
0.21468554 0.0445961802164 0.994462664098794 0.0445961802353584
0.5 0.16452058233646 0.994463363559315 0.164520582231663
0.1684596 -0.1927399763699 -0.217375435678833 -0.1927399764223
0.9475677 0.660203288614217 0.994466262430239 0.660203288737099
0.5894 0.51818577586632 0.994465467150153 0.518185775862764
(*) 0.82416378434687 0.99446711342503 0.824163784296701
(**) 0.9195906682233 0.994467571813756 0.919590668184188
(***) 0.0876330835002718 0.994462911781017 0.0876330834905578
(*) 0.5684672556894522455565423897512444359445
(**) 0.21038994750369854123559425103247680941
(***) 0.647583591374853694423130214
This table seems to indicate that the first nine digits after the dot
always match.
Say we throw away anything after that, and write a "brute force"-loop
like this (supposed we start at 0.123456789):
0.1234567891
0.1234567892
...
0.1234567899
0.12345678911
0.12345678912
...
0.12345678919
0.12345678921
...
0.12345678929
et cetera untill we have a match. In order to avoid endless loops in
case anything goes wrong, one could stop at, let's say 10,000,000 loops
or so. (Which would have checked 0.12345678910000000 to
0.12345678919999999, which would normally return our result I'ld say,
based on the table above).
Another observation is that the DECRYPTED-column always appears to
start with -0.21737* or 0.99446*. I have absolutely no idea why.
--
Bart
------------------------------
Date: Mon, 23 Oct 2006 09:21:43 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Reverse algorithm with tangent
Message-Id: <ehi1j7$ppa$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Bart Van der Donck
<bart@nijlen.com>], who wrote in article <1161593105.486812.171700@m73g2000cwd.googlegroups.com>:
> Another observation is that the DECRYPTED-column always appears to
> start with -0.21737* or 0.99446*. I have absolutely no idea why.
The "1-round-decrypt" function has derivative below 1, so it sends an
interval (inside its regions of continuity) to a shorter interval; in
fact, in many cases *much* shorter interval. It should also have a
point of discontinuity, so the (initial?) round sends the (initial)
interval into two short intervals. The following rounds decreases the
lengths of these two intervals yet more.
Hope this helps,
Ilya
------------------------------
Date: 22 Oct 2006 16:33:52 -0700
From: "gavino" <bootiack@yahoo.com>
Subject: Re: string substitution for a file, without replacing partial string?
Message-Id: <1161560032.871104.291360@m7g2000cwm.googlegroups.com>
You the man that worked!
perl -pi.bak -e "s/\b50\b/450/g" 50.txt
awesome!!!
------------------------------
Date: Sun, 22 Oct 2006 18:54:04 -0400
From: Berk Birand <graffiti@yahoo.com>
Subject: Switch module misbehavior
Message-Id: <pan.2006.10.22.22.54.00.369455@yahoo.com>
Hi,
This question might have been asked before, although I have looked really
hard on google to find an answer. Needless to say, I couldn't, and I would
therefore appreciate it if you can point me to an answer.
I am using the Switch.pm module to use the switch-case syntax. Yet for
some weird reason the interpretor doesn't seem to recognize the case
keyword.
I have the following code, whith basically one case in a switch:
sub getSQL {
my ($SQL_so_far, $tagName, $axis, $n ) = @_;
# p is the outermost query's table alias
my $p = $n + 1;
my $subquery_conditions = "T$n.name = \"$tagName\"\n";
switch ($axis) {
case "child" {
$subquery_conditions .= <<EOF;
AND T$n.start < T$p.start
AND T$n.end > T$p.end
AND T$n.level = T$p.level - 1
EOF
}
}
# append SQL_so_far
$subquery_conditions .= <<EOF;
AND EXISTS ($SQL_so_far)
EOF
# wrap it all up in a SELECT FROM WHERE form
return <<EOF
SELECT *
FROM test T$n
WHERE $subquery_conditions
EOF
}
However when I run it, I get the error:
String found where operator expected at ./xpath2sql line 23, near "case "child""
(Do you need to predeclare case?)
syntax error at ./xpath2sql line 21, near ") {"
Execution of ./file aborted due to compilation errors.
If I copy and paste the same switch construct into its own file, it runs
fine, which leads me to think that the module itself is not broken.
What do you think is the problem? Has anybody run into this issue?
Thanks,
Berk Birand
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: Mon, 23 Oct 2006 07:14:21 GMT
From: "Mumia W. (reading news)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: Switch module misbehavior
Message-Id: <hZZ_g.15469$o71.2964@newsread3.news.pas.earthlink.net>
On 10/22/2006 05:54 PM, Berk Birand wrote:
> Hi,
>
> This question might have been asked before, although I have looked really
> hard on google to find an answer. Needless to say, I couldn't, and I would
> therefore appreciate it if you can point me to an answer.
>
> I am using the Switch.pm module to use the switch-case syntax. Yet for
> some weird reason the interpretor doesn't seem to recognize the case
> keyword.
>
> I have the following code, whith basically one case in a switch:
>
> sub getSQL {
>
> my ($SQL_so_far, $tagName, $axis, $n ) = @_;
>
> # p is the outermost query's table alias
> my $p = $n + 1;
>
> my $subquery_conditions = "T$n.name = \"$tagName\"\n";
>
>
> switch ($axis) {
>
> case "child" {
> $subquery_conditions .= <<EOF;
> AND T$n.start < T$p.start
> AND T$n.end > T$p.end
> AND T$n.level = T$p.level - 1
> EOF
> }
>
> }
>
> # append SQL_so_far
> $subquery_conditions .= <<EOF;
> AND EXISTS ($SQL_so_far)
> EOF
>
> # wrap it all up in a SELECT FROM WHERE form
> return <<EOF
> SELECT *
> FROM test T$n
> WHERE $subquery_conditions
> EOF
> }
>
> However when I run it, I get the error:
>
> String found where operator expected at ./xpath2sql line 23, near "case "child""
> (Do you need to predeclare case?)
> syntax error at ./xpath2sql line 21, near ") {"
> Execution of ./file aborted due to compilation errors.
>
> If I copy and paste the same switch construct into its own file, it runs
> fine, which leads me to think that the module itself is not broken.
>
> What do you think is the problem? Has anybody run into this issue?
>
> Thanks,
> Berk Birand
>
I was able to execute this function, and the case statement is
recognized here; however, I'll believe you if you say that Switch.pm is
messed up.
I had loads of problems with Switch.pm until I abandoned it. It seems to
work passably at the command line or in a CGI script, but it falls over
under mod_perl.
My advise is not to use Switch.pm. Use the alternatives:
perldoc -q switch
--
paduille.4060.mumia.w@earthlink.net
------------------------------
Date: Sun, 22 Oct 2006 18:49:31 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Trying to get past code error in Perl book I'm learning from
Message-Id: <x7vemc2cg4.fsf@mail.sysarch.com>
>>>>> "rc" == rankenory@gmail com <rankenory@gmail.com> writes:
rc> I'm learning Perl from a book called "Learn Perl in a Weekend." I like
rc> the book a lot as far as how it is structured, but there are errata,
rc> and no online errata page to resolve them.
then why do you like the book? never heard of it before and there is no
way to learn perl in a weekend. lying in the title is not a good way to
start. even the learn perl in 24 hours or 21 days are more realistic
(even if 24 hours is bad and 21 days is decent).
so get a decent perl book and burn that your current one.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 23 Oct 2006 11:03:19 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: unable to calculate large file size
Message-Id: <ehi0la$91t$1@nntp.fujitsu-siemens.com>
Peter J. Holzer wrote:
> On 2006-10-19 02:48, himagauri@gmail.com <himagauri@gmail.com> wrote:
>=20
>>The OS is Suse Linux and perl version is 5.8.3.
>>
>>Point is that I would later have to work on files >16 GB. Hence I
>>haven't tested for intermediate values.
>>Initially I thought the '-s' operator doesn't work for file sizes >1
>>GB.
>=20
>=20
> If SuSE has for some reason built perl without large file support, -s
> won't work for files larger than 2 GB. 1 GB would be a strange file siz=
e
> limit.
I'm running SuSE Professional 9.2
perl -V
Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
=2E..
cc=3D'cc', ccflags =3D'-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS=20
-fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64',=
=2E..
lseeksize=3D8
I use a perl script to process DVB-S files and it sure handles files=20
larger than 4GB!
--=20
Josef M=C3=B6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: Mon, 23 Oct 2006 11:46:16 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: unable to calculate large file size
Message-Id: <slrnejp3r8.521.hjp-usenet2@yoyo.hjp.at>
On 2006-10-21 16:59, Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
> On 2006-10-19 02:48, himagauri@gmail.com <himagauri@gmail.com> wrote:
>> Initially I thought the '-s' operator doesn't work for file sizes >1
>> GB.
>
> If SuSE has for some reason built perl without large file support, -s
> won't work for files larger than 2 GB. 1 GB would be a strange file
> size limit.
>
> You can check whether perl has large file support by invoking
Sorry about that - I see now that you included that information already
in your first posting. So I don't see a perl-related reason why -s
shouldn't work.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: Mon, 23 Oct 2006 01:34:02 GMT
From: "Mumia W. (reading news)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: Use system to start a server then execute commands on it
Message-Id: <e_U_g.15353$o71.11411@newsread3.news.pas.earthlink.net>
On 10/22/2006 11:32 AM, James Fassett wrote:
> Brian McCauley wrote:
>> Even if we are not going to be able to reproduce your problem reliably
>> without a perforce server (whatever that is) you should still follow
>> SOP and produce a _minimal_ but _complete_ script that you have run and
>> observed to produce the symtoms. You should then _show_ us the symptoms
>> rather than describe them.
>
> Fair enough Brian - however I can't think of an easy test case that
> involves starting a server process that everyone would have installed
> [...]
I can:
system 'firefox http://www.google.com/';
sleep 4;
system q{firefox --remote 'openURL(http://www.yahoo.com/)'};
Firefox is a web browser, but it also acts as a server and can receive
"remote" commands. http://www.mozilla.org/unix/remote.html
Each server application has specific commands that are used to
communicate with it. Perhaps you should read the documentation for perforce.
> (I'm on Mac OSX). I had assumed this was a simple problem and I would
> get sent to an appropriate FAQ (i.e. I hadn't phrased my perldoc
> queries correctly).
> [...]
Many server applications receive communication through TCP or UDP so
look into "perldoc IO::Socket::INET". Some server processes have special
programs to communicate with them, e.g. mysql:
open (my $fh, '|-', 'mysql test') or die("Whoa: $!");
print $fh 'select 82 * 3, 2 * 4';
close ($fh);
Mysql communicates with mysqld in this case, and mysqld has already been
started.
--
paduille.4060.mumia.w@earthlink.net
------------------------------
Date: Sun, 22 Oct 2006 22:54:10 -0400
From: "Thrill5" <nospam@somewhere.com>
Subject: Re: Use system to start a server then execute commands on it
Message-Id: <BZWdnX7VAsz0s6HYnZ2dnUVZ_v2dnZ2d@comcast.com>
"James Fassett" <reggieband@googlemail.com> wrote in message
news:1161530688.163680.244390@m73g2000cwd.googlegroups.com...
>
> Sherm Pendley wrote:
>> > system( "cmd to start perforce server &" );
>> > ... sometime later within the same script ...
>> > `some cmd on perforce server`;
>> >
>> > The problem is `some cmd` reacts as if the original system call had not
>> > been made (i.e. as if perforce is not running).
>
>> Why ask thousands of people for random guesses, when Perl *knows* what
>> the
>> problem was?
>>
>> if ($? == -1) {
>> print "failed to execute: $!\n";
>> }
>> elsif ($? & 127) {
>> printf "child died with signal %d, %s coredump\n",
>> ($? & 127), ($? & 128) ? 'with' : 'without';
>> }
>> else {
>> printf "child exited with value %d\n", $? >> 8;
>> }
>>
>> Funny, how you "searched" the docs, and still managed to miss the example
>> code that's given in the docs for the very function you're having trouble
>> with.
>
> Hi sherm, thanks for the reply
>
> The call to system does not fail - the perforce server does indeed
> correctly start (I can see it running and execute commands on it from a
> second terminal). However, any commands I'd like to run on the sever
> from within the script react as if the server isn't started.
>
> printf "exit value: %d | signal: %d | core: %d\n", $? >> 8, $? & 127,
> $? & 128;
> after the failed system call, I get an exit code that suggests perforce
> isn't running when I know it is.
>
> Hope this clarifies the question.
>
> James.
>
I have encountered similar problems running commands from within Perl CGI
scripts. Could it be that the perforce server doesn't have the correct
execute permissions for the command? Also, 'system' may require a shell to
execute. Check perldoc -f exec.
Scott
------------------------------
Date: Sun, 22 Oct 2006 22:12:04 -0500
From: l v <veatchla@yahoo.com>
Subject: Re: Use system to start a server then execute commands on it
Message-Id: <12joco4ernqso17@news.supernews.com>
James Fassett wrote:
> Brian McCauley wrote:
[snip]
>
> My first test (before posting) was to sleep for 100 seconds and try and
> execute commands on the server process external to the script (the
> exact same command FWIW). While the script sleeps I can access the
> perforce (a source control system) process it spawns but when the
> script awakes it cannot.
>
> Perhaps a fair question is - is this the type of thing people do all
> the time and it usually just works? ('This' being start a server
> process from within a script and within the same script execute
> commands on that server process)
I have done this when restarting windows services from a central
monitoring server. I typically issue the stop command, then query the
status of the process until it returns a stopped status (typically takes
about 10 seconds). Then I issue the start command. Simply issuing the
stop and start commands is not enough.
What does the output from 'some cmd' produce? Any perforce errors?
What occurs if you manually start the perforce server, verify
connections are accepted by the perforce client; then run your Perl
script which only runs 'some cmd'? If the Perl script does not work,
then the format of 'some cmd' is not correct as interpreted by Perl when
passed to the shell. If the Perl script does work, then you may need to
sleep longer. Or create a loop which sleeps for a short time and lists
the processes running on the Perforce server. Repeat this loop until
perforce processes are running, then run 'some cmd'.
--
Len
------------------------------
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 9879
***************************************