[31433] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2685 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 20 21:09:47 2009

Date: Fri, 20 Nov 2009 18:09:15 -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           Fri, 20 Nov 2009     Volume: 11 Number: 2685

Today's topics:
        code for a new form of email client <robin1@cnsp.com>
    Re: code for a new form of email client <sysadmin@example.com>
        help with regex <cyrusgreats@gmail.com>
    Re: help with regex <jimsgibson@gmail.com>
    Re: help with regex <cyrusgreats@gmail.com>
    Re: How link it takes when line protocol drops and rout <tzz@lifelogs.com>
    Re: How to get at the perl options (Jens Thoms Toerring)
    Re: How to get at the perl options sharma__r@hotmail.com
    Re: How to get at the perl options <uri@StemSystems.com>
    Re: How to get at the perl options <derykus@gmail.com>
    Re: How to get at the perl options <tzz@lifelogs.com>
    Re: How to get at the perl options <nospam-abuse@ilyaz.org>
    Re: How to get at the perl options <nospam-abuse@ilyaz.org>
    Re: How to get at the perl options <sysadmin@example.com>
    Re: How to get cell value excel in perl <cyrusgreats@gmail.com>
    Re: How to get cell value excel in perl <jimsgibson@gmail.com>
    Re: need to do multiple SSH hops using Perl script. <smallpond@juno.com>
    Re: need to do multiple SSH hops using Perl script. <josef.moellers@ts.fujitsu.com>
    Re: Setting text with PDF::API2 <hjp-usenet2@hjp.at>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 20 Nov 2009 10:32:27 -0800 (PST)
From: Robin <robin1@cnsp.com>
Subject: code for a new form of email client
Message-Id: <1f6ffd4a-2bd5-4324-9d11-b60538d823ec@r24g2000yqd.googlegroups.com>

I am not saying this is good perl code, but it is definely a neat
program:


--

<a href="perl/contraptions1.zip">Contraptions -- A simulation of
building weird machines that you can build (kind of)</a>
<br />
This is an interesting perl program that simulates building machines.
Requires the perl/Tk module.
<br />
<a href="perl_greed1.zip">Greed</a><br />
An interesting perl program that lets you do some interesting art in
one style. Requires the perl Tk module.
<br /><a href="markupeditor1.zip">Markup Editor</a><br />
This editor allows to edit your own markup language like HTML. So, if
you wanted to design your own language that is like XML or HTML use
this. It requires the perl Tk module(s).<br />
<a href="simpleemailreader1.zip">Email Client 1</a><br />
This program lets you read your email but you can't send any. Includes
some neat features. Remember to place it in its own folder/directory
before running it because it creates a file. Requires the perl modules
perl Tk, LWP, and Net::POP3.


-Robin


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

Date: Fri, 20 Nov 2009 15:26:05 -0800
From: Wanna-Be Sys Admin <sysadmin@example.com>
Subject: Re: code for a new form of email client
Message-Id: <iAFNm.45297$de6.2188@newsfe21.iad>

Robin wrote:

> I am not saying this is good perl code, but it is definely a neat
> program:
> 
> 
> --
> 
> <a href="perl/contraptions1.zip">Contraptions -- A simulation of
> building weird machines that you can build (kind of)</a>
> <br />
> This is an interesting perl program that simulates building machines.
> Requires the perl/Tk module.
> <br />
> <a href="perl_greed1.zip">Greed</a><br />
> An interesting perl program that lets you do some interesting art in
> one style. Requires the perl Tk module.
> <br /><a href="markupeditor1.zip">Markup Editor</a><br />
> This editor allows to edit your own markup language like HTML. So, if
> you wanted to design your own language that is like XML or HTML use
> this. It requires the perl Tk module(s).<br />
> <a href="simpleemailreader1.zip">Email Client 1</a><br />
> This program lets you read your email but you can't send any. Includes
> some neat features. Remember to place it in its own folder/directory
> before running it because it creates a file. Requires the perl modules
> perl Tk, LWP, and Net::POP3.
> 
> 
> -Robin

You've posted HTML tags in a text message. Don't post HTML to usenet
anyway.  Also, you have links that contain no URL's to them, just the
file names (which might work for you on your local system, but for no
one else).  Likely, people won't appreciate you posting links to
multiple zip files anyway.  If you have code you want to post, that's
different.

-- 
Not really a wanna-be, but I don't know everything.


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

Date: Fri, 20 Nov 2009 16:07:13 -0800 (PST)
From: Obama <cyrusgreats@gmail.com>
Subject: help with regex
Message-Id: <44e92eab-08e8-4393-b067-4ee29fc530a1@g1g2000pra.googlegroups.com>

I do have a log file that I would like to parse for the key as
follows:
1- start date, 2- server name, 3- end date that match start server
name, 4- size that matches server which started and ended

I got this code:


 while (<FILE>) {
   next if (/^\s*$/);  # skip empty lines
   next if (/^slk/);  # skip empty lines
   next if (/^=/);  # skip = lines
if ( /(\S+) (\S+\s\S+\s\S+) (.*?) (\w+) \S+ (\S+) (\S+)( \(([^)]+
\)))?/ )
   {
     if ($6 eq 'Start')
     {
        push @server_start_name, $5;
        push @server_start_date, $2;
        push @time_start, $3;
     }

    if ($6 eq 'End')
    {
             push @server_end_name, $5;
             push @time_end, $3;
             push @size_end, $7;
      }
   }

 my $num_end = scalar (@time_end);
 for (my $i=0; $i < $num_start; $i++)
 {
   $t1= $time_start[$i];
   $t2= $time_end[$i];
   $tx= $size_end[$i];
   $s_server= $server_start_name[$i];
   $e_server= $server_end_name[$i];
   print "Server $s_server start: $s_server\nServer $e_server End:
$e_server size: $tx\n\n";
 }

the output i get is not right the server-start does not match the end-
server, here is the out put:

output:
====================
Start: Hercules:sm_fv_servicedata
End  : Hercules:sm_fv_students

Start: Hercules:sm_fv_phd
End  : Hercules:sm_fv_phd


Log file:
====================
dst Wed Nov 18 16:00:04 EST galaxy.fuqua.duke.edu:fv_students
Hercules:sm_fv_students Start
dst Wed Nov 18 16:00:05 EST galaxy.fuqua.duke.edu:fv_servicedata
Hercules:sm_fv_servicedata Start
dst Wed Nov 18 16:00:05 EST galaxy.fuqua.duke.edu:fv_phd
Hercules:sm_fv_phd Start
dst Wed Nov 18 16:00:22 EST galaxy.fuqua.duke.edu:fv_students
Hercules:sm_fv_students End (14532 KB)
dst Wed Nov 18 16:00:33 EST galaxy.fuqua.duke.edu:fv_servicedata
Hercules:sm_fv_servicedata End (15212 KB)
dst Wed Nov 18 16:01:00 EST andromeda.fuqua.duke.edu:esx_fc_nfs2
Hercules:sm_esx_fc_nfs2 Request (Retry)
dst Wed Nov 18 16:01:00 EST andromeda.fuqua.duke.edu:esx_fc_nfs2
Hercules:sm_esx_fc_nfs2 Defer (volume is not online; cannot execute
operation)
dst Wed Nov 18 16:01:10 EST galaxy.fuqua.duke.edu:fv_phd
Hercules:sm_fv_phd End (339576 KB)
dst Wed Nov 18 16:02:00 EST andromeda.fuqua.duke.edu:esx_fc_nfs2
Hercules:sm_esx_fc_nfs2 Request (Retry)
dst Wed Nov 18 16:02:00 EST andromeda.fuqua.duke.edu:esx_fc_nfs2
Hercules:sm_esx_fc_nfs2 Defer (volume is not online; cannot execute
operation)
dst Wed Nov 18 16:03:00 EST andromeda.fuqua.duke.edu:esx_fc_nfs2
Hercules:sm_esx_fc_nfs2 Request (Retry)
dst Wed Nov 18 16:03:00 EST andromeda.fuqua.duke.edu:esx_fc_nfs2
Hercules:sm_esx_fc_nfs2 Defer (volume is not online; cannot execute
operation)
~



Any help will be appropriate in advance..


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

Date: Fri, 20 Nov 2009 16:43:55 -0800
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: help with regex
Message-Id: <201120091643554797%jimsgibson@gmail.com>

In article
<44e92eab-08e8-4393-b067-4ee29fc530a1@g1g2000pra.googlegroups.com>,
Obama <cyrusgreats@gmail.com> wrote:

> I do have a log file that I would like to parse for the key as
> follows:
> 1- start date, 2- server name, 3- end date that match start server
> name, 4- size that matches server which started and ended
> 
> I got this code:
> 
> 
>  while (<FILE>) {
>    next if (/^\s*$/);  # skip empty lines
>    next if (/^slk/);  # skip empty lines
>    next if (/^=/);  # skip = lines
> if ( /(\S+) (\S+\s\S+\s\S+) (.*?) (\w+) \S+ (\S+) (\S+)( \(([^)]+
> \)))?/ )
>    {
>      if ($6 eq 'Start')
>      {
>         push @server_start_name, $5;
>         push @server_start_date, $2;
>         push @time_start, $3;
>      }
> 
>     if ($6 eq 'End')
>     {
>              push @server_end_name, $5;
>              push @time_end, $3;
>              push @size_end, $7;
>       }
>    }
> 
>  my $num_end = scalar (@time_end);
>  for (my $i=0; $i < $num_start; $i++)
>  {
>    $t1= $time_start[$i];
>    $t2= $time_end[$i];
>    $tx= $size_end[$i];
>    $s_server= $server_start_name[$i];
>    $e_server= $server_end_name[$i];
>    print "Server $s_server start: $s_server\nServer $e_server End:
> $e_server size: $tx\n\n";
>  }
> 
> the output i get is not right the server-start does not match the end-
> server, here is the out put:
> 
> output:
> ====================
> Start: Hercules:sm_fv_servicedata
> End  : Hercules:sm_fv_students
> 
> Start: Hercules:sm_fv_phd
> End  : Hercules:sm_fv_phd

This is because the End statements do not appear in the log file in the
same order as the Start statements. This is to be expected. Your data
structures assume that they do.

What you need to do is use a data structure that is impervious to the
order of the statements in the log file. Use a hash-of-hashes: the
first-level hash key is the name of the server and the value is a hash
reference. The second-level hash keys are 'Start', 'End', 'Date', and
'Size', and the hash values are the corresponding data extracted from
the file (untested):

my %times;
while(<FILE>) {
  if( big-long-regex ) {
    $times{$5}->{$6} = $3;
    if( $6 eq 'Start' ) {
      $times{$5}->{Date} = $2;
    }elsif( $6 eq 'End' ) {
      $times{$5}->{Size} = $7;
    }
  }
}

You could also use unpack or substr to extract the data instead of a
big regex. If you do stick with a regex, use the x modifier and split
the regex over several lines for readability.

-- 
Jim Gibson


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

Date: Fri, 20 Nov 2009 17:05:39 -0800 (PST)
From: Obama <cyrusgreats@gmail.com>
Subject: Re: help with regex
Message-Id: <ced37a67-24c8-4d51-9037-0502b7ef8961@t11g2000prh.googlegroups.com>

Thanks Jim,
then how do you access it each one?



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

Date: Fri, 20 Nov 2009 15:49:35 -0600
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: How link it takes when line protocol drops and route to be removed  from route table
Message-Id: <87d43c7tow.fsf@lifelogs.com>

On Wed, 18 Nov 2009 18:29:50 -0500 "Uri Guttman" <uri@StemSystems.com> wrote: 

>>>>>> "O" == Obama  <cyrusgreats@gmail.com> writes:
O> Does anyone know how long it takes for PBR in Cisco to switch route
O> when line protocol is down.

UG> and your perl question is?

UG> and why did you put the same question in the subject and in the body?

It's misspelled in the subject so he corrected it in the body.  That's
diligent writing for you.

Ted


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

Date: 20 Nov 2009 15:55:08 GMT
From: jt@toerring.de (Jens Thoms Toerring)
Subject: Re: How to get at the perl options
Message-Id: <7mnsesF3ingt6U1@mid.uni-berlin.de>

sharma__r@hotmail.com wrote:
> On Nov 20, 2:51 pm, Marc Girod <marc.gi...@gmail.com> wrote:
> > On Nov 20, 8:47 am, sharma...@hotmail.com wrote:
> >
> > > How would we do it, if at all it's feasible
> >
> > Check that the intended perl is used, and die if not with instructions
> > to the user.
> >
> > Is this too simple?

> But I dont want "perl" to die. I want it to go on thru run with the
> appropriate version.

But if you depend on a certain version of Perl and the user
started a different version then this "bad" version is al-
ready running and nothing will be able to magically change
it to the desired version by setting or unsetting some
flags. Or am I misunderstanding sonething badly?

If you definitely have to use a certain version of Perl but
the user may start a different one the only way I can think
of at short notice is to check for the version and if it's
the "wrong" one to exec() the correct one from within your
script (perhaps within a BEGIN block). Before doing so you
could also clean up the environment to suite your needs and
then start the correct version wih whatever flags/options
you want.
                          Regards, Jens
-- 
  \   Jens Thoms Toerring  ___      jt@toerring.de
   \__________________________      http://toerring.de


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

Date: Fri, 20 Nov 2009 08:46:32 -0800 (PST)
From: sharma__r@hotmail.com
Subject: Re: How to get at the perl options
Message-Id: <1bc4fc1c-91e5-49fd-a890-c1ea1d9193ed@13g2000prl.googlegroups.com>

On Nov 20, 8:55=A0pm, j...@toerring.de (Jens Thoms Toerring) wrote:
> sharma...@hotmail.com wrote:
> > On Nov 20, 2:51=A0pm, Marc Girod <marc.gi...@gmail.com> wrote:
> > > On Nov 20, 8:47=A0am, sharma...@hotmail.com wrote:
>
> > > > How would we do it, if at all it's feasible
>
> > > Check that the intended perl is used, and die if not with instruction=
s
> > > to the user.
>
> > > Is this too simple?
> > But I dont want "perl" to die. I want it to go on thru run with the
> > appropriate version.
>
> But if you depend on a certain version of Perl and the user
> started a different version then this "bad" version is al-
> ready running and nothing will be able to magically change
> it to the desired version by setting or unsetting some
> flags. Or am I misunderstanding sonething badly?
>
> If you definitely have to use a certain version of Perl but
> the user may start a different one the only way I can think
> of at short notice is to check for the version and if it's
> the "wrong" one to exec() the correct one from within your
> script (perhaps within a BEGIN block). Before doing so you
> could also clean up the environment to suite your needs and
> then start the correct version wih whatever flags/options
> you want.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Regards, Jens
> --
> =A0 \ =A0 Jens Thoms Toerring =A0___ =A0 =A0 =A0j...@toerring.de
> =A0 =A0\__________________________ =A0 =A0 =A0http://toerring.de



You have exactly understood what I'm trying to accomplish,
and if u scroll above in one of replies in this thread, I
mention just this BEGIN-block exec-ing of perl. But, I have
no way of knowing what options were used by perl when
it was fired the first time :-(

Regards,
Rakesh


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

Date: Fri, 20 Nov 2009 12:14:57 -0500
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: How to get at the perl options
Message-Id: <87pr7d2k4u.fsf@quad.sysarch.com>

>>>>> "sr" == sharma r <sharma__r@hotmail.com> writes:

  sr> On Nov 20, 2:51 pm, Marc Girod <marc.gi...@gmail.com> wrote:
  >> On Nov 20, 8:47 am, sharma...@hotmail.com wrote:
  >> 
  >> > How would we do it, if at all it's feasible
  >> 
  >> Check that the intended perl is used, and die if not with instructions
  >> to the user.
  >> 
  >> Is this too simple?
  >> 
  >> Marc

  sr> But I dont want "perl" to die. I want it to go on thru run with the
  sr> appropriate version.

then write a short wrapper script (in shell or c or even perl) to
call/exec perl and the script. don't do this in perl itself or you run
into your problem. if you split this into two things it becomes easy.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Fri, 20 Nov 2009 10:33:22 -0800 (PST)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: How to get at the perl options
Message-Id: <72fc8486-24f8-401c-9a3b-abb0cf4bf312@v15g2000prn.googlegroups.com>

On Nov 20, 9:14=A0am, "Uri Guttman" <u...@StemSystems.com> wrote:
> >>>>> "sr" =3D=3D sharma r <sharma...@hotmail.com> writes:
>
> ...
>
> then write a short wrapper script (in shell or c or even perl) to
> call/exec perl and the script. don't do this in perl itself or you run
> into your problem. if you split this into two things it becomes easy.
>

I'm not sure why it was included in the strawberry distro
but there's an example which could be easily modified:

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
//
//  wrap perl executable
//
int main (int argc, char* argv[]) {

    const char* perl_cmd =3D "C:/strawberry/perl/bin/perl.orig.exe";
    char* perl_args[argc];
    int i;
    FILE *fp;

    // perl_args[0] =3D argv[0];
    // for( int i =3D 1;  i <=3D argc;  i++ ) {

    fp =3D fopen("c:/temp/prog.log", "a");
    if (fp =3D=3D NULL) {
        printf("C:/temp/prog.log couldn't be opened...");
        exit(1);
    }
    for( i =3D 0;  i <=3D argc;  i++ ) {
        printf("arg %d =3D %s\n", i, argv[i] );
        // perl_args[i+1] =3D argv[i];
   }
   fprintf(fp,"%s was called...\n",argv[1]);
   argv[0] =3D perl_cmd;
   fclose(fp);

   //return execv( perl_cmd, perl_args );
   printf("exec'ing binary %s with arg %s...:  %s\n", argv[0],argv
[1] );
   return execv( perl_cmd, argv );
}

--
Charles DeRykus


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

Date: Fri, 20 Nov 2009 15:47:09 -0600
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: How to get at the perl options
Message-Id: <87hbso7tsy.fsf@lifelogs.com>

On Thu, 19 Nov 2009 23:23:39 -0500 "Uri Guttman" <uri@StemSystems.com> wrote: 

>>>>>> "IZ" == Ilya Zakharevich <nospam-abuse@ilyaz.org> writes:
IZ> On 2009-11-20, Uri Guttman <uri@StemSystems.com> wrote:
BM> Some of them (like -w) show up as magic variables: see perldoc perlvar.
BM> I don't believe that applies to -S.
>>> 
>>> and a better question is why do you want them? i have never seen anyone
>>> ask for these in 16 years of hacking perl.

IZ> I need them very much.  See the ugly hacks done in perl debugger to
IZ> implement even the brain-damaged version of `R' command.

IZ> Getting "the @wholeARGV" would be very useful in many situations...
IZ> As the minimum, consider remote debugging scenario...

UG> trivial then. write a c (or other lang wrapper), grab all the argv, then
UG> call perl and pass argv to it. but it makes little sense for needing all
UG> of the options when some apply to perl and some apply to your app. if
UG> you want that control, do the above. i leave it as an exercise to the
UG> reader.

What's the harm in showing the options to the user?  It seems very
sensible to me and should not require a wrapper.

As an example, -d:ptkdb is different from -d.  Another example: creating
a shell script that will run the current program exactly as it was
invoked, no tinkering needed.

Ted


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

Date: Fri, 20 Nov 2009 23:14:38 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: How to get at the perl options
Message-Id: <slrnhge8mu.1vr.nospam-abuse@powdermilk.math.berkeley.edu>

On 2009-11-20, Uri Guttman <uri@StemSystems.com> wrote:
>   BM> Some of them (like -w) show up as magic variables: see perldoc perlvar.
>   BM> I don't believe that applies to -S.

>  >> and a better question is why do you want them? i have never seen anyone
>  >> ask for these in 16 years of hacking perl.

>  IZ> I need them very much.  See the ugly hacks done in perl debugger to
>  IZ> implement even the brain-damaged version of `R' command.

>  IZ> Getting "the @wholeARGV" would be very useful in many situations...
>  IZ> As the minimum, consider remote debugging scenario...

> trivial then. write a c (or other lang wrapper), grab all the argv, then
> call perl and pass argv to it.

Unacceptable.  Try to explain this to your grandmother (by phone)
[while you are at that, also direct her to modify the
vendor-supplied-binary-program which calls your perl script so that it
calls the wrapper instead... ;-) ;-( ]

> but it makes little sense for needing all of the options when some
> apply to perl and some apply to your app.

As (I think) I explained, this makes a very perfect sense to me.

Let me reiterate: somebody reports a die() from your module.  It is
from a doll knows which perl script called by doll knows who and doll
knows how.  All you have control over is your module.

So you try to modify your die() message to provide more info.  You are
stuck since you cannot deduce how Perl was called.  (One can try to
use OS support, but it maybe an obscure OS, AND some OSes do not
provide introspection of the whole command line of a process.)

Yours,
Ilya


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

Date: Fri, 20 Nov 2009 23:17:08 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: How to get at the perl options
Message-Id: <slrnhge8rk.1vr.nospam-abuse@powdermilk.math.berkeley.edu>

On 2009-11-20, sharma__r@hotmail.com <sharma__r@hotmail.com> wrote:
> You have exactly understood what I'm trying to accomplish,
> and if u scroll above in one of replies in this thread, I
> mention just this BEGIN-block exec-ing of perl. But, I have
> no way of knowing what options were used by perl when
> it was fired the first time :-(

So it is essentially the same problem I mentioned earlier: one wants
to find a way to RESTART the given invocation of Perl (as `R' command
of debugger tries to do - but does not always).

Yours,
Ilya


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

Date: Fri, 20 Nov 2009 14:33:02 -0800
From: Wanna-Be Sys Admin <sysadmin@example.com>
Subject: Re: How to get at the perl options
Message-Id: <pAFNm.45298$de6.3745@newsfe21.iad>

Ted Zlatanov wrote:

> On Thu, 19 Nov 2009 23:23:39 -0500 "Uri Guttman" <uri@StemSystems.com>
> wrote:
> 
>>>>>>> "IZ" == Ilya Zakharevich <nospam-abuse@ilyaz.org> writes:
> IZ> On 2009-11-20, Uri Guttman <uri@StemSystems.com> wrote:
> BM> Some of them (like -w) show up as magic variables: see perldoc
> perlvar. BM> I don't believe that applies to -S.
>>>> 
>>>> and a better question is why do you want them? i have never seen
>>>> anyone ask for these in 16 years of hacking perl.
> 
> IZ> I need them very much.  See the ugly hacks done in perl debugger
> to IZ> implement even the brain-damaged version of `R' command.
> 
> IZ> Getting "the @wholeARGV" would be very useful in many
> situations... IZ> As the minimum, consider remote debugging
> scenario...
> 
> UG> trivial then. write a c (or other lang wrapper), grab all the
> argv, then UG> call perl and pass argv to it. but it makes little
> sense for needing all UG> of the options when some apply to perl and
> some apply to your app. if UG> you want that control, do the above. i
> leave it as an exercise to the UG> reader.
> 
> What's the harm in showing the options to the user?  It seems very
> sensible to me and should not require a wrapper.
> 
> As an example, -d:ptkdb is different from -d.  Another example:
> creating a shell script that will run the current program exactly as
> it was invoked, no tinkering needed.
> 
> Ted

I thought the OP was saying they wanted their Perl script to capture the
switches passed on the command line.  I.e., if someone ran a command
such as -w -S, that the script could show or log that those switches
were used to run the script.  Maybe I had misread their question?
-- 
Not really a wanna-be, but I don't know everything.


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

Date: Fri, 20 Nov 2009 09:01:05 -0800 (PST)
From: Obama <cyrusgreats@gmail.com>
Subject: Re: How to get cell value excel in perl
Message-Id: <938a83af-045a-4bd2-b7d4-a8b8a875d8fa@x6g2000prc.googlegroups.com>

Justin,
> You have created a new worksheet in the above workbook, it too is empty.
Yes correct it is empty but I do have other function which read a file
and populate the data there so there problem here is not if this is
empty , assume it is not empty
> > my $t1 =3D xl_rowcol_to_cell(2, 4); =A0# E2
> > my $t2 =3D xl_rowcol_to_cell(2, 5); =A0# F2
>
> $t1 now contains the string "E3" (not E2 as you state).
> $t2 now contains the string "F3" (rows/cols counted from zero not one)
>
Not matter which column, my question was how to read/get the value
from cell



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

Date: Fri, 20 Nov 2009 09:24:17 -0800
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: How to get cell value excel in perl
Message-Id: <201120090924177859%jimsgibson@gmail.com>

In article
<938a83af-045a-4bd2-b7d4-a8b8a875d8fa@x6g2000prc.googlegroups.com>,
Obama <cyrusgreats@gmail.com> wrote:

> Justin,
> > You have created a new worksheet in the above workbook, it too is empty.
> Yes correct it is empty but I do have other function which read a file
> and populate the data there so there problem here is not if this is
> empty , assume it is not empty
> > > my $t1 = xl_rowcol_to_cell(2, 4);  # E2
> > > my $t2 = xl_rowcol_to_cell(2, 5);  # F2
> >
> > $t1 now contains the string "E3" (not E2 as you state).
> > $t2 now contains the string "F3" (rows/cols counted from zero not one)
> >
> Not matter which column, my question was how to read/get the value
> from cell

You use Spreadsheet::ParseExcel (S:PE) to read data from an Excel
spreadsheet document. You use Spreadsheet::WriteExcel (S:WE) to create
an Excel spreadsheet and add data to its cells. You cannot use S:PE to
add data to an existing spreadsheet, nor can you use S:WE to read data
from a newly-created spreadsheet.

If you are creating a spreadsheet with S:WE and want to see what has
been added, you need to get the data from whatever source was used to
generate the cell contents in the first place, not the spreadsheet
itself.

I suppose you could create a spreadsheet with S:WE, close it, then read
its contents with S:PE. Just don't try to do both at the same time.

Perhaps you can give us an idea of what you are really trying to
accomplish.

-- 
Jim Gibson


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

Date: Fri, 20 Nov 2009 06:10:02 -0800 (PST)
From: smallpond <smallpond@juno.com>
Subject: Re: need to do multiple SSH hops using Perl script.
Message-Id: <cc54e18c-8b1f-4059-b29a-c7be0393612c@o13g2000vbl.googlegroups.com>

On Nov 20, 4:57=A0am, pradeep nair <deep...@gmail.com> wrote:
> The script must:
>
> =A0 =A01. ssh to system A ,from there ssh to system B & from there ssh to
> system C.
> =A0 =A02. At system C need to connect to a DB and execute few queries and
> create an output file
> =A0 =A03. The outfile should be SCpied to Sytem A
>
> Using command ssh -L -T, I am able to end up at System C =A0with perl
> command system. Am stuck there as in the output the cursor remains at
> system C but I need the script to perform step 2 and 3 as mentioned
> above.
>
> Thanks in advance,
> pRADEEP

You should be using Net::SSH.


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

Date: Fri, 20 Nov 2009 15:13:46 +0100
From: Josef Moellers <josef.moellers@ts.fujitsu.com>
To: pradeep nair <deepns7@gmail.com>
Subject: Re: need to do multiple SSH hops using Perl script.
Message-Id: <4B06A41A.6080305@ts.fujitsu.com>

pradeep nair wrote:
> The script must:
> 
>    1. ssh to system A ,from there ssh to system B & from there ssh to
> system C.
>    2. At system C need to connect to a DB and execute few queries and
> create an output file
>    3. The outfile should be SCpied to Sytem A
> 
> 
> 
> Using command ssh -L -T, I am able to end up at System C  with perl
> command system. Am stuck there as in the output the cursor remains at
> system C but I need the script to perform step 2 and 3 as mentioned
> above.

I'd use Expect.
Note that it's not for the faint of heart ;-)

Josef
-- 
These are my personal views and not those of Fujitsu Technology Solutions!
Josef Möllers (Pinguinpfleger bei FTS)
	If failure had no penalty success would not be a prize (T.  Pratchett)
Company Details: http://de.ts.fujitsu.com/imprint.html


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

Date: Fri, 20 Nov 2009 21:03:36 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Setting text with PDF::API2
Message-Id: <slrnhgdtgo.q31.hjp-usenet2@hrunkner.hjp.at>

On 2009-11-20 09:55, bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
> Oliver 'ojo' Bedford wrote:
>> I'm using the paragraph-function to fill text into a given box.
>> For most of the lines it works reasonably well, but sometimes, especially
>> when encountering long words (which are very common in german) paragraph
>> fails to word-wrap. The result are lines which extend beyond the
>> given box.
>> 
>> Is this a bug in paragraph, a feature oder am I just too stupid to use
>> it correctly?
>
> I suspect the creator of the code didn't have words-of-German-length
> in mind.

Very likely he did, since German is his native language. And last time I
talked to him he used PDF::API2 to create reports for his management,
which presumably were in German (but maybe they're Italian now ;-)).

> I seem to remember (from various parts of my career) that laying
> out German paragraphs follows "special" rules and conventions
> that aren't need or applicable to most other languages.

Nope. The rules for typesetting paragraphs in German are exactly the
same as in English (or at least, the different sets of rules for English
and the different sets of rules for German overlap).

	hp



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

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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 2685
***************************************


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