[24399] in Perl-Users-Digest
Perl-Users Digest, Issue: 6587 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 20 09:05:43 2004
Date: Thu, 20 May 2004 06: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 Thu, 20 May 2004 Volume: 10 Number: 6587
Today's topics:
Re: How to find the target of a Unix symlink? <socyl@987jk.com>
Re: How to find the target of a Unix symlink? chris-usenet@roaima.co.uk
How to Profile Perl Script (bugzilla performance issue) (Paul)
Re: How to Profile Perl Script (bugzilla performance is <tadmc@augustmail.com>
Parse a MIME E-Mail (Christian Gersch)
Re: Parse a MIME E-Mail (Malcolm Dew-Jones)
Re: Perl vs PHP <jurgenex@hotmail.com>
Re: Perl vs PHP <postmaster@castleamber.com>
Re: Perl vs PHP <postmaster@castleamber.com>
Re: Perl vs PHP <uri@stemsystems.com>
Re: Perl vs PHP <tadmc@augustmail.com>
Re: Perl vs PHP <wappler@gmx.net>
Re: Perl vs PHP (Sam Holden)
Re: Regular Expressions Help! (Malcolm Dew-Jones)
Re: Regular Expressions Help! <krahnj@acm.org>
Re: SOLVED: How do I scope a variable if the variable n <uri@stemsystems.com>
Re: Test post from Nortel - pls ignore <jurgenex@hotmail.com>
Re: Test post from Nortel - pls ignore <notvalid@email.com>
Re: Testing whether given file is open? <uri@stemsystems.com>
Re: Testing whether given file is open? chris-usenet@roaima.co.uk
Re: Testing whether given file is open? chris-usenet@roaima.co.uk
Re: Testing whether given file is open? <vladimir@NoSpamPLZ.net>
using modules <ihatespam@hotmail.com>
Re: Was this clever or dumb? (Tiger Hillside)
Re: Win32, FTP, line ends <lv@aol.com>
Re: Win32, FTP, line ends (Phil Hibbs)
Re: Win32, FTP, line ends <jussij@zeusedit.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 20 May 2004 03:47:05 +0000 (UTC)
From: kj <socyl@987jk.com>
Subject: Re: How to find the target of a Unix symlink?
Message-Id: <c8h9np$6b3$1@reader2.panix.com>
In <c8gus3$hf8$3@wisteria.csv.warwick.ac.uk> Ben Morrow <usenet@morrow.me.uk> writes:
>Quoth kj <socyl@987jk.com>:
>> In <c8gh1g$re5$1@reader2.panix.com> kj <socyl@987jk.com> writes:
>>
>> >How does one find the target(s) of a Unix symlink?
>>
>> I found readlink, but my gripe with it is that it doesn't follow
>> links beyond the first hop. (I.e. if "first" points to "second",
>> and "second" points to "third", readlink "first" returns "second"
>> not "third.)
>This is the only way to get all the information. A simple way to follow
>all links:
>sub readalllinks {
> my $file = shift;
> while (-l $file) {
> $file = readlink $file;
> }
>}
>
Hmm. I think this fails if $file's target is outside $file's
directory and is specified using a relative path. I think this
does "the right thing":
use Cwd;
use File::Basename;
sub readalllinks {
my $cwd = my $dir = cwd . '/';
my $file = shift;
my $path = ($file =~ m,^/,) ? $file : "${dir}${file}";
$dir = (fileparse($path))[1];
while (-l $path) {
$file = readlink $path;
$path = ($file =~ m,^/,) ? $file : "${dir}${file}";
$dir = (fileparse($path))[1];
}
(my $basename, $dir) = fileparse $path;
chdir $dir;
$path = cwd . "/$basename";
chdir $cwd;
$path;
}
...but it is eggly.
kj
--
NOTE: In my address everything before the period is backwards.
------------------------------
Date: Thu, 20 May 2004 10:18:51 +0100
From: chris-usenet@roaima.co.uk
Subject: Re: How to find the target of a Unix symlink?
Message-Id: <ro9un1-vg.ln1@moldev.cmagroup.co.uk>
Darren Dunham <ddunham@redwood.taos.com> wrote:
> You would have to 'find' on the filesystem (ususally expensive), trying
> to match the inode, and must realize that there may be more than one
> filename for it.
Or zero matches (the file might have been unlinked but still in use).
Chris
------------------------------
Date: 19 May 2004 22:57:59 -0700
From: Paul.Sue@telus.com (Paul)
Subject: How to Profile Perl Script (bugzilla performance issue)
Message-Id: <8757b529.0405192157.36f2d88a@posting.google.com>
Hi,
When I try to add a new bug or update an exisiting bug's status, it
takes *over 2 minutes* before the page is updated. Doing a 'ps' gives:
USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND
root 516 98.8 9.0 8 11128 - A May 04 18644:41 wait
nobody 17594 66.7 6.0 8240 8436 - A 13:30:05 0:02 perl -wT
./processmail -forceowner joe.blow@abc.com -forceqac
nobody 16966 33.3 7.0 8488 8684 - A 13:30:02 0:02 perl -wT
/opt/freeware/apache/share/htdocs/bugs/post_bug.cgi
Does anyone have any idea why it might be taking so long? Is there a
way I can profile the above 2 perl scripts to see why it's taking so
long to run?
Platform is:
IBM RS/6000 Model 43P (7042/7043)
CPU Type: PowerPC_604
CPU Clock Speed: 199 MHz
Memory Size: 128 MB
OS: AIX 5.1
Apache 1.3.27
MySQL 3.23.47
Thanks,
Paul
------------------------------
Date: Thu, 20 May 2004 06:51:09 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to Profile Perl Script (bugzilla performance issue)
Message-Id: <slrncap6td.9oh.tadmc@magna.augustmail.com>
Paul <Paul.Sue@telus.com> wrote:
> Is there a
> way I can profile the above 2 perl scripts to see why it's taking so
> long to run?
perldoc -q profile
How do I profile my Perl programs?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 19 May 2004 19:05:00 -0700
From: gersch.news19@iways.de (Christian Gersch)
Subject: Parse a MIME E-Mail
Message-Id: <d3e39f7d.0405191805.2af644cf@posting.google.com>
Hi,
I have some troubles with the MIME::Parser module. I have saved a MIME
message in a variable. Now I need to extract the plain text.
$entity = $parser->parse_data($message);
What code do I have to use to get the plain text?
Thanks a lot,
-Chris
------------------------------
Date: 19 May 2004 22:56:15 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Parse a MIME E-Mail
Message-Id: <40ac487f@news.victoria.tc.ca>
Christian Gersch (gersch.news19@iways.de) wrote:
: Hi,
: I have some troubles with the MIME::Parser module. I have saved a MIME
: message in a variable. Now I need to extract the plain text.
: $entity = $parser->parse_data($message);
: What code do I have to use to get the plain text?
perldoc MIME::Entity
further down, "Access examples"
various methods mentioned, $ent->mime_type looks useful for choosing the
right entity.
For my own mental excersize, this is how using MIME::Xparser, this
example does not decode the data, just find it.
#!/usr/bin/perl
use strict;
use MIME::Xparser;
package handler;
sub AUTOLOAD {}
sub new { bless \ my $plain , shift }
sub header
{
my $plain = shift;
my $header = shift;
if ( $header =~ m/^Content-Type:\s*text\/plain\b/is )
{ $$plain=1;
}
}
sub end_body { my $plain = shift; $$plain=0;}
sub body
{
my $plain = shift;
my $line = shift;
print $line if $$plain;
}
package main;
my $parser = new MIME::Xparser(new handler);
$parser->start_document();
while (<>)
{
$parser->line($_);
}
$parser->end_document();
--
(Paying) telecommute programming projects wanted. Simply reply to this.
------------------------------
Date: Thu, 20 May 2004 01:15:48 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Perl vs PHP
Message-Id: <8FTqc.1423$x25.1134@nwrddc02.gnilink.net>
porter970 wrote:
> Is there a reason to use Perl rather than PHP? I've got stuff that
> uses both ... so much of the syntax, etc. is similar. Is one more
> secure ... or faster ... ?
Is there a reason to use a wrench rather than a screwdriver?
jue
------------------------------
Date: Wed, 19 May 2004 22:06:10 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Perl vs PHP
Message-Id: <40ac20a3$0$204$58c7af7e@news.kabelfoon.nl>
Wappler wrote:
> Depends on what you plan to do.
> If you want to develop Web Applications use PHP.
> If you want to code programs not only for internet use PERL, there is
> nothing you can't do with PERL.
solve the halting problem?
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
------------------------------
Date: Wed, 19 May 2004 22:08:39 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Perl vs PHP
Message-Id: <40ac2138$0$204$58c7af7e@news.kabelfoon.nl>
Jürgen Exner wrote:
> porter970 wrote:
>
>>Is there a reason to use Perl rather than PHP? I've got stuff that
>>uses both ... so much of the syntax, etc. is similar. Is one more
>>secure ... or faster ... ?
>
> Is there a reason to use a wrench rather than a screwdriver?
swiss army knife v.s. a screwdriver would be a better comparison :-D.
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
------------------------------
Date: Thu, 20 May 2004 03:12:11 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Perl vs PHP
Message-Id: <x7iserokqc.fsf@mail.sysarch.com>
>>>>> "W" == Wappler <wappler@gmx.net> writes:
<don't top post. read the group guidelines>
W> Depends on what you plan to do.
W> If you want to develop Web Applications use PHP.
why? plenty of web stuff is done in perl.
W> If you want to code programs not only for internet use PERL, there is
W> nothing you can't do with PERL.
it is Perl or perl, but never PERL.
<snip of full quote>
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: Wed, 19 May 2004 22:47:45 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Perl vs PHP
Message-Id: <slrncaoaj1.86e.tadmc@magna.augustmail.com>
Wappler <wappler@gmx.net> wrote:
> there is
> nothing you can't do with PERL.
There is nothing you can't do with Perl either.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 20 May 2004 14:10:32 +0200
From: "Wappler" <wappler@gmx.net>
Subject: Re: Perl vs PHP
Message-Id: <40ac9f88$0$15788$91cee783@newsreader02.highway.telekom.at>
"> > Is there a reason to use a wrench rather than a screwdriver?
>
> swiss army knife v.s. a screwdriver would be a better comparison :-D.
[..snip..]
A screwdriver of good quality and correct size may be of more value than the
scredriver of a swiss army's knife if you only want to drive screws.
I mean PHP is specialized/optimized for web programming, perl can also do
this and much more. I am perl fetishist, but I know that PHP has some good
or even better/more elegant aspects.
------------------------------
Date: 20 May 2004 12:42:08 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: Perl vs PHP
Message-Id: <slrncap9t0.v42.sholden@flexal.cs.usyd.edu.au>
On Thu, 20 May 2004 14:10:32 +0200, Wappler <wappler@gmx.net> wrote:
>
> "> > Is there a reason to use a wrench rather than a screwdriver?
>>
>> swiss army knife v.s. a screwdriver would be a better comparison :-D.
> [..snip..]
>
> A screwdriver of good quality and correct size may be of more value than the
> scredriver of a swiss army's knife if you only want to drive screws.
> I mean PHP is specialized/optimized for web programming, perl can also do
> this and much more. I am perl fetishist, but I know that PHP has some good
> or even better/more elegant aspects.
It really doesn't. It has some quick-n-dirty aspects that make creating
broken and insecure web sites fast and easy. To do anything else you end
up having to work against the design of php.
--
Sam Holden
------------------------------
Date: 19 May 2004 13:28:08 -0800
From: yf110@victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Regular Expressions Help!
Message-Id: <40abc358@news.victoria.tc.ca>
Leo Shumacher (lps@ucla.edu) wrote:
: Hi,
: I have a project due today and am struggling with this line:
: s/[,;:!\?\.\"\\\/\]\[]{1,}/ /g;
: I am trying to replace the following characters with whitespace (These
: are word separators and I'm writing a word-counting program. I am
: having trouble figuring out which of those characters need a '\' in
: front of them, since perl doesn't give me an error even with -w when I
: don't use them in the right places.. Here are the characters in a more
: accesible format:
: ,;:! --> These don't need a '\' in front (I think)
: ?."\/][ --> These all need it?
: @ # $ % ^ & * ( ) + - = ~ ` { } < > | --> These I am not sure about.
: Please help!
When it doubt, escape them all (not everyone appears to agree with that,
but I find it works very well). I say that if you need to quote the
characters to be confident you were correct, (and it is a systematic way
to ensure that), then that was means the characters needed to be quoted.
You can also use quotemeta to quote the things that perl thinks may need
quoting, but you have to be sure you are asking it to quote the correct
characters, and this can still end up quoting things that may not need to
be quoted for a specific task.
$chars = <<'EO_CHARS';
@#$%^&*()+-=~`{}<>|?."\/][,;:!
EO_CHARS
# examine the characters to be sure we didn't get it wrong
print $chars;
# now quote them
$quoted = quotemeta($chars);
# lets take a look
print $quoted;
(In the above, there is a trailing \ which is the new line being
escaped, so the above cannot be used as-is in real life.)
--
(Paying) telecommute programming projects wanted. Simply reply to this.
------------------------------
Date: Wed, 19 May 2004 23:43:06 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Regular Expressions Help!
Message-Id: <40ABF0FE.34E5699F@acm.org>
Leo Shumacher wrote:
>
> I have a project due today and am struggling with this line:
>
> s/[,;:!\?\.\"\\\/\]\[]{1,}/ /g;
> I am trying to replace the following characters with whitespace (These
> are word separators and I'm writing a word-counting program. I am
> having trouble figuring out which of those characters need a '\' in
> front of them, since perl doesn't give me an error even with -w when I
> don't use them in the right places.. Here are the characters in a more
> accesible format:
>
> ,;:! --> These don't need a '\' in front (I think)
> ?."\/][ --> These all need it?
> @ # $ % ^ & * ( ) + - = ~ ` { } < > | --> These I am not sure about.
> Please help!
Different characters have different meanings in regular expressions and
in character classes and in double quoted strings (and in printf formats
and in pack formats, etc., etc.). Most of the special characters for
these things can be found in the perlop.pod document.
To simplify things, don't use the substitution operator at all:
tr',;:!?."\/][' 's;
The only character you need to escape with that is ' because it is used
as the delimiter.
John
--
use Perl;
program
fulfillment
------------------------------
Date: Thu, 20 May 2004 03:02:47 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: SOLVED: How do I scope a variable if the variable name contains a variable?
Message-Id: <x7oeojol60.fsf@mail.sysarch.com>
>>>>> "DF" == David Filmer <IneverReadAnythingSentToMe@hotmail.com> writes:
DF> Uri wrote...
D> Hmmm. Either the question is not asked nearly as often as Uri recalls,
D> or else my Google search terms are far too general (I get over 1000
D> hits with: perl scope variable hash my symref - bad signal to noise
D> ratio).
>>
>> try symrefs or symbolic references or soft references
>>
>> use the words *I* mentioned.
>>
DF> I did. 'symref' was one of the terms. :)
and i did say it was covered MANY times here. just pick a few threads
and read them.
DF> Uri's right; my solution is not great; it obscures (but does not
DF> avoid) the trap he discusses. But I believe he's asking, "why are
DF> you bothering to use an array (@) when you could use a hash (%)
DF> instead?"
huh?
DF> I agree that hashes offer many advantages, but I'm not free to use
DF> a hash in this case. I'm constructing a series of parameters to
DF> pass to a module (HTML::Template's TMPL_LOOP), which expects an
DF> array (@) reference. I want my code to be portable, so I don't
DF> want to hack on HTML::Template.
huh?
show some code to back up what you are saying. how is making the array a
lexical not portable? what portability issues do you see?
DF> The script is running under mod_perl, so it's especially important
DF> that I lexically scope my variables.
DF> It does not seem possible to "properly" scope/use an array (@) in the
DF> manner I'm attempting. bummer! Time to rewrite some code...
huh?
show some code. your words are not conveying much useful info.
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: Thu, 20 May 2004 01:29:01 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Test post from Nortel - pls ignore
Message-Id: <xRTqc.1429$x25.1100@nwrddc02.gnilink.net>
Chris wrote:
> Testing outbound posts, please ignore.
Your wish is my command: plonk
------------------------------
Date: Thu, 20 May 2004 05:15:24 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: Test post from Nortel - pls ignore
Message-Id: <M9Xqc.51462$ka4.49176@newssvr29.news.prodigy.com>
Chris wrote:
> Testing outbound posts, please ignore.
>
> News Admin @ Nortel
You should not post test messages to technical newsgr... oh .. it's from
Nortel ... it's ok then ...
--Ala
------------------------------
Date: Thu, 20 May 2004 03:04:41 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Testing whether given file is open?
Message-Id: <x7lljnol2u.fsf@mail.sysarch.com>
>>>>> "l" == lostriver <vladimir@NoSpamPLZ.net> writes:
l> On Wed, 19 May 2004 10:15:51 -0400, Richard Morse wrote:
>>
>> One other option is to have the upload client send the size of the file
>> first, and then send the file. When the uploaded file is the same as
>> the sent size, it's been entirely transferred.
>>
l> You can also check the size of the file, go sleep()
l> for a while and check the size again. If sleep()
l> was long enough and size hasn't increased, you can assume
l> that the transfer is complete....
that is a very poor solution. what if the transfer dies before it
completes? what if there is a long delay for some reason? how long do
you sleep for? what if you need to know quickly and can't afford the
time to sleep?
polling for file transfer completions is not a good idea in
general. there are other ways that work.
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: Thu, 20 May 2004 10:16:12 +0100
From: chris-usenet@roaima.co.uk
Subject: Re: Testing whether given file is open?
Message-Id: <sj9un1-vg.ln1@moldev.cmagroup.co.uk>
Richard Morse <remorse@partners.org> wrote:
> One other option is to have the upload client send the size of the file
> first, and then send the file. When the uploaded file is the same as
> the sent size, it's been entirely transferred.
How would you know that the file containing the file size had not been
truncated? :-)
Chris
------------------------------
Date: Thu, 20 May 2004 10:16:45 +0100
From: chris-usenet@roaima.co.uk
Subject: Re: Testing whether given file is open?
Message-Id: <tk9un1-vg.ln1@moldev.cmagroup.co.uk>
lostriver <vladimir@nospamplz.net> wrote:
> You can also check the size of the file, go sleep()
> for a while and check the size again. If sleep()
> was long enough and size hasn't increased, you can assume
> that the transfer is complete....
No you can't. The transfer could have been interrupted (temporarily
or permanently).
Chris
------------------------------
Date: Thu, 20 May 2004 11:06:33 GMT
From: lostriver <vladimir@NoSpamPLZ.net>
Subject: Re: Testing whether given file is open?
Message-Id: <Zi0rc.13010$Q6.22513@weber.videotron.net>
On Thu, 20 May 2004 03:04:41 GMT, Uri Guttman wrote:
>
> that is a very poor solution. what if the transfer dies before it
> completes?
If transfer dies (by dies I assume you mean termination of TCP session) it is
complete. Esp. if sending process does not automaticaly resend the file and
does not check for success of the transfer.
>what if there is a long delay for some reason? how long do
> you sleep for?
It depends how often transfer takes place.
> what if you need to know quickly and can't afford the
> time to sleep?
Than you cannot use this.
>
> polling for file transfer completions is not a good idea in
> general. there are other ways that work.
>
It is not great solution but it will work just fine in some situations.
The OP never defined the frequency and quantity of those transfers.
How would you go about it, Uri?
--
.signature: No such file or directory
------------------------------
Date: Thu, 20 May 2004 01:15:35 -0700
From: BigDaDDY <ihatespam@hotmail.com>
Subject: using modules
Message-Id: <10aoq7le67t7j42@corp.supernews.com>
Hi all,
Quick question. I've got a Perl program that runs fine from my account at
work, but when someone else copies it and tries to run it from their
account, or when I telnet to another machine and try to run it, it doesn't
work. The error is something to the effect..."Can't find loadable object
in Term::Readkey".
At the top of my script I have
use lib "/acct/mjo1234/perllib";
and below I have
use Term::ReadKey;
I can't understand why this wouldn't work when I telnet to another machine.
Could it be the PERL5LIB environmental variable? Any feedback would be
highly appreciated. Thank you.
Matt
------------------------------
Date: 20 May 2004 05:39:15 -0700
From: tigerhillside@netscape.net (Tiger Hillside)
Subject: Re: Was this clever or dumb?
Message-Id: <5dbe2141.0405200439.64457fdb@posting.google.com>
Greg Miller <gmiller@NOTforSPAM.gregmiller.net> wrote in message news:<1msna0pl7dvi37d9g8bhebrlq9kfpl4kdb@4ax.com>...
> On 19 May 2004 11:51:24 -0700, tigerhillside@netscape.net (Tiger
> Hillside) wrote:
>
> >That would have worked, but at the printing end I would have had to
> >pull the fields apart and get that right. Then I had what I thought
> >was a good idea. I did the following concatination: $timevalue . " on
> >" . $datevalue", sorted the keys, and just printed out the has value
> >and the key.
>
> I do that all of the time. So I'm guessing it's dumb ;)
There is dumb and dumb. I will take that this as the right kind of
dumb. I try to be a bit smarter than my code when I can. ;-)
> I
> think it's the best way to do it for a small dataset. But if you're
> going to be looking at thousands or millions of records, you're better
> off doing an "order by" in your SQL on the date/time then loop through
> all of the records and output the date/time and count anytime the
> date/time on the current record isn't the same as it was on the last
> record.
That was my first thought, have the DBMS do the sorting and check for
changes in key. That is how I would have done it in C. It would have
required much more testing to make sure that I had all of the
comparisons right and default values and such. Since I was not doing
any checking I couldn't get it wrong. We will see if size becomes an
issue. I have other reasons for keeping the number of records examined
to a minimum.
------------------------------
Date: Wed, 19 May 2004 20:44:11 -0500
From: l v <lv@aol.com>
Subject: Re: Win32, FTP, line ends
Message-Id: <40ac0db4_2@corp.newsgroups.com>
Phil Hibbs wrote:
> I'm using Net::FTP on ActiveState perl 5.8.0 and I'm having a problem
> with line ends.
>
> The source files are MS-style with CR/LF line ends, and I'm FTPing the
> file to an MVS mainframe (EBCDIC). The files received at the other end
> still have the CR x'0D' character at the end.
>
> I have worked around the problem by making a temp copy of the file and
> converting the line ends to Unix-style and then FTPing that file, but
> how can I get Net::FTP to behave as though the local platform were
> Microsoft (which it is)? It's behaving like a *nix FTP client.
>
> Phil Hibbs
> http://www.perlmonks.org/index.pl?node=PhilHibbs
Phil
Try ftping the file via the dos ftp command. If the mainframe file
still contains x'0D' at the end, then the mainframes ftp ebcdic to ascii
translation tables need to be changed.
Len
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
------------------------------
Date: 20 May 2004 01:39:20 -0700
From: gg@snark.freeserve.co.uk (Phil Hibbs)
Subject: Re: Win32, FTP, line ends
Message-Id: <a9ec249e.0405200039.733f30b@posting.google.com>
l v <lv@aol.com> wrote in message news:<40ac0db4_2@corp.newsgroups.com>...
> Try ftping the file via the dos ftp command. If the mainframe file
> still contains x'0D' at the end, then the mainframes ftp ebcdic to ascii
> translation tables need to be changed.
Yes, Windows' built-in ftp command handles the line ends correctly.
Phil Hibbs.
------------------------------
Date: Thu, 20 May 2004 21:56:24 +1000
From: Jussi Jumppanen <jussij@zeusedit.com>
Subject: Re: Win32, FTP, line ends
Message-Id: <40AC9CE8.392B@zeusedit.com>
Phil Hibbs wrote:
>
> Sherm Pendley <spamtrap@dot-app.org> wrote in message
> > If you want automagic EOL translation, you need to enable ASCII
> > mode - see the description of the ascii() method in Net::FTP's docs.
>
> I am, because I'm sending the files to an IBM mainframe, and they need
> to be translated to EBCDIC.
Take a look at the Zeus for Windows editor:
http://www.zeusedit.com/lookmain.html
it has integrated FTP editing and supports unix, windows, MVS
and VM FTP servers.
Jussi Jumppanen
Author of: Zeus for Windows (All new version 3.92 out now)
"The C/C++, Cobol, Java, HTML, Python, PHP, Perl programmer's editor"
Home Page: http://www.zeusedit.com
------------------------------
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 6587
***************************************