[25023] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7273 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 20 03:07:04 2004

Date: Wed, 20 Oct 2004 00:05:08 -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           Wed, 20 Oct 2004     Volume: 10 Number: 7273

Today's topics:
    Re: Any suggestions? <davidw_spam@spam_gto.net>
    Re: Any suggestions? <davidw_spam@spam_gto.net>
        Change filedate <dreamer@cox.net>
    Re: date format <sdn.girths00869@zoemail.net>
        is it possible? <g-preston1@ti.com>
    Re: is it possible? <jurgenex@hotmail.com>
    Re: is it possible? <mb@uq.net.au.invalid>
    Re: is it possible? <g-preston1@ti.com>
    Re: is it possible? <usa1@llenroc.ude.invalid>
    Re: is it possible? <jwillmore@adelphia.net>
    Re: is it possible? <ceo@nospam.on.net>
    Re: is it possible? <g-preston1@ti.com>
    Re: is it possible? <tadmc@augustmail.com>
    Re: is it possible? <tadmc@augustmail.com>
    Re: is it possible? <usa1@llenroc.ude.invalid>
    Re: Net::FTP and Passive mode problems <usa1@llenroc.ude.invalid>
        perl to english (buildmorelines)
    Re: perl to english <uri@stemsystems.com>
    Re: perl to english <postmaster@castleamber.com>
    Re: perl to english <tim@vegeta.ath.cx>
    Re: Problem while changing file's modification time usi (Sudeep George)
        source a config file carloschoenberg@yahoo.com
    Re: source a config file <usa1@llenroc.ude.invalid>
    Re: source a config file <sholden@flexal.cs.usyd.edu.au>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 20 Oct 2004 02:55:16 -0400
From: David Warren <davidw_spam@spam_gto.net>
Subject: Re: Any suggestions?
Message-Id: <meydnfO4Ovldl-vcRVn-3w@golden.net>

Jon Ericson wrote:
> David Warren <davidw_spam@spam_gto.net> writes:
> 
> 
>> Subject: Any suggestions?
> 
> 
> Maybe a more descriptive subject?  :-)
> 

Yes that could be helpful...
> 
>> my ( @nums , $num ); local $/ = "\r";
> 
> 
> Do you really need this?  Normally the default setting of $/ is just
>  fine.

Lame doesn't print new lines to stdout, it only updates the last line.
It only updates the portion of following line:

Frame#  ----> 8575<----/8575   192 kbps  L  R

I've tried without adjusting $/ variable and the while loop doesn't
receive any input other than 5 lines.

> 
>> open PIPE, "lame $args \"$song_source\"  \"$song_destin\" 2>&1 |";
> 
> 
> You could make this a tad easier to read with:
> 
> open PIPE, qq{lame $args "$song_source" "$song_destin" 2>&1 |};
> 
> I don't have lame (some sort of MP3 decoder?) installed on my system,
>  so I can't guess what sort of output it might have beyond the 
> example you gave.
> 

Yeah it's an MP3 decoder. It shouldn't have much variation than what I
showed you when decoding.

> 
>> my $y = $e->gauge_start( text => "Converting: $song_source", 
>> percentage => 1 ); my $line_count = 1;
> 
> 
> See perlvar for the $. variable.  (Oops.  I read down and you are 
> only counting the number of lines that include /Frame/ and /kbps/ and
>  the current value of $line_count.  $. doesn't help in this case.  Is
>  $frame_count a better name?)
> 
> 
>> then I'm using a while loop:
>> 
>> while ( <PIPE> ) { if ( /Frame/ && /kbps/ && /$line_count/ ) {
> 
> 
> Do you really want to look for the current value of $line_count here?
>  It seems odd if you do.  It might be more clear if you combine this
>  into one regex.  Maybe like:

Perhaps not, I'm was just trying to filter out all possibily of wierd
filenames. Lines 2 & 3 from LAME output filename's and the odds were against
Frame/kbps and the current value of $line_count being in the same line.

> 
> if ( /^Frame.*kbps/ ) {
> 
> But I don't know where the $line_count should be.
> 
> 
>> $line_count++; unless ( defined($num) ) { @nums = 
>> m/(\/\d+\.?\d*|\.\d+)/g;
> 
> 
> This is the bit of code you had a question about.  It finds all of 
> the strings that match a '/' followed by a number (with optional 
> decimal portion) or just the decimal portion of a number.  It puts 
> those strings into the @num array.  In the example input you gave 
> there's just one element.
> 
> 
>> $num = "@nums";
> 
> 
> This converts the array into a string with spaces separating the 
> array elements.  In the example, $num is "/8575".
> 
> 
>> $num =~ s/\///;
> 
> 
> And this removes the '/' from $num.
> 
> I don't know the variety of input you expect, but it looks like you 
> expect to get just one number out of this.  If so, the above block 
> might be better written something like this:
> 
> if (m{/(\d+\.?\d*|\.\d+)}){ $num = $1; }
> 
Right now I'm currently using this example and it is working.  Thanks.
> 
>> } else { $y = $e->gauge_set( $line_count/$num * 100 ); chomp($y); }
>> 
>> 
>> 

>> 
>> (this should all be that is relevant (yes the code could probably 
>> be cleaned up ... ;-)
> 
> 
> Not exactly.  I don't know what the gauge_start method is or what 
> class it belongs to, for instance.  Creating a small, self-contained
>  example is often useful for having other people comment.  It also 
> helps you understand what's going on.  Also including a variety of 
> input and what output you expect, can help.
> 

Gauge_start is from the module ui::Dialog::Backend::Zenity. Right now
I'm using the GNOME dialog tool (zenity) to do all the graphical work. 
I would
like to make it use GTK, however I thought I'd try something slightly
more simple to begin with. ;-)

The excerpts from the program are working as I suggested, however I
wanted to clean it up, learn better syntax... ;-) Next time, I'll try
including small working example.

> (Did I mention that it's hard to test my suggestions because I don't
>  know what sort of input is possible? ;-)
> 
> Jon

The user input's is via a graphical menu, can only select between songs &
cancel. I've got some error handling implemented prior to it actually
decoding.  So it's only going to have to handle the input I showed you
above.

Thanks a lot for the help, I'm just trying to make it a tad bit more
readable and tidy up the code and this was the spot that was bugging me.
Still learning howto use regex..

David



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

Date: Wed, 20 Oct 2004 02:58:25 -0400
From: David Warren <davidw_spam@spam_gto.net>
Subject: Re: Any suggestions?
Message-Id: <meydnfK4OvngluvcRVn-3w@golden.net>

Jim Gibson wrote:
> In article <weCdnYecxoKj_ejcRVn-gw@golden.net>, David Warren 
> <davidw_spam@spam_gto.net> wrote:
> 
> 
>> Frame#  8575/8575   192 kbps  L  R "
>> 

> I am assuming you have 'use strict' and 'use warnings' at the 
> beginning of your program.

Yes I'm using 'use strict' and 'use warnings'

> 
>> my ( @nums , $num ); local $/ = "\r"; open PIPE, "lame $args 
>> \"$song_source\"  \"$song_destin\" 2>&1 |"; my $y = 
>> $e->gauge_start( text => "Converting: $song_source", percentage =>
>>  1 ); my $line_count = 1;
>> 
>> then I'm using a while loop:
>> 
>> while ( <PIPE> ) { if ( /Frame/ && /kbps/ && /$line_count/ ) {
> 
> 
> Here you are trying to match the input line against the current value
>  of $line_count. Why are you doing that? The line you show above 
> doesn't have a line count value in it. This test will succeed 
> randomly based on whether or not the actual line has the current 
> value of $line_count in it as a substring somewhere.
> 

Perhaps $line_count would be better defined as $frame_count.  There is
no real reason other than trying to ensure the output is filtered.
On the 2 and 3rd lines of output from LAME it outputs a
filename and I was just trying to ensure it would be filtered out.  (given
that there is some wierd filenames out there).  Perhaps, not neccessary or
maybe there would be a better way, to make sure I just got the last line
of output ( which is updated/buffered ) from LAME.

The portion that updates is:

Frame#  --->8575<---/8575   192 kbps  L  R "
That could range anywhere from 1105 -> 8575 (lame skips the first 1105
frames).  In this examples, depends on size of mp3.

> You can test and extract the number you want from the input line in 
> one operation:
> 
> if( |Frame#\s*\d+/(\d+)| ) { my $num = $1; # do something with $num }
> 
> 
> 

>> $line_count++; unless ( defined($num) ) {
> 
> 
> Why are you testing to see if $num is defined? This will result in 
> only performing the extraction one time, since you are assigning a 
> value to $num below.
> 

Here I'm after only:

Frame#  8575/-->8575<--   192 kbps  L  R

This never updates, and I don't need to try to match against it anymore
once I defined $num. Thought it would be unneccessary and pointless to
try and continue to try and match against it. Is there any differences in
efficency between checking if a variables is defined or using pattern
matching?

> Then you should clean it up before asking hundreds of people for 
> help. If you need more help, please post a complete, working, minimal
>  program that shows the problem you are having.
> 
> Thanks.

I should rephrase, I am trying to clean it up. Partially that is what I
was looking for here. Next time I will include a small working
example and being a little clearer. Trying to learn how to use regex
(yes I've read docs) (NOTE - my version was working, I was looking for a
cleaner/more efficent way of doing the while loop.)

Thanks for the help.

David




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

Date: Tue, 19 Oct 2004 23:42:10 -0700
From: Fred Hare <dreamer@cox.net>
Subject: Change filedate
Message-Id: <S8qdnbN1gN5UlevcRVnytg@got.net>

I need to change the file creation dates of textfiles using Perl in 
Windows XP. I have path and filename in $filename and the new date in 
$newdate but I cannot find the command for changing the filedates.

-- Fred


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

Date: Tue, 19 Oct 2004 23:08:27 -0500
From: "Eric J. Roode" <sdn.girths00869@zoemail.net>
Subject: Re: date format
Message-Id: <Xns95881796EEE6sdn.comcast@216.196.97.136>

yasaswi@encfor.com (Yasaswi Pulavarti) wrote in 
news:aa862233.0410180743.1fdf5cca@posting.google.com:

> I have a text file I need to load into MySQL database. In the text
> file the date is shown as mm/dd/yyyy format. However I need to enter
> the date in MySQL native yyyy-mm-dd format. How can I change
> formatting without using substring function?
> Thanks,
> Yasaswi

This is a homework problem, isn't it?   :-)

-- 
Eric
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`


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

Date: Tue, 19 Oct 2004 21:07:14 -0500
From: "Jerry Preston" <g-preston1@ti.com>
Subject: is it possible?
Message-Id: <cl4h8j$s53$1@home.itg.ti.com>

I have been running a script out side Perl and having the data go into a
file:

    system "$program $ID > id_list.dat";

Is it possible to redirect the output in ward?

    $ID < system "$program $ID";

Thanks,

Jerry




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

Date: Wed, 20 Oct 2004 02:23:14 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: is it possible?
Message-Id: <m_jdd.5900$5l3.1782@trnddc02>

Jerry Preston wrote:
> I have been running a script out side Perl and having the data go
> into a file:
>
>    system "$program $ID > id_list.dat";

Ok, so far so good.

> Is it possible to redirect the output in ward?
>
>    $ID < system "$program $ID";

I am not sure at all what you are trying to achive (your description is 
rather, hmmmm, unusual).

Are you simply trying to capture the output from your external program and 
assign it to a variable? If yes, then you may want to have a look at the 
documentation for the function that you are using, in particular the fourth 
sentence in the third paragraph:
            "[...] This is
           *not* what you want to use to capture the output from a command,
           for that you should use [...]"
Or just the FAQ:
    "  Why can't I get the output of a command with system()?"
Or plain old Google (yes, this question comes up a few times every month).

If you are looking for something else, then please accept my appologies, my 
crystal ball must have malfunctioned.

jue 




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

Date: Wed, 20 Oct 2004 12:29:55 +1000
From: Matthew Braid <mb@uq.net.au.invalid>
Subject: Re: is it possible?
Message-Id: <cl4ij3$oov$1@bunyip.cc.uq.edu.au>

Jerry Preston wrote:
> I have been running a script out side Perl and having the data go into a
> file:
> 
>     system "$program $ID > id_list.dat";
> 
> Is it possible to redirect the output in ward?
> 
>     $ID < system "$program $ID";
> 
> Thanks,
> 
> Jerry
> 
> 

Backticks:

$output = `$program $ID`;

Note that this only gets you STDOUT - stderr will not be caught. Backticks also 
do not have the more secure forms like system's multiple-argument form.

MB


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

Date: Tue, 19 Oct 2004 21:48:29 -0500
From: "Jerry Preston" <g-preston1@ti.com>
Subject: Re: is it possible?
Message-Id: <cl4jlu$7p$1@home.itg.ti.com>

You are correct, I am trying to capture the output from your external
program and assign it to a variable.

I just tried:

@ID = ( "$program", "$ID" );
system( @ID );

and I get what was passed in "$program", "$ID".

Have I missed something?

Thanks,

Jerry

"Jürgen Exner" <jurgenex@hotmail.com> wrote in message
news:m_jdd.5900$5l3.1782@trnddc02...
> Jerry Preston wrote:
> > I have been running a script out side Perl and having the data go
> > into a file:
> >
> >    system "$program $ID > id_list.dat";
>
> Ok, so far so good.
>
> > Is it possible to redirect the output in ward?
> >
> >    $ID < system "$program $ID";
>
> I am not sure at all what you are trying to achive (your description is
> rather, hmmmm, unusual).
>
> Are you simply trying to capture the output from your external program and
> assign it to a variable? If yes, then you may want to have a look at the
> documentation for the function that you are using, in particular the
fourth
> sentence in the third paragraph:
>             "[...] This is
>            *not* what you want to use to capture the output from a
command,
>            for that you should use [...]"
> Or just the FAQ:
>     "  Why can't I get the output of a command with system()?"
> Or plain old Google (yes, this question comes up a few times every month).
>
> If you are looking for something else, then please accept my appologies,
my
> crystal ball must have malfunctioned.
>
> jue
>
>




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

Date: 20 Oct 2004 04:02:36 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: is it possible?
Message-Id: <Xns958871272E4asu1cornelledu@132.236.56.8>

"Jerry Preston" <g-preston1@ti.com> wrote in
news:cl4jlu$7p$1@home.itg.ti.com: 

[ Please do not top-post. If you don't know what this means, it is time for 
you read the posting guidelines for this group. ]

> "Jürgen Exner" <jurgenex@hotmail.com> wrote in message
> news:m_jdd.5900$5l3.1782@trnddc02...
>> Jerry Preston wrote:
>> > I have been running a script out side Perl and having the data go
>> > into a file:
>> >
>> >    system "$program $ID > id_list.dat";
>>
>> Ok, so far so good.
>>
>> > Is it possible to redirect the output in ward?
>> >
>> >    $ID < system "$program $ID";
>>
>> I am not sure at all what you are trying to achive (your description
>> is rather, hmmmm, unusual).
>>
>> Are you simply trying to capture the output from your external
>> program and assign it to a variable? If yes, then you may want to
>> have a look at the documentation for the function that you are using,

> You are correct, I am trying to capture the output from your external
> program and assign it to a variable.

 ...

> Have I missed something?

Yes, reading the documentation, especially since Jürgen specifically 
referred you to the section relevant to your request.

perldoc -f system

Sinan









>> in particular the 
> fourth
>> sentence in the third paragraph:
>>             "[...] This is
>>            *not* what you want to use to capture the output from a
> command,
>>            for that you should use [...]"
>> Or just the FAQ:
>>     "  Why can't I get the output of a command with system()?"
>> Or plain old Google (yes, this question comes up a few times every
>> month). 
>>
>> If you are looking for something else, then please accept my
>> appologies, 
> my
>> crystal ball must have malfunctioned.
>>
>> jue
>>
>>
> 
> 



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

Date: Wed, 20 Oct 2004 00:20:27 -0400
From: James Willmore <jwillmore@adelphia.net>
Subject: Re: is it possible?
Message-Id: <r7qdnUDF0LMVeujcRVn-hA@adelphia.com>

Jerry Preston wrote:
> You are correct, I am trying to capture the output from your external
> program and assign it to a variable.
> 
> I just tried:
> 
> @ID = ( "$program", "$ID" );
> system( @ID );
> 
> and I get what was passed in "$program", "$ID".
> 
> Have I missed something?

<snip>
Yes.

(from `perldoc -q 'command'`)
=begin
       How can I capture STDERR from an external command?

        There are three basic ways of running external commands:

            system $cmd;                # using system()
            $output = ‘$cmd‘;           # using backticks (‘‘)
            open (PIPE, "cmd │");       # using open()
=cut

`system` will get you the return code of the command being run.

(from `perldoc -f system`)
=begin

     The return value is the exit status of the program as returned
     by the "wait" call.  To get the actual exit value shift right
     by eight (see below).  See also "exec".  This is not what you
     want to use to capture the output from a command, for that you
     should use merely backticks or "qx//", as described in
     "‘STRING‘" in perlop.  Return value of -1 indicates a failure
     to start the program (inspect $! for the reason).

=cut

The other two methods will get you the actual output from the command.

Execute the perldoc commands from above (or visit 
http://www.perldoc.com/) for further information.  If you're still 
stuck, post again.

HTH

Jim


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

Date: Wed, 20 Oct 2004 04:27:51 GMT
From: ChrisO <ceo@nospam.on.net>
Subject: Re: is it possible?
Message-Id: <bPldd.11144$Rf1.10258@newssvr19.news.prodigy.com>

Matthew Braid wrote:
> Jerry Preston wrote:
> 
>> I have been running a script out side Perl and having the data go into a
>> file:
>>
>>     system "$program $ID > id_list.dat";
>>
>> Is it possible to redirect the output in ward?
>>
>>     $ID < system "$program $ID";
>>
>> Thanks,
>>
>> Jerry
>>
>>
> 
> Backticks:
> 
> $output = `$program $ID`;
> 
> Note that this only gets you STDOUT - stderr will not be caught. 

my $rv = `$program $ID 2>&1`;

-ceo


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

Date: Tue, 19 Oct 2004 23:27:02 -0500
From: "Jerry Preston" <g-preston1@ti.com>
Subject: Re: is it possible?
Message-Id: <cl4pep$3jn$1@home.itg.ti.com>

I read it!  It still did not work!!  I had to add ("./$program", "$ID" ).

Thanks,

Jerry

"A. Sinan Unur" <usa1@llenroc.ude.invalid> wrote in message
news:Xns958871272E4asu1cornelledu@132.236.56.8...
> "Jerry Preston" <g-preston1@ti.com> wrote in
> news:cl4jlu$7p$1@home.itg.ti.com:
>
> [ Please do not top-post. If you don't know what this means, it is time
for
> you read the posting guidelines for this group. ]
>
> > "Jürgen Exner" <jurgenex@hotmail.com> wrote in message
> > news:m_jdd.5900$5l3.1782@trnddc02...
> >> Jerry Preston wrote:
> >> > I have been running a script out side Perl and having the data go
> >> > into a file:
> >> >
> >> >    system "$program $ID > id_list.dat";
> >>
> >> Ok, so far so good.
> >>
> >> > Is it possible to redirect the output in ward?
> >> >
> >> >    $ID < system "$program $ID";
> >>
> >> I am not sure at all what you are trying to achive (your description
> >> is rather, hmmmm, unusual).
> >>
> >> Are you simply trying to capture the output from your external
> >> program and assign it to a variable? If yes, then you may want to
> >> have a look at the documentation for the function that you are using,
>
> > You are correct, I am trying to capture the output from your external
> > program and assign it to a variable.
>
> ...
>
> > Have I missed something?
>
> Yes, reading the documentation, especially since Jürgen specifically
> referred you to the section relevant to your request.
>
> perldoc -f system
>
> Sinan
>
>
>
>
>
>
>
>
>
> >> in particular the
> > fourth
> >> sentence in the third paragraph:
> >>             "[...] This is
> >>            *not* what you want to use to capture the output from a
> > command,
> >>            for that you should use [...]"
> >> Or just the FAQ:
> >>     "  Why can't I get the output of a command with system()?"
> >> Or plain old Google (yes, this question comes up a few times every
> >> month).
> >>
> >> If you are looking for something else, then please accept my
> >> appologies,
> > my
> >> crystal ball must have malfunctioned.
> >>
> >> jue
> >>
> >>
> >
> >
>




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

Date: Tue, 19 Oct 2004 23:39:03 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: is it possible?
Message-Id: <slrncnbqv7.3cs.tadmc@magna.augustmail.com>

Jerry Preston <g-preston1@ti.com> wrote:

> Subject: is it possible?


I am asking you again to please put the subject of your article
in the Subject of your article. Play nice!


>     system "$program $ID > id_list.dat";
> 
> Is it possible to redirect the output in ward?


Yes, and the documentation for system() tells you how to do that.

You should read the documentation for the functions that you use you know...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 19 Oct 2004 23:43:31 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: is it possible?
Message-Id: <slrncnbr7j.3cs.tadmc@magna.augustmail.com>


[ Please do not top-post.
  Text rearranged into a sensible order.
]


Jerry Preston <g-preston1@ti.com> wrote:
> "Jürgen Exner" <jurgenex@hotmail.com> wrote in message
> news:m_jdd.5900$5l3.1782@trnddc02...


>> Are you simply trying to capture the output from your external program and
>> assign it to a variable? If yes, then you may want to have a look at the
>> documentation for the function that you are using, in particular the
> fourth
>> sentence in the third paragraph:
>>             "[...] This is
>>            *not* what you want to use to capture the output from a
> command,
>>            for that you should use [...]"
>> Or just the FAQ:
>>     "  Why can't I get the output of a command with system()?"


> You are correct, I am trying to capture the output from your external
> program and assign it to a variable.
> 
> I just tried:
> 
> @ID = ( "$program", "$ID" );


You have some useless uses of double quotes there.

   perldoc -q vars

       What's wrong with always quoting "$vars"?


> Have I missed something?


Yes, you missed reading the reply that you are following up to!

The docs that Jürgen pointed you to tell you how to do it, and it
isn't the way you've shown.

Why don't you just do it the way the docs say to?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 20 Oct 2004 05:29:56 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: is it possible?
Message-Id: <Xns9588F3EB8AC7asu1cornelledu@132.236.56.8>

"Jerry Preston" <g-preston1@ti.com> wrote in 
news:cl4pep$3jn$1@home.itg.ti.com:

> I read it!  

You read what?

> It still did not work!!  

What did not work?

> I had to add ("./$program", "$ID" ).

Huh?

Please stop top-posting and go ahead andread the posting guidelines. That 
way, you might learn how to ask a question. You might also put some effort 
into understanding responses to your posts. Your original question has been 
answered by Jürgen Exner, James Willmore and Matthew Braid. Yet you keep on 
posting gibberish.

Sinan.


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

Date: 20 Oct 2004 01:08:14 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: Net::FTP and Passive mode problems
Message-Id: <Xns9587D70455722asu1cornelledu@132.236.56.8>

hosti1e17@yahoo.com (Hostile17) wrote in 
news:a5522b8e.0410191637.3971835d@posting.google.com:

> I'm using Net::FTP to upload a file.
> 
> The server to which I'm uploading requires that I do so in Passive
> mode.
> 
> I start Net::FTP with "Passive => 1", but the upload takes just over
> two minutes, for a tiny file.

Where is the code you are actually using? Please provide the shortest 
possible program that still exhibits the problem you are experiencing.

> Except, it probably isn't really taking two minutes, it's trying to
> transfer _non_ passively, then switching modes.
> 
> The debug info looks like this:
> 
>      230 User foobar logged in.
>      CWD /path/to/files/
>      250 CWD command successful.
>      ALLO 5
>      Timeout at ftpscript.pl line 23 ### SEE BELOW
>      PASV
>      227 Entering passive mode (123,4,56,78,910,123)
>      STOR foobar.txt
>      125 Data connection already open; Transfer starting.
>      226 Transfer complete.
> 
> Line 23 is where the script says to $ftp->put() my file.

Then the error is on line 42.
 
> So why, when I've told it to use Passive, is it waiting for a timeout
> and only _then_ issuing the PASV message?

Well, you tell us. After all, you are the one looking at the code.

Sinan.


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

Date: 19 Oct 2004 20:23:59 -0700
From: bulk88@hotmail.com (buildmorelines)
Subject: perl to english
Message-Id: <ee659c69.0410191923.33fc0469@posting.google.com>

Is there any script or pragma or something that will translate perl
code to pure english, like that perl latin module, just in english. I
want to show a person who cant read perl code or any computer
language, some perl code, so they have remotly a clue what the code
does or how it flows. It doesnt need to perfectly make sense or be
proper english sentences. Just soemthing that will translate perl code
and/or syntax to english.


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

Date: Wed, 20 Oct 2004 04:36:22 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: perl to english
Message-Id: <x76556gg7m.fsf@mail.sysarch.com>

>>>>> "b" == buildmorelines  <bulk88@hotmail.com> writes:

  b> Is there any script or pragma or something that will translate perl
  b> code to pure english, like that perl latin module, just in english. I
  b> want to show a person who cant read perl code or any computer
  b> language, some perl code, so they have remotly a clue what the code
  b> does or how it flows. It doesnt need to perfectly make sense or be
  b> proper english sentences. Just soemthing that will translate perl code
  b> and/or syntax to english.

what perl latin module? if you mean damain's perligata, that let's you
write perl as latin. it does not translate perl to latin.

and even if you did translate code to english, it still takes a
programmer to understand programming logic. ever heard of cobol? it was
never understood by the manager types which was its intended goal.

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: 20 Oct 2004 06:05:18 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: perl to english
Message-Id: <Xns9588B12663DAcastleamber@130.133.1.4>

buildmorelines wrote:

> Is there any script or pragma or something that will translate perl
> code to pure english, like that perl latin module, just in english. I
> want to show a person who cant read perl code or any computer
> language, some perl code, so they have remotly a clue what the code
> does or how it flows. It doesnt need to perfectly make sense or be
> proper english sentences. Just soemthing that will translate perl code
> and/or syntax to english.

Uhm, isn't Perl not already English enough? 

-- 
John                               MexIT: http://johnbokma.com/mexit/
                           personal page:       http://johnbokma.com/
        Experienced programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html


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

Date: Wed, 20 Oct 2004 06:55:36 -0000
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: perl to english
Message-Id: <slrncnc2s4.gb9.tim@vegeta.saiyix>

John Bokma <postmaster@castleamber.com> wrote:
>  Uhm, isn't Perl not already English enough? 

You'd think so, but to hear pythonistas tell it, you'd think we were
programming in Asgard.

Tim Hammerquist


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

Date: 19 Oct 2004 22:53:47 -0700
From: sudeepgeorge@gmail.com (Sudeep George)
Subject: Re: Problem while changing file's modification time using utime() on windows
Message-Id: <91f9ed5e.0410192153.2e30b431@posting.google.com>

Jon Ericson <Jon.Ericson@jpl.nasa.gov> wrote in message 
> > Any ideas how to handle the case when the file being 'touch'ed is
> > opened already?
> 
> Print an error message?  If the user doesn't have Win32API::File::Time
> installed, this would be an ideal time to suggest it.

Looks like there is no other way other than including the module for
my functionality. I was hoping for some dirty work-around, but all
approaches to this issue on Windows point to the method implemented in
Win32API::File::Time.

Thanks,
Sudeep 
> Jon


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

Date: 19 Oct 2004 21:23:59 -0700
From: carloschoenberg@yahoo.com
Subject: source a config file
Message-Id: <8c526b62.0410192023.4c2ce6b@posting.google.com>

I want to source (do/require/use) a config file. It must be compatible
with warnings and strict.

I don't want warnings about a variable being used only once.

I don't want to put too much cruft in the config file. A package
statement or a my is ok but an exporter is not. There will be many
config files.


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

Date: 20 Oct 2004 05:24:58 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: source a config file
Message-Id: <Xns9588E677D7Easu1cornelledu@132.236.56.8>

carloschoenberg@yahoo.com wrote in 
news:8c526b62.0410192023.4c2ce6b@posting.google.com:

> I want to source (do/require/use) a config file. It must be compatible
> with warnings and strict.
> 
> I don't want warnings about a variable being used only once.
> 
> I don't want to put too much cruft in the config file. A package
> statement or a my is ok but an exporter is not. There will be many
> config files.

It is always nice to know what you want and what you don't want.

Did you have a Perl question?

Sinan. 



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

Date: 20 Oct 2004 05:26:12 GMT
From: Sam Holden <sholden@flexal.cs.usyd.edu.au>
Subject: Re: source a config file
Message-Id: <slrncnbtnk.7hg.sholden@flexal.cs.usyd.edu.au>

On 19 Oct 2004 21:23:59 -0700, carloschoenberg@yahoo.com wrote:
> I want to source (do/require/use) a config file. It must be compatible
> with warnings and strict.
>
> I don't want warnings about a variable being used only once.
>
> I don't want to put too much cruft in the config file. A package
> statement or a my is ok but an exporter is not. There will be many
> config files.

That's nice. Do you have a question?

-- 
Sam Holden


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

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


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