[22593] in Perl-Users-Digest
Perl-Users Digest, Issue: 4814 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 4 06:06:36 2003
Date: Fri, 4 Apr 2003 03:05:09 -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, 4 Apr 2003 Volume: 10 Number: 4814
Today's topics:
Re: $PROGRAM_NAME <tassilo.parseval@rwth-aachen.de>
Re: Bless equivalent in PHP? <umop@psyon.org>
Re: Bless equivalent in PHP? <umop@psyon.org>
Re: Bless equivalent in PHP? <usenet@NOSPAM.matthewb.org>
build problem - 'compilation of header file requested' (Joe Brenner)
Re: comments within complex structures (qanda)
Re: cpan <abigail@abigail.nl>
Re: cpan (Helgi Briem)
Re: cpan <tassilo.parseval@rwth-aachen.de>
Re: File more recent than 7 days ? <tore@aursand.no>
Re: File more recent than 7 days ? (Helgi Briem)
Re: Formatting output in columns: <goldbb2@earthlink.net>
Re: Formatting output in columns: <goldbb2@earthlink.net>
how it works ! <stacom@stacom-software.de>
Re: how to do psftp from perl on Windows NT <kalinabears@hdc.com.au>
Re: how to do psftp from perl on Windows NT <kalinabears@hdc.com.au>
Re: line sorting question (Philip Lees)
Module to parse PDF (Marco)
Re: Module to parse PDF (Anno Siegel)
Re: perl problem <kalinabears@hdc.com.au>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 4 Apr 2003 06:20:55 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: $PROGRAM_NAME
Message-Id: <b6j887$m1d$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Mark Holt:
> I am having trouble with $0 (or $PROGRAM_NAME). In Perl 5.6.1, (RedHat
> Linux 7.3) no problem, I can set $0 and ps reports the new name. Also, the
> modified value appears in /proc/PID/cmdline.
>
> BUT, in Perl 5.8.0 (RedHat Linux 8.0) this no longer works; ps reports the
> same thing regardless of assignment to $0. Has anyone else noticed this? I
> have scripts that depend on this behavior for reporting state.
As far as I know, setting $0 is temporarily broken in 5.8.0. You'll have
to wait till 5.8.1.
Note that setting $0 doesn't work with every operating system. If you
need reliable identification, you should create a pid-file (for instance
in /var/run or so).
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Thu, 3 Apr 2003 22:12:54 -0800
From: "Eric Arnold" <umop@psyon.org>
Subject: Re: Bless equivalent in PHP?
Message-Id: <b6j7rn$5v91q$1@ID-144898.news.dfncis.de>
Nope. The perl group was the first one of the two groups to answer it =]
Guess you guys have got it more together than they are. =]
Eric
--
---
Eric Arnold
Ondea Mobile Solutions
"Keith Keller" <kkeller-spammmm@wombat.san-francisco.ca.us> wrote in message
news:o2oi6b.uqq.ln@goaway.wombat.san-francisco.ca.us...
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> In article <b6iguj$5drlu$1@ID-144898.news.dfncis.de>, Eric Arnold wrote:
> > does anybody know an equivalent to the 'bless' keyword to use in PHP (or
any
> > other language, for that matter)?
>
> Perhaps people in a PHP group are more likely to know the answer
> to this question.
>
> - --keith
>
> - --
> kkeller-mmmspam@wombat.san-francisco.ca.us
> (try just my userid to email me)
> public key: http://wombat.san-francisco.ca.us/kkeller/kkeller.asc
> alt.os.linux.slackware FAQ: http://wombat.san-francisco.ca.us/cgi-bin/fom
>
> -----BEGIN xxx SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iEYEARECAAYFAj6M45cACgkQhVcNCxZ5ID+MxACgirRl6RkUNOIKVieo0dqPhyOB
> mRMAnjB2PqRzsrYz/T5hlT1k5LzLY2YB
> =UuX5
> -----END PGP SIGNATURE-----
------------------------------
Date: Thu, 3 Apr 2003 22:17:02 -0800
From: "Eric Arnold" <umop@psyon.org>
Subject: Re: Bless equivalent in PHP?
Message-Id: <b6j81q$5rac6$1@ID-144898.news.dfncis.de>
Thanks. What I ended up doing is just passing the instance of the class to
the extended class, created a new extended class with a copy of the original
class to fill in the values, and then deleted the original class.
*whew* 'bless' would have been much shorter =] I wish I could do this
stuff in Perl instead. Is there any sort of way to inline perl with
something similar to PHP or ASP style tags?
Thanks,
Eric
--
---
Eric Arnold
Ondea Mobile Solutions
"Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
news:3E8CDF26.A638A4A3@earthlink.net...
> Eric Arnold wrote:
> >
> > does anybody know an equivalent to the 'bless' keyword to use in PHP
> > (or any other language, for that matter)?
>
> For most OO languages, one cannot alter what class an object is a member
> of (or, if you want to think of it another way, it isn't needed in most
> languages). Consider C++ or Java -- the 'new' operator allocates the
> appropriate amount of memory for you, then does whatever "default"
> initialization is necessary (In C++, this means calling the constructors
> for whatever object fields are classes; in Java, it's setting number
> fields to zero and object fields to null), and then your constructor
> gets called.
>
> --
> $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
> );{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
> ]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
------------------------------
Date: Fri, 04 Apr 2003 08:39:29 +0100
From: Matthew Browning <usenet@NOSPAM.matthewb.org>
Subject: Re: Bless equivalent in PHP?
Message-Id: <pan.2003.04.04.08.39.24.38953.476@NOSPAM.matthewb.org>
On Fri, 04 Apr 2003 07:17:02 +0100, Eric Arnold wrote:
> Thanks. What I ended up doing is just passing the instance of the class
> to the extended class, created a new extended class with a copy of the
> original class to fill in the values, and then deleted the original
> class.
>
> *whew* 'bless' would have been much shorter =] I wish I could do this
> stuff in Perl instead. Is there any sort of way to inline perl with
> something similar to PHP or ASP style tags?
>
HTML::Mason may provide the solution you are after; Template Toolkit
allows the evaluation of Perl blocks in templates processed when
EVAL_PERL is true.
Have a look on CPAN.
[MB]
------------------------------
Date: Fri, 4 Apr 2003 09:35:35 +0000 (UTC)
From: doom@kzsu.stanford.edu (Joe Brenner)
Subject: build problem - 'compilation of header file requested'
Message-Id: <b6jjl7$uh$1@news.Stanford.EDU>
I was just trying to recompile perl 5.8.0 (made some
changes to glibc on my linux box recently, and it
seemed adviseable),
I get through the early stages without any trouble:
rm -f config.sh Policy.sh
sh Configure -de
But shortly after doing the make itself:
make
I start getting stuff like this:
cc: compilation of header file requested
Any thoughts on what's happening here?
Specifically what make is trying to do when the problem comes up is this?
cc av.o av.c av.h config.h cop.h cv.h embed.h embedvar.h EXTERN.h form.h gv.h handy.h hv.h intrpvar.h iperlsys.h mg.h opcode.h op.h opnames.h patchlevel.h perl.h perlio.h perlvars.h perly.h pp.h pp_proto.h proto.h regexp.h scope.h sv.h thrdvar.h thread.h unixish.h /usr/include/alloca.h /usr/include/arpa/inet.h /usr/include/asm/errno.h /usr/include/asm/ioctl.h /usr/include/asm/ioctls.h /usr/include/asm/param.h /usr/include/asm/sigcontext.h /usr/include/asm/socket.h /usr/include/asm/sockios.h /usr/include/
bits/byteswap.h /usr/include/bits/confname.h /usr/include/bits/dirent.h /usr/include/bits/endian.h /usr/include/bits/environments.h /usr/include/bits/errno.h /usr/include/bits/fcntl.h /usr/include/bits/huge_val.h /usr/include/bits/in.h /usr/include/bits/ioctls.h /usr/include/bits/ioctl-types.h /usr/include/bits/ipc.h /usr/include/bits/locale.h /usr/include/bits/local_lim.h /usr/include/bits/mathcalls.h /usr/include/bits/mathdef.h /usr/include/bits/nan.h /usr/include/bits/netdb.h /usr/include/bits/posix1_li
m.h /usr/include/bits/posix2_lim.h /usr/include/bits/posix_opt.h /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h /usr/include/bits/select.h /usr/include/bits/sem.h /usr/include/bits/setjmp.h /usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h /usr/include/bits/siginfo.h /usr/include/bits/signum.h /usr/include/bits/sigset.h /usr/include/bits/sigstack.h /usr/include/bits/sigthread.h /usr/include/bits/sockaddr.h /usr/include/bits/socket.h /usr/include/bits/stat.h /usr/include/bits/stdio_li
m.h /usr/include/bits/sys_errlist.h /usr/include/bits/time.h /usr/include/bits/types.h /usr/include/bits/uio.h /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h /usr/include/bits/wchar.h /usr/include/bits/wordsize.h /usr/include/bits/xopen_lim.h /usr/include/ctype.h /usr/include/dirent.h /usr/include/endian.h /usr/include/errno.h /usr/include/fcntl.h /usr/include/features.h /usr/include/_G_config.h /usr/include/gconv.h /usr/include/getopt.h /usr/include/gnu/stubs.h /usr/include/inttypes.h /usr/i
nclude/libio.h /usr/include/limits.h /usr/include/linux/errno.h /usr/include/linux/limits.h /usr/include/linux/param.h /usr/include/locale.h /usr/include/math.h /usr/include/netdb.h /usr/include/netinet/in.h /usr/include/rpc/netdb.h /usr/include/setjmp.h /usr/include/signal.h /usr/include/stdint.h /usr/include/stdio.h /usr/include/stdlib.h /usr/include/string.h /usr/include/sys/cdefs.h /usr/include/sys/file.h /usr/include/sys/ioctl.h /usr/include/sys/ipc.h /usr/include/sys/param.h /usr/include/sys/select.h
/usr/include/sys/sem.h /usr/include/sys/socket.h /usr/include/sys/stat.h /usr/include/sys/sysmacros.h /usr/include/sys/time.h /usr/include/sys/times.h /usr/include/sys/ttydefaults.h /usr/include/sys/types.h /usr/include/sys/ucontext.h /usr/include/sys/uio.h /usr/include/time.h /usr/include/ucontext.h /usr/include/unistd.h /usr/include/wchar.h /usr/include/xlocale.h /usr/lib/gcc-lib/i386-redhat-linux/3.2/include/float.h /usr/lib/gcc-lib/i386-redhat-linux/3.2/include/limits.h /usr/lib/gcc-lib/i386-redhat-li
nux/3.2/include/stdarg.h /usr/lib/gcc-lib/i386-redhat-linux/3.2/include/stddef.h /usr/lib/gcc-lib/i386-redhat-linux/3.2/include/syslimits.h utf8.h util.h warnings.h -o av
------------------------------
Date: 3 Apr 2003 22:30:46 -0800
From: fumail@freeuk.com (qanda)
Subject: Re: comments within complex structures
Message-Id: <62b4710f.0304032230.2a4b2e3@posting.google.com>
Thanks for the replies.
I've read the Llama from front to back and have started on the Camel
(I think it may take some time!). I have learnt a few things however
I'm still a beginner with lots to learn about Perl.
Yes I always use strict (and I use diagnostics -verbose while
developing). The structure is an example of several much larger
structures I'll be using in a program I'm working on.
I come from a 'C' background and am used to working on very large
applications which contain several programs, each of these programs
can contain thousands of lines of code in hundreds of source files.
It will take some time to 'unlearn' some habits to use perl
'perlistically'.
One thing I'm confused about with Perl is how to handle large scale
developments. Examples in books and the faqs (admitted I've not read
them all) only seem to deal with small programs where it is acceptable
to define and initialise small structures where required - exactly the
same as I would in a small C program, however in a large application I
don't think this would work. Can anyone recommend a good reference
that describes large scale Perl developments, some kind of large scale
Perl design guide.
Sorry, went off on a tangent there, anyway ...
the objective was to comment each sub-structure and field, this would
be done as part of a global initialisation, that is define the
structure then set defaults then assign where required. As perl
automatically defaults to 0 or the empty string I was trying to avoid
using the big arrow, however this obviously creates an invalid hash.
So unless I've missed something I'll settle for the following (showing
only the definition)...
my %complex_set1 = ( # Complex set 1.
fld_set1 => { # Field set 1.
fs1_fld1 =>'', # fs1 field 1.
fs1_fld2 =>'', # fs1 field 2.
},
fld_set2 => { # Field set 2.
fs2_fld1 => '', # fs2 field 1.
fs2_fld2 => '', # fs2 field 2.
},
);
Any feedback, especially about large scale developments would make me
a very happy man :)
Thanks.
------------------------------
Date: 04 Apr 2003 07:15:48 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: cpan
Message-Id: <slrnb8qc93.cm.abigail@alexandra.abigail.nl>
Benjamin Goldberg (goldbb2@earthlink.net) wrote on MMMDIII September
MCMXCIII in <URL:news:3E8CD896.46A0A17A@earthlink.net>:
==
== Those are countries, not continents.
==
== Try "north america", "south america", "europe", "asia", "africa". You
== can also enter "central america" or "oceana", which aren't technically
== continents.
==
== If you are in antarctica, then you're out of luck. :)
Australia is seen as a continent as well since it does have places
with a "land climate".
Abigail
--
perl -le 's[$,][join$,,(split$,,($!=85))[(q[0006143730380126152532042307].
q[41342211132019313505])=~m[..]g]]e and y[yIbp][HJkP] and print'
------------------------------
Date: Fri, 04 Apr 2003 10:05:13 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: cpan
Message-Id: <3e8d58b5.537458094@news.cis.dfn.de>
On Fri, 04 Apr 2003 04:15:15 GMT, "Jürgen Exner"
<jurgenex@hotmail.com> wrote:
>L D Jones wrote:
>> Ian wrote:
>>> "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
>> [...]
>>>> If you answer the "continent" question, it will give you a list of
>>>> servers to select from.
>>> It did not accept America canada quebec or anything else I typed
>> because those are not continents?
>
>America is not a continent? Interesting.
>On the other hand, if the USA is the world already, then America
> must be the universe. So I guess you are right after all.
North America is a continent. America is not.
--
Regards, Helgi Briem
helgi DOT briem AT decode DOT is
------------------------------
Date: 4 Apr 2003 10:20:25 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: cpan
Message-Id: <b6jm99$5dq$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Helgi Briem:
> North America is a continent. America is not.
And South America? I learnt that there are five contintents:
1) Asia
2) America
3) Africa
4) Europe
5) Australia
Following your logic, there would be six?
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Fri, 04 Apr 2003 09:48:05 +0200
From: "Tore Aursand" <tore@aursand.no>
Subject: Re: File more recent than 7 days ?
Message-Id: <pan.2003.04.04.04.10.36.143329@aursand.no>
On Thu, 03 Apr 2003 22:10:33 +0000, Jodyman wrote:
>> foreach ( keys %dates ) {
>> my ($y, $m, $d) = (localtime($dates{$_}))[5,4,3];
>> $year += 1900;
>> $month++;
>> print "$_ was " . sprintf("%4d-%02d-%02d", ($y, $m, $d)) . "\n";
>> }
> Tore, I get the following errors with your example:
> [...]
Aargh. Of course you do. :) I needed to make some of the lines a bit
shorter for my newsreader. Forgot to update the variable names.
The code above should be like this;
foreach ( keys %dates ) {
my ($y, $m, $d) = (localtime($dates{$_}))[5,4,3];
$y += 1900;
$m++;
print "$_ was " . sprintf("%4d-%02d-%02d", ($y, $m, $d)) . "\n";
}
Sorry!
--
Tore Aursand <tore@aursand.no>
"You know the world is going crazy when the best rapper is white, the best
golfer is black, France is accusing US of arrogance and Germany doesn't
want to go to war."
------------------------------
Date: Fri, 04 Apr 2003 09:48:29 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: File more recent than 7 days ?
Message-Id: <3e8d53bb.536184032@news.cis.dfn.de>
On Thu, 03 Apr 2003 16:03:03 GMT, "Jodyman"
<Jodyman@hotmail.com> wrote:
>"Michael Hill" <hillmw@charter.net> wrote in message
>> I have a need to determine if my file is less than 7 days old. Below I
>>find the date on the file, but don't really know how to see it it is
>>less tahn 7 days from today.
<Original message lost, so replying to reply>
There is something strange going on here.
Perl has a -M operator that returns the age of
the file in days. See perldoc -f -X for details.
#!/perl
use warnings;
use strict;
my $dir = '/path/to/dir';
opendir DIR, $dir or die "Cannot readdir $dir:$!\n";
my @files = grep !/\.{1,2}$/,readdir DIR;
for (@files)
{
my $file = "$dir/$_";
my $age = -M $file;
print "$age\t$file\n" if ($age >7);
}
__END__
--
Regards, Helgi Briem
helgi DOT briem AT decode DOT is
------------------------------
Date: Fri, 04 Apr 2003 00:19:33 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Formatting output in columns:
Message-Id: <3E8D15E5.8F040561@earthlink.net>
Tore Aursand wrote:
>
> On Thu, 03 Apr 2003 09:02:24 -0800, evolutionx1945@yahoo.com wrote:
> > I thouroughly searched newsgroups and faq, but I couldn't find the
> > answer to my question
>
> I don't believe you. 'perldoc -q format' gives you _excactly_ what
> you're after.
>
> > I have following array:
> >
> > my @array=(str1, str2, str3, str4, str5, str6, str7,
> > str8, str9, str12 ...)
>
> No you don't.
Actually, ignoring the "..." at the end, which is obviously a
placeholder for other data, this is perfectly valid perl code -- if you
don't have "use strict" in your code.
--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
------------------------------
Date: Fri, 04 Apr 2003 01:05:32 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Formatting output in columns:
Message-Id: <3E8D20AC.D71400B2@earthlink.net>
Tore Aursand wrote:
>
> On Thu, 03 Apr 2003 09:02:24 -0800, evolutionx1945@yahoo.com wrote:
> > I thouroughly searched newsgroups and faq, but I couldn't find the
> > answer to my question
>
> I don't believe you. 'perldoc -q format' gives you _excactly_ what
> you're after.
I didn't see any such answer under 'perldoc -q format'.
Maybe you meant "perldoc perlform" ?
Although write() and 'format NAME = ...' have been part of perl since
nearly the very beginning, nowadays they are a very obscure feature of
perl.
Futhermore, there's nothing there for putting data *vertically* in
columns, as opposed to horizontally.
That is, you can easily get:
a b c
d e f
g h i
j
But there's nothing describing how to get:
a e i
b f
c g
d h
Also, the OP's sample output implied that there should be a total of 4
rows, regardless of how many items there were, which makes the use of
write() rather hard.
The easiest solution is to process a column at a time, adding a bit at a
time to each of 4 rows, then print out the rows.
use strict;
use warnings;
my @items = ("str01" .. "str13", "...");
my $m = -1; $m = length() if $m < length for @items;
$m += 2;
my @rows = ("") x 4;
while( my @col = splice @items, 0, 4 ) {
$rows[$_] .= sprintf "%-${m}s", $col[$_]
for 0 .. $#col;
}
print $_, "\n" for @rows;
--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
------------------------------
Date: Fri, 04 Apr 2003 09:26:08 +0200
From: Alexander Eisenhuth <stacom@stacom-software.de>
Subject: how it works !
Message-Id: <b6jc29$5fjh5$1@ID-155280.news.dfncis.de>
So finally I got what I want. Thanks a lot to Benjamin Goldberg.
---------------- main.pm ----------------------------
use developThreadInPerlWork;
# -- setup a device
$comDev = new CComClass();
# -- wait for return
$a = <STDIN>;
# -- signal, that we want to shutdown
$comDev->exitThread();
# -- wait
sleep 2;
---------------- developThreadInPerlWork.pm
use threads;
use threads::shared; # to share data amoung threads
package CComClass;
sub new {
my ($packageName) = @_;
# do it in the order blessing, sharing
my $comObj = bless {}, $packageName;
threads::shared::share $comObj;
# add here shared data to the hash
# shared can be: scalars and other shared refs
$comObj->{running} = 1;
my $watchThread = create threads \&watchDevice, $comObj;
$comObj->{threadId} = $watchThread->tid;
# remember: shared object lies in another part of memory
#, but are tied togethet
print "CComClass::new comObj >>>",$comObj, "<<<\n";
return $comObj;
}
sub exitThread {
my ($obj) = @_;
$obj->{running} = 0;
}
sub watchDevice {
my ($comObj) = @_;
# remember: shared object lies in another part of memory,
# but are tied together
print "threadLoop comObj >>>",$comObj, "<<<\n";
while ($comObj->{running}) {
print "threadLoop($comObj->{running}) id:$comObj->{threadId}\n";
sleep 1;
};
print "thread finished($comObj->{running})\n";
}
return 1
-----------------------------------------------------
output:
threadLoop comObj >>>CComClass=HASH(0x825df3c)<<<
threadLoop(1) id:
CComClass::new comObj >>>CComClass=HASH(0x813b134)<<<
threadLoop(1) id:1
threadLoop(1) id:1
threadLoop(1) id:1
threadLoop(1) id:1
threadLoop(1) id:1
thread finished(0)
------------------------------
Date: Fri, 4 Apr 2003 16:08:13 +1000
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: how to do psftp from perl on Windows NT
Message-Id: <3e8d2237$0$20135@echo-01.iinet.net.au>
"Anonymous" <lkelias@yahoo.com> wrote in message
news:71b85a88.0304020721.756edaf6@posting.google.com...
> I am trying to call psftp from my Perl script. However, when I run
> the script, nothing happens. When I run the psftp command from the
> command prompt, the ftp works fine. Here's my code:
>
> @stdOut = `psftp -b $ftpFile -bc -be -i $keyFile -batch $serverName`;
>
> Is this the right way to call psftp?
>
> Thanks,
> Leena
Looks basically ok. I know nothing of the 'psftp' command syntax, but you
obviosly do, so that shouldn't be an issue.
I suspect the problem might lie with what is contained in $ftpFile and
$keyFile.
The following options are ok:
$file = '\location\filename';
$file = \\location\\filename;
The following option is definitely not acceptable:
$file = "\location\filename";
I think that forward slashes might also be unacceptable in cmd shell
commands on windows. I know that's the case with commands like 'copy' and
'move', and I expect that it's the same for all such commands.
Try one (or both) of the "acceptable" forms and see how it goes.
Incidentally, afaik, you can use $stdOut instead of @stdOut.
Also, STDOUT has special significance in perl. I would avoid using variable
names that resemble it.
Cheers,
Rob
------------------------------
Date: Fri, 4 Apr 2003 16:49:46 +1000
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: how to do psftp from perl on Windows NT
Message-Id: <3e8d2bf4$0$20127@echo-01.iinet.net.au>
"Sisyphus" <kalinabears@hdc.com.au> wrote in message
news:3e8d2237$0$20135@echo-01.iinet.net.au...
<snip>
> I suspect the problem might lie with what is contained in $ftpFile and
> $keyFile.
$serverName is also a possible source of trouble. You might need to double
up on the backslashes. ie instead of 2 backslashes, use 4.
(Sheesh ...... did I really *need* to add that last sentence :-)
Cheers,
Rob
------------------------------
Date: Fri, 04 Apr 2003 06:51:46 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: line sorting question
Message-Id: <3e8d2b1f.63875375@news.grnet.gr>
On Thu, 03 Apr 2003 23:25:31 GMT, "manj dodda" <dmanjunath@yahoo.com>
wrote:
>I have a list of lines like
>
>VADA tmp4 final temp2
>BAT tmp1 error missing
>ADA tmp2 missing error
>AAA temp2 tmp1 tmp2
>............
>
>It is in a array as
>@myArray
>$myArray[0] = "VADA tmp4 final temp2" ;
>$myArray[1] = "BAT tmp1 error missing" ;
>$myArray[2] =
>
>Now i want to sort the array based on the first element of the
>line.
>What i want is finally
>$myArray[0] = "AAA temp2 tmp1 tmp2" ;
>$myArray[1] = "ADA tmp2 missing error" ;
>$myArray[2] = "BAT tmp1 error missing" ;
>
>How is this done ?.
I think that if you consider the question "What happens if two lines
have the same first element?" it may lead you to a simple solution.
Phil
--
Ignore coming events if you wish to send me e-mail
------------------------------
Date: 4 Apr 2003 00:36:21 -0800
From: ver_for@yahoo.it (Marco)
Subject: Module to parse PDF
Message-Id: <da63f24c.0304040036.122b5581@posting.google.com>
Hi,
I am searching a perl module to parse PDF.
I have seen one called PDF PARSE at this adress but the page indicated
for the download does not exist anymore.
http://search.cpan.org/author/ANTRO/PDF-111/PDF/Parse.pm#Availability
Do you know something else?
Thanks in advance for your answers
Marco
------------------------------
Date: 4 Apr 2003 08:50:02 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Module to parse PDF
Message-Id: <b6jgvq$c1k$1@mamenchi.zrz.TU-Berlin.DE>
Marco <ver_for@yahoo.it> wrote in comp.lang.perl.misc:
> Hi,
>
> I am searching a perl module to parse PDF.
>
> I have seen one called PDF PARSE at this adress but the page indicated
> for the download does not exist anymore.
> http://search.cpan.org/author/ANTRO/PDF-111/PDF/Parse.pm#Availability
http://search.cpan.org/author/ANTRO/PDF-111/ does exist. Use CPAN to
install the module.
> Do you know something else?
A CPAN search for "pdf" shows about a dozen candidates. Take your
pick.
Anno
------------------------------
Date: Fri, 4 Apr 2003 15:20:10 +1000
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: perl problem
Message-Id: <3e8d16f4$0$20133@echo-01.iinet.net.au>
"paul" <paul@noret-pksings.net> wrote in message
news:pan.2003.04.03.15.00.43.333250@noret-pksings.net...
> Perl problem.
>
> I just upgraded to Mandrake 9.1. Because of previous Perl issues I had
> removed all of the Mandrake Perl packages, and downloaded perl from CPAN.
> Not wanting to go through this again I just let Mandrake install Perl.
>
> Now it doesn't run. The following error message even though the Tk::Jpeg
> package is installed.
>
> ./xvocp.pl
> Tk::JPEG object version 800.023 does not match $Tk::JPEG::XS_VERSION
800.024 at
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 249.
> Compilation failed in require at ./xvocp.pl line 95.
> BEGIN failed--compilation aborted at ./xvocp.pl line 95.
>
> Does this mean that the program is looking for an older library or version
> that it's not finding?
>
> And how does one go about fixing such a thing?
>
> Thanks in advance everyone.
>
> paul
>
As I understand it, when Tk::JPEG is being built it looks for the version of
Tk and saves note of it.
Then, whenever you 'use Tk::JPEG;' it checks that the saved value matches
$Tk::VERSION.
I don't know why this is done, btw.
It should only be an issue if:
1) You update Tk without rebuilding Tk::JPEG
2) Tk::JPEG is built on one machine, then run on another machine (having a
different version of Tk.)
The fix I employed was to go into Tk/JPEG.pm and change the line:
$XS_VERSION = $Tk::VERSION;
to
$XS_VERSION = 800.023;
That seems to work quite nicely - hopefully nothing gets broken :-)
Cheers,
Rob
------------------------------
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.
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 4814
***************************************