[32133] in Perl-Users-Digest
Perl-Users Digest, Issue: 3398 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 2 14:09:29 2011
Date: Thu, 2 Jun 2011 11:09:10 -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, 2 Jun 2011 Volume: 11 Number: 3398
Today's topics:
Re: execute ssh command on many hosts serial or paralle <tzz@lifelogs.com>
Re: execute ssh command on many hosts serial or paralle <nospam.gravitalsun@hotmail.com.nospam>
how to do absolute redirect in perl <anuj.bhambhani@gmail.com>
Re: how to do absolute redirect in perl <sherm.pendley@gmail.com>
How to keep SQL statement preparation and executing cod <mh+usenetspam1118@zugschl.us>
Re: How to keep SQL statement preparation and executing (Randal L. Schwartz)
Re: How to keep SQL statement preparation and executing <sherm.pendley@gmail.com>
Re: How to keep SQL statement preparation and executing <rweikusat@mssgmbh.com>
Re: How to keep SQL statement preparation and executing <rweikusat@mssgmbh.com>
Re: How to keep SQL statement preparation and executing <hjp-usenet2@hjp.at>
Re: Trouble installing HTML::Template module on Solaris <nospam.gravitalsun@hotmail.com.nospam>
Re: Trouble installing HTML::Template module on Solaris <jurgenex@hotmail.com>
Re: Trouble installing HTML::Template module on Solaris <smallpond@juno.com>
Re: Trouble installing HTML::Template module on Solaris <laredotornado@zipmail.com>
Re: Trouble installing HTML::Template module on Solaris <uri@StemSystems.com>
Re: Trouble installing HTML::Template module on Solaris <nospam.gravitalsun@hotmail.com.nospam>
variable-length strings <Uno@example.invalid>
Re: variable-length strings <cartercc@gmail.com>
Re: variable-length strings <nospam.gravitalsun@hotmail.com.nospam>
Re: variable-length strings <hjp-usenet2@hjp.at>
Re: variable-length strings <hjp-usenet2@hjp.at>
Re: variable-length strings <Uno@example.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 01 Jun 2011 08:06:24 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: execute ssh command on many hosts serial or parallel
Message-Id: <8762opwvjj.fsf@lifelogs.com>
On Tue, 31 May 2011 22:50:13 +0300 George Mpouras <nospam.gravitalsun@hotmail.com.nospam> wrote:
GM> I make it for my convenience, maybe someone will find it also useful
The code is not badly written, you have options and help and so on...
But have you tried pssh (parallel-ssh)? I think it does almost exactly
what your sshexec does, plus a few more options.
Ted
------------------------------
Date: Wed, 1 Jun 2011 17:33:23 +0300
From: "George Mpouras" <nospam.gravitalsun@hotmail.com.nospam>
Subject: Re: execute ssh command on many hosts serial or parallel
Message-Id: <is5iif$1uak$1@news.ntua.gr>
"Ted Zlatanov" <tzz@lifelogs.com> wrote in message
news:8762opwvjj.fsf@lifelogs.com...
> On Tue, 31 May 2011 22:50:13 +0300 George Mpouras
> <nospam.gravitalsun@hotmail.com.nospam> wrote:
>
> GM> I make it for my convenience, maybe someone will find it also useful
>
> The code is not badly written, you have options and help and so on...
> But have you tried pssh (parallel-ssh)? I think it does almost exactly
> what your sshexec does, plus a few more options.
>
> Ted
_hit ; did not know of pssh , thanks !!!
------------------------------
Date: Thu, 2 Jun 2011 02:44:40 -0700 (PDT)
From: anujbhambhani <anuj.bhambhani@gmail.com>
Subject: how to do absolute redirect in perl
Message-Id: <9fe85468-ec01-40ef-b84d-3c7af7318301@16g2000yqy.googlegroups.com>
$Request->redirect( url => $Std->url("/gp/errors/404"),type =>
"permanent");
works for me
but
$Request->redirect( url => $Std->url("http://www.google.com",
{absolute => 1});
does not work someone please help
------------------------------
Date: Thu, 02 Jun 2011 08:52:54 -0400
From: Sherm Pendley <sherm.pendley@gmail.com>
Subject: Re: how to do absolute redirect in perl
Message-Id: <m2k4d475uh.fsf@sherm.shermpendley.com>
anujbhambhani <anuj.bhambhani@gmail.com> writes:
> $Request->redirect( url => $Std->url("/gp/errors/404"),type =>
> "permanent");
> works for me
> but
> $Request->redirect( url => $Std->url("http://www.google.com",
> {absolute => 1});
> does not work someone please help
First you'll need to help us help you - define "does not work." Do you
get any errors in your web server's log? Does the browser blow up and
reformat the user's drive? In short, what actually does happen that's
different from what you expected to happen?
sherm--
------------------------------
Date: Wed, 01 Jun 2011 19:03:23 +0200
From: Marc Haber <mh+usenetspam1118@zugschl.us>
Subject: How to keep SQL statement preparation and executing code together
Message-Id: <is5rcs$dnr$1@news1.tnib.de>
Hi,
I have a perl program of a few hundred lines which uses about fifteen
SQL statements in a main loop. To avoid preparing() these statements
over and over again, I have written my prepare() statements outside
the loop which has caused the SQL and perl code which is obviously
quite interspersed with each other to be hundreds of lines apart in
the actual code.
I'd like to get them together again, for example, like this (obviously
uncompiled) example:
|#!/usr/bin/perl
|
|# some lines of init code, command line processing etc
|
|my $dsn=3D"DBI:mysql:database=3D" ...
|my $dbh=3DDBI->connect($dsn ...
|
|package step1
|
|my $sth;
|
|sub prepare {
| $sth=3D$dbh->prepare("...") or die;
|}
|
|sub do_something {
| $sth->execute() or die;
| while( my $data =3D $sth->fetchrow ) {
| # process things
| }
|}
|
|package step2
|
|my $sth;
|
|sub prepare {
| $sth=3D$dbh->prepare("...") or die;
|}
|
|sub do_something {
| $sth->execute() or die;
| while( my $data =3D $sth->fetchrow ) {
| # process things
| }
|}
|
|package main
|
|step1::prepare();
|step2::prepare();
|
|while(1) {
| step1::do_something;
| step2::do_something;
|}
Will this work? Is there a better way to do things?
While we're at it, it is a possible error to define a new "package"
and to forget calling its "prepare()" method. Using BEGIN inside the
packages is not an option since you need to be connected to the
database to prepare() a statement, and to connect you need to have
parsed the commamd line. Can I somehow iterate over all packages that
have names starting with "step"?
I know that my approach is not very perlish and would like to be
enlightened.
Greetings
Marc
--=20
-------------------------------------- !! No courtesy copies, please !! =
-----
Marc Haber | " Questions are the | Mailadresse im =
Header
Mannheim, Germany | Beginning of Wisdom " | =
http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 =
72739834
------------------------------
Date: Wed, 01 Jun 2011 11:58:42 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: How to keep SQL statement preparation and executing code together
Message-Id: <86tyc9js4d.fsf@red.stonehenge.com>
>>>>> "Marc" == Marc Haber <mh+usenetspam1118@zugschl.us> writes:
Marc> I have a perl program of a few hundred lines which uses about fifteen
Marc> SQL statements in a main loop. To avoid preparing() these statements
Marc> over and over again, I have written my prepare() statements outside
Marc> the loop which has caused the SQL and perl code which is obviously
Marc> quite interspersed with each other to be hundreds of lines apart in
Marc> the actual code.
For a client, I built a wrapper that mixed DBIx::Connect and
SQL::Interpolate together, and it was pretty awesome. I consider
SQL::Interpolate a whole lot more sane than placeholders, and will be
using it on every future assignment that I can squeeze it in.
Oddly enough, I found out about *both* of them at YAPC-NA last year.
print "Just another Perl hacker,"; # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion
------------------------------
Date: Wed, 01 Jun 2011 18:57:32 -0400
From: Sherm Pendley <sherm.pendley@gmail.com>
Subject: Re: How to keep SQL statement preparation and executing code together
Message-Id: <m2oc2hb1nn.fsf@sherm.shermpendley.com>
merlyn@stonehenge.com (Randal L. Schwartz) writes:
> Oddly enough, I found out about *both* of them at YAPC-NA last year.
Sigh. I'm really going to have to attend one of those...
sherm--
------------------------------
Date: Thu, 02 Jun 2011 15:22:14 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: How to keep SQL statement preparation and executing code together
Message-Id: <874o48wbxl.fsf@sapphire.mobileactivedefense.com>
Marc Haber <mh+usenetspam1118@zugschl.us> writes:
> I have a perl program of a few hundred lines which uses about fifteen
> SQL statements in a main loop. To avoid preparing() these statements
> over and over again, I have written my prepare() statements outside
> the loop which has caused the SQL and perl code which is obviously
> quite interspersed with each other to be hundreds of lines apart in
> the actual code.
>
> I'd like to get them together again, for example, like this (obviously
> uncompiled) example:
> |#!/usr/bin/perl
> |
> |# some lines of init code, command line processing etc
> |
> |my $dsn="DBI:mysql:database=" ...
> |my $dbh=DBI->connect($dsn ...
> |
> |package step1
> |
> |my $sth;
> |
> |sub prepare {
> | $sth=$dbh->prepare("...") or die;
> |}
> |
> |sub do_something {
> | $sth->execute() or die;
> | while( my $data = $sth->fetchrow ) {
> | # process things
> | }
> |}
[...]
> |package main
> |
> |step1::prepare();
> |step2::prepare();
> |
> |while(1) {
> | step1::do_something;
> | step2::do_something;
> |}
>
> Will this work?
IMO, yes.
> Is there a better way to do things?
[...]
> Can I somehow iterate over all packages that have names starting
> with "step"?
A pretty obvious idea would be
sub do_something {
$sth = $dbh->prepare(...) or die unless $sth;
$sth->execute(...)
.
.
.
}
Somewhat neater (and avoiding 'almost always true' unless $sth):
my $sth;
sub really_do_something()
{
$sth->execute(...) or die;
.
.
.
}
sub do_something()
{
$sth = $dbh->prepare(...) or die;
*do_something = \&really_do_something;
&really_do_something;
}
The code included below prints the names of the symbol tables of
all packages residing in 'main' (the root of the namespace):
/::$/ and print("$_\n") for (keys(%::));
Provided a variable named $a contains the name of an existing package
and you want to get at a sub named b in this package, the statement
$c = *{${$a}{b}}{CODE};
puts the corresponding coderef into $c (and the rountine can then be
executed as $c->()).
NB: There may be easier methods to do this and there are certainly
'CPAN modules' (I don't know of) available to accomplish something
similar.
------------------------------
Date: Thu, 02 Jun 2011 16:26:00 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: How to keep SQL statement preparation and executing code together
Message-Id: <87wrh4uuev.fsf@sapphire.mobileactivedefense.com>
Rainer Weikusat <rweikusat@mssgmbh.com> writes:
[...]
> Provided a variable named $a contains the name of an existing
> package
s/existing package/symbol table of an existing package/ :-(
------------------------------
Date: Thu, 2 Jun 2011 18:16:54 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: How to keep SQL statement preparation and executing code together
Message-Id: <slrniufdrm.sqi.hjp-usenet2@hrunkner.hjp.at>
On 2011-06-01 17:03, Marc Haber <mh+usenetspam1118@zugschl.us> wrote:
> I have a perl program of a few hundred lines which uses about fifteen
> SQL statements in a main loop. To avoid preparing() these statements
> over and over again, I have written my prepare() statements outside
> the loop which has caused the SQL and perl code which is obviously
> quite interspersed with each other to be hundreds of lines apart in
> the actual code.
>
> I'd like to get them together again,
prepare_cached may help.
hp
------------------------------
Date: Wed, 1 Jun 2011 09:35:53 +0300
From: "George Mpouras" <nospam.gravitalsun@hotmail.com.nospam>
Subject: Re: Trouble installing HTML::Template module on Solaris
Message-Id: <is4mis$1gd3$1@news.ntua.gr>
hmm ... do you have any free space ?
------------------------------
Date: Wed, 01 Jun 2011 05:49:38 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Trouble installing HTML::Template module on Solaris
Message-Id: <a7dcu6l5p5arkreb6rkgpo1n3o1igk2k9j@4ax.com>
"George Mpouras" <nospam.gravitalsun@hotmail.com.nospam> wrote:
>hmm ... do you have any free space ?
What kind of space? For what? Why are you asking?
Hint: it is costumary to quote sufficient context such that your posting
makes sense on its own.
jue
------------------------------
Date: Wed, 1 Jun 2011 10:34:15 -0700 (PDT)
From: smallpond <smallpond@juno.com>
Subject: Re: Trouble installing HTML::Template module on Solaris
Message-Id: <be9003b1-ea99-455f-b0d0-90a5fbff5cca@hg8g2000vbb.googlegroups.com>
On May 31, 12:02=A0pm, laredotornado <laredotorn...@zipmail.com> wrote:
> Hi,
>
> I'm using Solaris 10, Perl 5.8.4. =A0I'm trying to install the
> HTML::Template module. =A0I downloaded the tar.gz file from CPAN,
> unzipped/untarred, ran "perl Makefile.PL", "make", and "make test"
> just fine. =A0But when I went to run "make install", got bombed with
>
> # make install
> mkdir /usr/perl5/site_perl/5.8.4/HTML: Read-only file system at /usr/
> perl5/5.8.4/lib/ExtUtils/Install.pm line 176
> *** Error code 255
> The following command caused the error:
> /usr/bin/perl -MExtUtils::Install -e 'install({@ARGV}, '\''0'\'', 0,
> '\''0'\'');' \
> =A0 =A0 =A0 =A0 read /usr/perl5/site_perl/5.8.4/i86pc-solaris-64int/auto/=
HTML/
> Template/.packlist \
> =A0 =A0 =A0 =A0 write /usr/perl5/site_perl/5.8.4/i86pc-solaris-64int/auto=
/HTML/
> Template/.packlist \
> =A0 =A0 =A0 =A0 blib/lib /usr/perl5/site_perl/5.8.4 \
> =A0 =A0 =A0 =A0 blib/arch /usr/perl5/site_perl/5.8.4/i86pc-solaris-64int =
\
> =A0 =A0 =A0 =A0 blib/bin /usr/perl5/5.8.4/bin \
> =A0 =A0 =A0 =A0 blib/script /usr/perl5/5.8.4/bin \
> =A0 =A0 =A0 =A0 blib/man1 /usr/perl5/5.8.4/man/man1 \
> =A0 =A0 =A0 =A0 blib/man3 /usr/perl5/5.8.4/man/man3
> make: Fatal error: Command failed for target `pure_site_install'
>
> I'm running as root and have switched perms on all the files to 755.
> Any ideas what I'm doing wrong or know of an easier way to install
> HTML::Template on Solaris Perl? =A0Thanks, - Dave
Changing the module permissions to 755 would be an odd thing to do.
I hope you mean the directories.
It's possible that your Solaris is using ACLs. Check with getfacl.
Otherwise, try creating a file:
touch /usr/perl5/site_perl/5.8.4/foo
------------------------------
Date: Wed, 1 Jun 2011 12:17:09 -0700 (PDT)
From: laredotornado <laredotornado@zipmail.com>
Subject: Re: Trouble installing HTML::Template module on Solaris
Message-Id: <317158d1-b95d-44be-b5e9-e78a51725b05@p13g2000yqh.googlegroups.com>
On Jun 1, 12:34=A0pm, smallpond <smallp...@juno.com> wrote:
> On May 31, 12:02=A0pm,laredotornado<laredotorn...@zipmail.com> wrote:
>
>
>
> > Hi,
>
> > I'm using Solaris 10, Perl 5.8.4. =A0I'm trying to install the
> > HTML::Template module. =A0I downloaded the tar.gz file from CPAN,
> > unzipped/untarred, ran "perl Makefile.PL", "make", and "make test"
> > just fine. =A0But when I went to run "make install", got bombed with
>
> > # make install
> > mkdir /usr/perl5/site_perl/5.8.4/HTML: Read-only file system at /usr/
> > perl5/5.8.4/lib/ExtUtils/Install.pm line 176
> > *** Error code 255
> > The following command caused the error:
> > /usr/bin/perl -MExtUtils::Install -e 'install({@ARGV}, '\''0'\'', 0,
> > '\''0'\'');' \
> > =A0 =A0 =A0 =A0 read /usr/perl5/site_perl/5.8.4/i86pc-solaris-64int/aut=
o/HTML/
> > Template/.packlist \
> > =A0 =A0 =A0 =A0 write /usr/perl5/site_perl/5.8.4/i86pc-solaris-64int/au=
to/HTML/
> > Template/.packlist \
> > =A0 =A0 =A0 =A0 blib/lib /usr/perl5/site_perl/5.8.4 \
> > =A0 =A0 =A0 =A0 blib/arch /usr/perl5/site_perl/5.8.4/i86pc-solaris-64in=
t \
> > =A0 =A0 =A0 =A0 blib/bin /usr/perl5/5.8.4/bin \
> > =A0 =A0 =A0 =A0 blib/script /usr/perl5/5.8.4/bin \
> > =A0 =A0 =A0 =A0 blib/man1 /usr/perl5/5.8.4/man/man1 \
> > =A0 =A0 =A0 =A0 blib/man3 /usr/perl5/5.8.4/man/man3
> > make: Fatal error: Command failed for target `pure_site_install'
>
> > I'm running as root and have switched perms on all the files to 755.
> > Any ideas what I'm doing wrong or know of an easier way to install
> > HTML::Template on Solaris Perl? =A0Thanks, - Dave
>
> Changing the module permissions to 755 would be an odd thing to do.
> I hope you mean the directories.
> It's possible that your Solaris is using ACLs. =A0Check with getfacl.
>
> Otherwise, try creating a file:
> touch /usr/perl5/site_perl/5.8.4/foo
I will have to look up more what getfacl is, but per your second
suggestion, I get a permission denied error, even though perms look
good. Here is what happened ...
root@cm-build{!}# touch /usr/perl5/site_perl/5.8.4/foo
touch: cannot create /usr/perl5/site_perl/5.8.4/foo: Read-only file
system
root@cm-build{!}# ls /usr/perl5/site_perl/5.8.4
i86pc-solaris-64int
root@cm-build{!}# ls -al /usr/perl5/site_perl/5.8.4
total 9
drwxr-xr-x 3 root bin 3 Dec 20 14:41 .
drwxr-xr-x 4 root bin 4 Dec 20 14:52 ..
drwxr-xr-x 2 root bin 2 Dec 20 14:41 i86pc-
solaris-64int
- Dave
------------------------------
Date: Wed, 01 Jun 2011 15:26:01 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Trouble installing HTML::Template module on Solaris
Message-Id: <87d3ixuzee.fsf@quad.sysarch.com>
>>>>> "l" == laredotornado <laredotornado@zipmail.com> writes:
l> root@cm-build{!}# touch /usr/perl5/site_perl/5.8.4/foo
l> touch: cannot create /usr/perl5/site_perl/5.8.4/foo: Read-only file
l> system
well, that is obviously your problem. that file system was mounted
read-only so you can create files or install modules on it. as for why,
you would have to investigate it. you could reboot and it could then
mount read/write. or you could remount it read/write (some systems can
do that).
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: Wed, 01 Jun 2011 23:19:36 +0300
From: George Mpouras <nospam.gravitalsun@hotmail.com.nospam>
Subject: Re: Trouble installing HTML::Template module on Solaris
Message-Id: <is66so$10qk$1@news.ntua.gr>
On 01/06/2011 03:49 μμ, Jürgen Exner wrote:
> "George Mpouras"<nospam.gravitalsun@hotmail.com.nospam> wrote:
>> hmm ... do you have any free space ?
>
> What kind of space? For what? Why are you asking?
>
> Hint: it is costumary to quote sufficient context such that your posting
> makes sense on its own.
>
> jue
I've seen similar messages on a system where simple there was not free
space at all .
------------------------------
Date: Wed, 01 Jun 2011 03:36:43 -0600
From: Uno <Uno@example.invalid>
Subject: variable-length strings
Message-Id: <94mfhcFngqU1@mid.individual.net>
Hello from the land of enchantment,
I begin a crosspost herewith that I hope to make relevant to the
newsgroups listed. It will take some time to get to there from here, but
the ambition is to make it relatively lean with the topicality of each
ng addressed and respected. I am OP; if that's a problem for you, I'd
like you to move on graciously.
It begins with perl, which I am currently reading. So that's gonna be
q1). There will be more questions in the same format, and I would like
to make you aware of that as you consider an editorial choice. OP
suggests editorial choices that derive from the questions, that is, are
trimmed with respect to q.
$ pwd
/media/KINGSTON
$ perl marni3.pl
death
$ cat marni3.pl
#!/usr/bin/perl -w
use Net::FTP;
my $domain = 'www.merrillpjensen.com';
my $username = 'u61210220';
my $password = '';
my $file = 'jac1.avi';
$ftp = Net::FTP->new($domain) or die "Can't connect: $@\n";
$ftp->login($username, $password) or die "Couldn't login\n";
$ftp->cwd('/wsb6326330301/resources/') or die "death $@\n";
$ftp->put($file) or die "put failed ", $ftp->message;
$
q1) Why did I die?
I had a very successful day. I could show it, except that I'm unable to
communicate well with the internet. This is usually the case when I try
to extend my ubuntu capability. I have something that hangs that
wouldn't under a more firmly-established identity.
q2) [I imagine that I have a distinct question for each listed ng] In
testing, I've noticed a difference in file sizes between what I upload
with ftp and what I download. The files are 60 megs, conceived by
apple, and I can't show what I'm saying until I get ftp working.
There's no way I can look at these files with a hex editor and my eyes.
Doesn't unix have a built-in way to compare them?
q3)
a) Is there some newsgroup out there that considers web design, and not
the kind where you have to give them money for their opinion. If I paid
$40 for usenet advice, it might be worse than what a hooker on central
might do; it's given by people who want to make $40 on usenet.
alt.web.css.embedded.object.rus ?
q4) and then the good people of c.l.c. It looks like your tone has
come a long way. Down the road I'd like to consider how to pass
information which is perl input to fortran output using the iso c binding.
Cheers,
--
Uno
------------------------------
Date: Wed, 1 Jun 2011 07:13:50 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: variable-length strings
Message-Id: <e3cdb103-3274-402d-b599-5815d93e0fb9@r27g2000prr.googlegroups.com>
On Jun 1, 5:36=A0am, Uno <U...@example.invalid> wrote:
> q1) =A0Why did I die?
The simplest place to start is with your command line ftp program. If
you can connect and transfer files with your command line ftp, then IN
THEORY you should be able to put the same series of commands in a
batch file (i.e., a Perl script) and run them. If you can do that,
then you have all the functionality you neet./
> q2) [I imagine that I have a distinct question for each listed ng] =A0In
> There's no way I can look at these files with a hex editor and my eyes.
> =A0 Doesn't unix have a built-in way to compare them?
On Unix/Linux, use diff. If you are comfortable with vi/vim, it also
has a diff capability.
> q3)
>
> a) =A0Is there some newsgroup out there that considers web design, and no=
t
> the kind where you have to give them money for their opinion. =A0If I pai=
d
> $40 for usenet advice, it might be worse than what a hooker on central
> might do; it's given by people who want to make $40 on usenet.
Sorry, but you need to rephrase your question, as this does not make
sense to me.
> q4) =A0and then the good people of c.l.c. =A0It looks like your tone has
> come a long way. =A0Down the road I'd like to consider how to pass
> information which is perl input to fortran output using the iso c binding=
.
Data is data. You can use Perl to manipulate and format data. In fact,
PERL (in the opinion of some, anyway) stands for Practical Extraction
and Reporting Language.
CC.
------------------------------
Date: Wed, 1 Jun 2011 17:01:43 +0300
From: "George Mpouras" <nospam.gravitalsun@hotmail.com.nospam>
Subject: Re: variable-length strings
Message-Id: <is5ic7$1td7$1@news.ntua.gr>
try to change the connection line to
$ftp = Net::FTP->new($domain, Debug=>1, Passive=>1)
------------------------------
Date: Thu, 2 Jun 2011 15:33:49 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: variable-length strings
Message-Id: <slrniuf4a6.dhq.hjp-usenet2@hrunkner.hjp.at>
["Followup-To:" header set to comp.lang.perl.misc.]
On 2011-06-01 09:36, Uno <Uno@example.invalid> wrote:
> $ perl marni3.pl
> death
> $ cat marni3.pl
> #!/usr/bin/perl -w
> use Net::FTP;
> my $domain = 'www.merrillpjensen.com';
> my $username = 'u61210220';
> my $password = '';
> my $file = 'jac1.avi';
>
>
> $ftp = Net::FTP->new($domain) or die "Can't connect: $@\n";
> $ftp->login($username, $password) or die "Couldn't login\n";
>
> $ftp->cwd('/wsb6326330301/resources/') or die "death $@\n";
> $ftp->put($file) or die "put failed ", $ftp->message;
>
> $
>
> q1) Why did I die?
Simple answer: Because you couldn't change the current working directory
to '/wsb6326330301/resources/'.
As to why that didn't work, the Net::FTP module would tell you if you
asked it. Read the synopsis of perldoc Net::FTP for a few examples on
printing proper error messages.
hp
------------------------------
Date: Thu, 2 Jun 2011 15:44:32 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: variable-length strings
Message-Id: <slrniuf4u1.dhq.hjp-usenet2@hrunkner.hjp.at>
["Followup-To:" header set to comp.unix.shell.]
On 2011-06-01 09:36, Uno <Uno@example.invalid> wrote:
> q2) [I imagine that I have a distinct question for each listed ng] In
> testing, I've noticed a difference in file sizes between what I upload
> with ftp and what I download. The files are 60 megs, conceived by
> apple, and I can't show what I'm saying until I get ftp working.
>
> There's no way I can look at these files with a hex editor and my eyes.
> Doesn't unix have a built-in way to compare them?
There's cmp, but it only shows you where the first difference is.
There's diff, but it is intended for text files.
You could convert both files with od or hd and diff those. But that
doesn't work well.
I think Emacs has a binary-diff mode, but I'm from the vi fraction.
So, back in the mid 1990's I wrote bdiff (binary diff):
http://www.hjp.at/programs/bdiff/
I guess I should dust it off, write a man-page and try to get it added
to some linux distribution. But I very rarely need it myself.
hp
------------------------------
Date: Thu, 02 Jun 2011 10:54:47 -0600
From: Uno <Uno@example.invalid>
Subject: Re: variable-length strings
Message-Id: <94ptioF1gaU1@mid.individual.net>
On 06/01/2011 08:13 AM, ccc31807 wrote:
> On Jun 1, 5:36 am, Uno<U...@example.invalid> wrote:
>> q1) Why did I die?
>
> The simplest place to start is with your command line ftp program. If
> you can connect and transfer files with your command line ftp, then IN
> THEORY you should be able to put the same series of commands in a
> batch file (i.e., a Perl script) and run them. If you can do that,
> then you have all the functionality you neet./
I needed a fresh day and fresh eyes, and t set Debug=> 2 to see that the
wsb "web site builder" number was wrong. That's a separate directory
that my host uses for when they build the website. I want to adios this
thing, so I called them, and they have you change an administrative
setting so that a browser will be directed to the index.html in the root
menu as opposed to in the wsb folder.
So now this /wsb.../ thing is a relic for me to play with and destroy.
Why didn't this work:
[sorry can only paste as quotation:]
> $ perl marni5.pl
> Net::FTP>>> Net::FTP(2.77)
> Net::FTP>>> Exporter(5.63)
> Net::FTP>>> Net::Cmd(2.29)
> Net::FTP>>> IO::Socket::INET(1.31)
> Net::FTP>>> IO::Socket(1.31)
> Net::FTP>>> IO::Handle(1.28)
> Net::FTP=GLOB(0xa07a7d8)<<< 220 FTP Server ready.
> Net::FTP=GLOB(0xa07a7d8)>>> USER u61210220
> Net::FTP=GLOB(0xa07a7d8)<<< 331 Password required for u61210220
> Net::FTP=GLOB(0xa07a7d8)>>> PASS ....
> Net::FTP=GLOB(0xa07a7d8)<<< 230 User u61210220 logged in
> Net::FTP=GLOB(0xa07a7d8)>>> RMD /wsb6121022001/
> Net::FTP=GLOB(0xa07a7d8)<<< 550 /wsb6121022001/: Directory not empty
> Net::FTP=GLOB(0xa07a7d8)>>> PORT 192,168,0,64,142,193
> Net::FTP=GLOB(0xa07a7d8)<<< 200 PORT command successful
> Net::FTP=GLOB(0xa07a7d8)>>> NLST /wsb6121022001/
> Net::FTP=GLOB(0xa07a7d8)<<< 150 Opening ASCII mode data connection for file list
> Net::FTP=GLOB(0xa07a7d8)<<< 226 Transfer complete
> Net::FTP=GLOB(0xa07a7d8)>>> DELE /wsb6121022001/.
> Net::FTP=GLOB(0xa07a7d8)<<< 550 /wsb6121022001/.: Is a directory
> Net::FTP=GLOB(0xa07a7d8)>>> RMD /wsb6121022001/.
> Net::FTP=GLOB(0xa07a7d8)<<< 550 /wsb6121022001/.: Directory not empty
> Net::FTP=GLOB(0xa07a7d8)>>> PORT 192,168,0,64,186,213
> Net::FTP=GLOB(0xa07a7d8)<<< 200 PORT command successful
> Net::FTP=GLOB(0xa07a7d8)>>> NLST /wsb6121022001/.
> Net::FTP=GLOB(0xa07a7d8)<<< 150 Opening ASCII mode data connection for file list
> Net::FTP=GLOB(0xa07a7d8)<<< 226 Transfer complete
...
it just keeps on telling me Directory not empty
> ^C
> $ cat marni5.pl
> #!/usr/bin/perl -w
> use Net::FTP;
> my $domain = 'www.merrillpjensen.com';
> my $username = 'u61210220';
> my $password = '';
>
> $ftp = Net::FTP->new($domain, Debug => 2) or die "Can't connect: $@\n";
> $ftp->login($username, $password) or die "Couldn't login\n";
>
> my $recurse = 1;
> $ftp->rmdir('/wsb6121022001/', $recurse);
> #$ftp->cwd('/wsb6121022001/') or die "death $@\n";
>
> my @file = $ftp->ls();
>
> foreach $file (@file){
> print "$file\n";
> }
> $
Cpan says that RECURSE has to be true, and I thought a good guess for
"true" in a syntax that is a child of C would be one.
>
>> q2) [I imagine that I have a distinct question for each listed ng] In
>> There's no way I can look at these files with a hex editor and my eyes.
>> Doesn't unix have a built-in way to compare them?
>
> On Unix/Linux, use diff. If you are comfortable with vi/vim, it also
> has a diff capability.
Thx, ccc, I'll do that. Here's what's vexing me right now.
http://www.merrillpjensen.com/images/jac1.bmp
The only difference between these files, is that the smaller one went on
a round on the internet. It was sent up like this:
> #!/usr/bin/perl -w
> use strict;
> use Net::FTP;
> my $domain = 'www.merrillpjensen.com';
> my $username = 'u61210220';
> my $password = '';
> my $file = 'jac1.bmp';
> my $dir = '/images/';
>
> my $ftp = Net::FTP->new($domain, Debug =>2) or die "Can't connect: $@\n";
> $ftp->login($username, $password) or die "Couldn't login\n";
> $ftp->mkdir($dir) or die "death: $@\n";
> $ftp->cwd($dir) or die "death: $@\n";
> $ftp->put($file) or die "put failed ", $ftp->message;
And downloaded using google chrome. Is this typical, because if my
experience is, then I don't really see how any large file gets
transferred faithfully.
Gotta go pull down some legal tender. Adios.
--
Uno
------------------------------
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 3398
***************************************