[31002] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2247 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 3 18:09:41 2009

Date: Tue, 3 Mar 2009 15:09:07 -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           Tue, 3 Mar 2009     Volume: 11 Number: 2247

Today's topics:
    Re: Forcing list context on <$fh> <noreply@gunnar.cc>
    Re: Net::SSH2 scp_put not working! <ben@morrow.me.uk>
    Re: Net::SSH2 scp_put not working! (Gary E. Ansok)
        Perl 5.8.8 or 5.8.9 install <dana.fernandez@gmail.com>
    Re: Perl 5.8.8 or 5.8.9 install <tim@burlyhost.com>
    Re: Perl 5.8.8 or 5.8.9 install <dana.fernandez@gmail.com>
    Re: Perl 5.8.8 or 5.8.9 install <tim@burlyhost.com>
    Re: Perl 5.8.8 or 5.8.9 install <dana.fernandez@gmail.com>
    Re: perl implicit loop switch (Darren Dunham)
        system not returning  correct return code. <oakulkarni@gmail.com>
    Re: system not returning correct return code. <oakulkarni@gmail.com>
    Re: system not returning correct return code. <RedGrittyBrick@spamweary.invalid>
    Re: system not returning correct return code. <ben@morrow.me.uk>
    Re: system not returning correct return code. <ben@morrow.me.uk>
    Re: variables that won't stay shared <cartercc@gmail.com>
    Re: What-if algorithm <cartercc@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 03 Mar 2009 22:19:45 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Forcing list context on <$fh>
Message-Id: <715l43Fj2bdnU1@mid.individual.net>

Ben Morrow wrote:
> Quoth Gunnar Hjalmarsson <noreply@gunnar.cc>:
>> Gunnar Hjalmarsson wrote:
>>> I thought that \n means \015\012 on Windows. Now - after having re-read 
>>> your comments, re-read the "Newlines" section in "perldoc perlport", and 
>>> played around some more - I'm slowly realizing that it means \012 just 
>>> as on *nix, and that the \015\012 newline is only used on *saved* text 
>>> files.
>>
>> Second thought. Please read this extract from "perldoc perlport":
>>
>> "Perl uses \n to represent the "logical" newline, where what is logical 
>> may depend on the platform in use. In MacPerl, \n always means \015. In 
>> DOSish perls, \n usually means \012, but when accessing a file in "text" 
>> mode, STDIO translates it to (or from) \015\012, depending on whether 
>> you're reading or writing."
>>
>> Doesn't it say that STDIO changes the meaning of \n on Windows? But that 
>> is not correct, is it? Or am I still missing something?
> 
> It's a little unclear, and of course the reference to STDIO is
> incorrect. What it means is
> 
>     In DOSish perls, "\n" means "\012", but when accessing a file by
>     default a :crlf layer is pushed which will result in "\015\012"
>     appearing in the file.

That sounds much better to me. I sent a bug report:

http://rt.perl.org/rt3/Public/Bug/Display.html?id=63620

(noted that the oldest open docs ticket is 8 years old...)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Tue, 3 Mar 2009 16:21:32 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Net::SSH2 scp_put not working!
Message-Id: <c12086-t05.ln1@osiris.mauzo.dyndns.org>


Quoth ansok@alumni.caltech.edu (Gary E. Ansok):
> 
> This is one reason I gave up on trying to use Net::SSH2 and went
> back to Net::SSH::Perl instead.  I was running a command that would
> not return output quickly enough.  With blocking in place, it never
> returned.  With blocking turned off, I couldn't reliably detect when
> the remote command completed -- the readline returned undef any time
> there was no output waiting to be read, and I couldn't get detection
> of listener_closed or channel_closed to work reliably.

I don't really understand what you were trying to do. If you are running
a remote shell without a pty, you *don't* get any indication that the
command has completed. You certainly don't get EOF: the connection is
still open, waiting for another command. If you need an indication, you
need to either use the ->exec method or arrange to have something
printed after each command has finished. A quick but somewhat dirty way
of doing this is to request a pty, which will cause the remote shell to
start printing prompts.

Try running something like

    cat | sh | cat

(substitute your preferred shell, if you like) to see what I mean.

> Net::SSH::Perl doesn't have the scp functions, but you may be able to
> work around that.  I use cat >file <<_END_OF_INPUT_ to create remote
> files -- this could fail in the general case, of course, but the
> set of files I needed to process was restricted enough that I knew
> it would work for me.

I think you want Net::SFTP, which implements the ssh2 sftp functionality
on top of Net::SSH::Perl. SFTP is what scp(1) actually uses if it's
running over ssh2.

Ben



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

Date: Tue, 3 Mar 2009 17:08:09 +0000 (UTC)
From: ansok@alumni.caltech.edu (Gary E. Ansok)
Subject: Re: Net::SSH2 scp_put not working!
Message-Id: <gojo5p$49m$1@naig.caltech.edu>

In article <c12086-t05.ln1@osiris.mauzo.dyndns.org>,
Ben Morrow  <ben@morrow.me.uk> wrote:
>
>Quoth ansok@alumni.caltech.edu (Gary E. Ansok):
>> 
>> This is one reason I gave up on trying to use Net::SSH2 and went
>> back to Net::SSH::Perl instead.  I was running a command that would
>> not return output quickly enough.  With blocking in place, it never
>> returned.  With blocking turned off, I couldn't reliably detect when
>> the remote command completed -- the readline returned undef any time
>> there was no output waiting to be read, and I couldn't get detection
>> of listener_closed or channel_closed to work reliably.
>
>I don't really understand what you were trying to do. If you are running
>a remote shell without a pty, you *don't* get any indication that the
>command has completed. You certainly don't get EOF: the connection is
>still open, waiting for another command. If you need an indication, you
>need to either use the ->exec method or arrange to have something
>printed after each command has finished. A quick but somewhat dirty way
>of doing this is to request a pty, which will cause the remote shell to
>start printing prompts.

Well, perhaps I wasn't doing it correctly.  I was creating a new
channel and then using $chan->exec($cmd), but was having trouble
getting the complete output and detecting when the remote command
finished.  (The remote command could be as simple as a script with 
"sleep 2; ls".)

As I mentioned, I had an existing version using Net::SSH::Perl, so there
wasn't a massive need to switch over.  We were having performance issues,
but ended up solving those by upgrading the bigint libraries (I think
there was some glitch in the installation of the eearlier versions).

>> Net::SSH::Perl doesn't have the scp functions, but you may be able to
>> work around that.  I use cat >file <<_END_OF_INPUT_ to create remote
>> files -- this could fail in the general case, of course, but the
>> set of files I needed to process was restricted enough that I knew
>> it would work for me.
>
>I think you want Net::SFTP, which implements the ssh2 sftp functionality
>on top of Net::SSH::Perl. SFTP is what scp(1) actually uses if it's
>running over ssh2.

Thanks for the info -- I'd looked at that in the past, but at the time
we were having performance issues centered on the initial connection,
so only doing one connection was important.  (I don't see a way to use
an existing Net::SSH::Perl connection in Net::SFTP, or a supported way to
use the connection from Net::SFTP for other uses.)  Still, it's something
I'll look at again if I need to update this code.

Gary
-- 
I'm in shape. "Round" is a shape.


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

Date: Tue, 3 Mar 2009 13:29:43 -0800 (PST)
From: Dana <dana.fernandez@gmail.com>
Subject: Perl 5.8.8 or 5.8.9 install
Message-Id: <2a6e85a5-cd32-4584-93dd-97f44644fa51@x29g2000prf.googlegroups.com>

I'm not sure if this is the proper Forum for this particular problem,
but I have pretty much tried every place else with no luck.

I am trying to install perl, tried both 5.8.8 and 5.8.9, on an HPUX
11.23 with Itanium2 processessor.

The make test fails with 4 tests failing. Contant.t, PL_FILES,
recurs.t, sem

I can send more information if needed, any help would be greatly
appreciated.

Dana


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

Date: Tue, 03 Mar 2009 13:55:29 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Perl 5.8.8 or 5.8.9 install
Message-Id: <lHhrl.96596$6r1.13710@newsfe19.iad>

Dana wrote:

> I'm not sure if this is the proper Forum for this particular problem,
> but I have pretty much tried every place else with no luck.
> 
> I am trying to install perl, tried both 5.8.8 and 5.8.9, on an HPUX
> 11.23 with Itanium2 processessor.
> 
> The make test fails with 4 tests failing. Contant.t, PL_FILES,
> recurs.t, sem
> 
> I can send more information if needed, any help would be greatly
> appreciated.
> 
> Dana

What are the specific errors in the test you see?  Were you able to
install an older version?  Do you have a version already running now
that's older?
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Tue, 3 Mar 2009 14:44:38 -0800 (PST)
From: Dana <dana.fernandez@gmail.com>
Subject: Re: Perl 5.8.8 or 5.8.9 install
Message-Id: <47c92761-3d12-4734-8056-46c50db927a5@o2g2000prl.googlegroups.com>

On Mar 3, 1:55=A0pm, Tim Greer <t...@burlyhost.com> wrote:
> Dana wrote:
> > I'm not sure if this is the proper Forum for this particular problem,
> > but I have pretty much tried every place else with no luck.
>
> > I am trying to install perl, tried both 5.8.8 and 5.8.9, on an HPUX
> > 11.23 with Itanium2 processessor.
>
> > The make test fails with 4 tests failing. Contant.t, PL_FILES,
> > recurs.t, sem
>
> > I can send more information if needed, any help would be greatly
> > appreciated.
>
> > Dana
>
> What are the specific errors in the test you see? =A0Were you able to
> install an older version? =A0Do you have a version already running now
> that's older?
> --
> Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
> Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
> and Custom Hosting. =A024/7 support, 30 day guarantee, secure servers.
> Industry's most experienced staff! -- Web Hosting With Muscle!

That's the thing there really isn't any error output, the tests just
say failed.  The system came with 5.8.8 installed but it is a very
basic version and in-order to install DBI and DBD perl has to be
reinstalled.


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

Date: Tue, 03 Mar 2009 14:47:06 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Perl 5.8.8 or 5.8.9 install
Message-Id: <Krirl.75560$RJ7.53322@newsfe18.iad>

Dana wrote:

> On Mar 3, 1:55 pm, Tim Greer <t...@burlyhost.com> wrote:
>> Dana wrote:
>> > I'm not sure if this is the proper Forum for this particular
>> > problem, but I have pretty much tried every place else with no
>> > luck.
>>
>> > I am trying to install perl, tried both 5.8.8 and 5.8.9, on an HPUX
>> > 11.23 with Itanium2 processessor.
>>
>> > The make test fails with 4 tests failing. Contant.t, PL_FILES,
>> > recurs.t, sem
>>
>> > I can send more information if needed, any help would be greatly
>> > appreciated.
>>
>> > Dana
>>
>> What are the specific errors in the test you see?  Were you able to
>> install an older version?  Do you have a version already running now
>> that's older?
>> --
<please don't quote signatures>
> 
> That's the thing there really isn't any error output, the tests just
> say failed.  The system came with 5.8.8 installed but it is a very
> basic version and in-order to install DBI and DBD perl has to be
> reinstalled.

I see, can you copy and paste that portion in a reply?  Did you verify
that it didn't suffer any errors before that stage of the build?  I
assume it's an error while running make?
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Tue, 3 Mar 2009 15:08:15 -0800 (PST)
From: Dana <dana.fernandez@gmail.com>
Subject: Re: Perl 5.8.8 or 5.8.9 install
Message-Id: <683ce5a6-60ee-430f-83b3-46105cb3f064@o2g2000prl.googlegroups.com>

> I see, can you copy and paste that portion in a reply? =A0Did you verify
> that it didn't suffer any errors before that stage of the build? =A0I
> assume it's an error while running make?

here is the output of the make test

lib/ExtUtils/t/Constant...................
Stop.
FAILED at test 3

lib/ExtUtils/t/PL_FILES...................#   Failed test in ../lib/
ExtUtils/t/PL_FILES.t at line 38.
#          got: '256'
#     expected: '0'
# Makefile out-of-date with respect to Makefile.PL
# Cleaning current config before rebuilding Makefile...
#        make -f Makefile.old clean > /dev/null 2>&1
#       /usr/local/src/perl-5.8.8/t/perl "-I../../lib" "-I../../lib"
Makefile.PL
# Writing Makefile for PL_FILES::Module
# =3D=3D> Your Makefile has been rebuilt. <=3D=3D
# =3D=3D> Please rerun the make command.  <=3D=3D
#       false
# *** Error exit code 1
#
# Stop.
#   Failed test 'single.out was created'
#   in ../lib/ExtUtils/t/PL_FILES.t at line 41.
#   Failed test '1.out was created'
#   in ../lib/ExtUtils/t/PL_FILES.t at line 41.
#   Failed test '2.out was created'
#   in ../lib/ExtUtils/t/PL_FILES.t at line 41.
#   Failed test 'blib/lib/PL/Bar.pm was created'
#   in ../lib/ExtUtils/t/PL_FILES.t at line 41.
# Looks like you failed 5 tests of 9.
FAILED at test 3

lib/ExtUtils/t/recurs.....................#   Failed test 'recursive
make exited normally'
#   in ../lib/ExtUtils/t/recurs.t at line 61.
#          got: '256'
#     expected: '0'
# Makefile out-of-date with respect to Makefile.PL
# Cleaning current config before rebuilding Makefile...
#        make -f Makefile.old clean > /dev/null 2>&1
#       /usr/local/src/perl-5.8.8/t/perl "-I../../lib" "-I../../lib"
Makefile.PL
# Writing Makefile for Recurs::prj2
# Writing Makefile for Recurs
# =3D=3D> Your Makefile has been rebuilt. <=3D=3D
# =3D=3D> Please rerun the make command.  <=3D=3D
#       false
# *** Error exit code 1
#
# Stop.
FAILED at test 6

Failed 3 test scripts out of 934, 99.68% okay.



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

Date: Tue, 03 Mar 2009 20:09:36 GMT
From: ddunham@taos.com (Darren Dunham)
Subject: Re: perl implicit loop switch
Message-Id: <48grl.13582$W06.6783@flpi148.ffdc.sbc.com>

alexxx.magni@gmail.com <alexxx.magni@gmail.com> wrote:
> perl -wne 'my $i=0;/(\S+)\s+(\S+)/;print "$i $2\n";$i++' e.dat
> 
> of course it doesnt work, but I'd like to have a way for $i to be
> incremented - there is a hope of accomplishing this?

You say "of course" it doesn't work.  But do you know why?  The
incrementing is happening just fine.  But because the "my $i=0" is
inside the loop, each time is getting a new $i (handily set to 0).

The other posts pointing at $. are probably better for something this
simple, but your solution would work fine if you took the assignment out
of the loop:

perl -wne 'BEGIN {$i=1;} /(\S+)\s+(\S+)/;print "$i $2\n";$i++' e.dat

or even 

perl -wne '$i++ ;/(\S+)\s+(\S+)/;print "$i $2\n";' e.dat

-- 
Darren


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

Date: Tue, 3 Mar 2009 08:14:46 -0800 (PST)
From: omi <oakulkarni@gmail.com>
Subject: system not returning  correct return code.
Message-Id: <2787a497-d789-4529-9d81-c85b53ca6e22@j35g2000yqh.googlegroups.com>

Please see following snip of the code:

$SIG{CHLD} = 'IGNORE';

my $ret1 = `ls jjsjds`;
my $ret = $?;


If we see the value of return code, that is not correctly set.
and this problem is coming because of the "$SIG{CHLD} = 'IGNORE';"
flag is set.
we if remove that everything is working fine, but that is requirement
of the code, since we are using this code with perl socket server
code, which should not have to create "defunct" processes.

Please suggest solution on this, where both setting a flag and getting
output with system can hold in the code.

Thanks,
OMkar


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

Date: Tue, 3 Mar 2009 08:16:47 -0800 (PST)
From: omi <oakulkarni@gmail.com>
Subject: Re: system not returning correct return code.
Message-Id: <48983bfe-1ef2-4c58-87b4-f530416bd7dc@g38g2000yqd.googlegroups.com>

On Mar 3, 9:14=A0pm, omi <oakulka...@gmail.com> wrote:
> Please see following snip of the code:
>
> $SIG{CHLD} =3D 'IGNORE';
>
> my $ret1 =3D `ls jjsjds`;
> my $ret =3D $?;
>
> If we see the value of return code, that is not correctly set.
> and this problem is coming because of the "$SIG{CHLD} =3D 'IGNORE';"
> flag is set.
> we if remove that everything is working fine, but that is requirement
> of the code, since we are using this code with perl socket server
> code, which should not have to create "defunct" processes.
>
> Please suggest solution on this, where both setting a flag and getting
> output with system can hold in the code.
>
> Thanks,
> OMkar

Moreover this code perfectly work, if server [which includes this
snip] is running on the Windows BOX.


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

Date: Tue, 03 Mar 2009 16:57:52 +0000
From: RedGrittyBrick <RedGrittyBrick@spamweary.invalid>
Subject: Re: system not returning correct return code.
Message-Id: <49ad6190$0$2522$da0feed9@news.zen.co.uk>


omi wrote:
> On Mar 3, 9:14 pm, omi <oakulka...@gmail.com> wrote:
>> Please see following snip of the code:
>>
>> $SIG{CHLD} = 'IGNORE';
>>
>> my $ret1 = `ls jjsjds`;
>> my $ret = $?;
>>
>> If we see the value of return code, that is not correctly set.
>> and this problem is coming because of the "$SIG{CHLD} = 'IGNORE';"
>> flag is set.
>> we if remove that everything is working fine, but that is requirement
>> of the code, since we are using this code with perl socket server
>> code, which should not have to create "defunct" processes.
>>
>> Please suggest solution on this, where both setting a flag and getting
>> output with system can hold in the code.
>>
>> Thanks,
>> OMkar
> 
> Moreover this code perfectly work, if server [which includes this
> snip] is running on the Windows BOX.

perldoc perlipc:

"On most Unix platforms, the CHLD (sometimes also known as CLD) signal 
has special behavior with respect to a value of 'IGNORE'. ... Calling 
wait() with $SIG{CHLD} set to 'IGNORE'  usually returns -1 on such 
platforms."


perldoc perlvar

"$? ... is just the 16-bit status word returned by the wait() system call"


Since SIGCHLD is "Notification to parent on child stop or exit" I'm not 
entirely surprised that ignoring it leads to the parent not knowing the 
child's exit code.

Does SIGCHLD mean anything on Windows? Presumably the mechanism for 
communicating exit codes might differ?

-- 
RGB


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

Date: Tue, 3 Mar 2009 16:40:11 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: system not returning correct return code.
Message-Id: <b43086-re5.ln1@osiris.mauzo.dyndns.org>


Quoth omi <oakulkarni@gmail.com>:
> On Mar 3, 9:14 pm, omi <oakulka...@gmail.com> wrote:
> > Please see following snip of the code:
> >
> > $SIG{CHLD} = 'IGNORE';
> >
> > my $ret1 = `ls jjsjds`;
> > my $ret = $?;
> >
> > If we see the value of return code, that is not correctly set.
> > and this problem is coming because of the "$SIG{CHLD} = 'IGNORE';"
> > flag is set.

Yes. From the $? entry in perldoc perlvar:

   If you have installed a signal handler for "SIGCHLD", the value
   of $? will usually be wrong outside that handler.

On systems that honour "IGNORE" for SIGCHLD, it counts as a signal
handler. So don't do that.

> > we if remove that everything is working fine, but that is requirement
> > of the code, since we are using this code with perl socket server
> > code, which should not have to create "defunct" processes.

You will have to find a way around this requirement. Probably the only
way is to avoid both `` and $? altogether, and use piped open together
with a custom SIGCHLD handler that knows which processes you need to
remember the wait status for. This will not be trivial to get right, I'm
afraid.

> Moreover this code perfectly work, if server [which includes this
> snip] is running on the Windows BOX.

Well, yes. Win32 has a completely different process model, and doesn't
even *have* a SIGCHLD.

Ben



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

Date: Tue, 3 Mar 2009 18:46:58 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: system not returning correct return code.
Message-Id: <2ia086-e46.ln1@osiris.mauzo.dyndns.org>


Quoth RedGrittyBrick <RedGrittyBrick@spamweary.invalid>:
> 
> Does SIGCHLD mean anything on Windows? Presumably the mechanism for 
> communicating exit codes might differ?

Nope. Ordinary Win32 processes don't even have a real 'parent' in the
Unix sense. Perl's waitpid emulation will in fact wait for any process
you have rights to.

Ben



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

Date: Tue, 3 Mar 2009 10:44:31 -0800 (PST)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: variables that won't stay shared
Message-Id: <31050ae1-428b-4a6b-9a84-1a94e3de14a8@l16g2000yqo.googlegroups.com>

On Mar 3, 10:21=A0am, Ben Morrow <b...@morrow.me.uk> wrote:
> Perl has a very minimal OO system, and one of the things it doesn't
> provide natively is private methods. If you're learning Perl OO starting
> now, and you are expecting it to look like other OO languages you've
> come across, you may want to start out learning to use Moose rather than
> the native OO. It's a little heavy, but it provides a very complete
> object model similar to the one that will be in Perl 6.

I am contemplating redoing in an OO style a scheduling application I
built several years ago. The app doesn't need redoing, and there are
several CPAN modules I could use for it, but my motivation is to learn
more about OO Perl than I know, and the only way you can learn
something is to practice it. I'll probably get about 10K messages
about not-reinventing-the-wheel when I start posting my help messages.

In the past year or so, I've had some heavy experience with Java, C++,
and Lisp, along with using Perl on a daily basis. It's become common
for me to experience a frustrating few minutes up to an hour trying to
'fix' non-working code when it dawns on me, 'Oops, wrong language.'
This has been an educational process, and I might start verbalizing
about in on c.l.p.m., but for now I'll relate the most astonishing
moment I've had!

I'm working through Wilensky's book 'Common Lispcraft' (1984) doing
the exercises at the end of each chapter. At the end of chapter 7, one
of the exercises is to build a working inheritance hierarchy. At the
end of chapter 8 we are asked to implement polymorphism. These
exercises don't use pre-built functionality like you do in Java (for
example) by extending or implementing a class -- the student builds
them natively using the core capabilities of the language.

Now, in which programming text in what programming language are you
expected to implement inheritance hierarchies and polymorphism in
chapters 7 and 8 of the basic text? Lisp is a language from the 1950s
yet could do stuff in the mid-1980s that the BIG languages can't yet
do! Put this in your pipe and smoke it!

CC


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

Date: Tue, 3 Mar 2009 11:04:55 -0800 (PST)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: What-if algorithm
Message-Id: <5e9e437d-776f-469b-97e7-5110d604b083@s20g2000yqh.googlegroups.com>

On Mar 3, 9:34=A0am, gamo <g...@telecable.es> wrote:
> In excel you have a menu function that consist of given one
> cell input and one cell output no matter how are related one
> to other, you could search for the input that correspond to
> a given value of the output.

I know a pretty good bit about Excel, and your question makes no sense
to me. If you are talking about a function from the function box, you
can always backtrace the input. This is a basic functionality of any
spreadsheet program. Not only can you trace function inputs and
outputs, you can see the formulas using the reveal key (Ctl-`).

> That is, if I set $input and have a (complicated)
> $output =3D f ( $input );
> I can search in the reverse direction for a solution to
> $output =3D XXX;

Yeah, well, this is what Excel does. You can go backwards and forwards
from any point.

> Do you know the subyacent algorithm or module to cover this?

In Excel or Perl? In programming languages you can't always reproduce
the input if you know the output and the function, as in a hash
function where the original value that's hashed can't be calculated
without an enormous effort.

If you are asking about a way to reverse engineer a function or a
script, you may not find much help here. If you are asking about a
particular function or script, it might help to post the code and the
output.

CC


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

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 2247
***************************************


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