[11905] in Perl-Users-Digest
Perl-Users Digest, Issue: 5505 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 28 12:07:17 1999
Date: Wed, 28 Apr 99 09:00:25 -0700
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, 28 Apr 1999 Volume: 8 Number: 5505
Today's topics:
Re: "learning perl" does not seem to be written well (Abigail)
BerkeleyDb/GDBM under solaris <dataadm@elfi2.rz.ruhr-uni-bochum.de>
Re: complaints about debugger <emschwar@rmi.net>
Re: Confused about s/// example in the Camel book <ludlow@us.ibm.com>
DBD for Oracle8 <rreidy@skyconnect.com>
Global variable? (How to) <olivier.maas@at-lci.com>
how to setup cgi (mk)
Re: how to setup cgi <tim@timbury.com>
How to use Net::FTP in perl?? <losteven@yahoo.com>
Re: How to use Net::FTP in perl?? <Tony.Curtis@vcpc.univie.ac.at>
Re: How to use Net::FTP in perl?? <eyounes@aol.com>
Re: How to use Net::FTP in perl?? marzoram@my-dejanews.com
Re: How to use Net::FTP in perl?? <crb@highpoint.co.uk>
Re: Impythonating PERL? (Gabor)
Many hashes with same keys <rclark@adc.metrica.co.uk>
Re: Multiline comments in perl <jeromeo@atrieva.com>
Re: newbie: Replace \n with <br>\n (Larry Rosler)
Re: PERL & Y2K (Abigail)
Re: PERL & Y2K <cantrela@agcs.com>
Re: PERL & Y2K (Bart Lateur)
Re: Problem with DBV::CSV <eyounes@aol.com>
Re: Problem with DBV::CSV <dgris@moiraine.dimensional.com>
Re: Seeking Perl course info <c4jgurney@my-dejanews.com>
Re: Simple if syntax Question <ludlow@us.ibm.com>
Re: Simple one? <jdf@pobox.com>
Re: String conversions (a different angle!?) <jdf@pobox.com>
TCP socket problem <ashilt01@sprintspectrum.com>
Re: What does this error message mean? (Abigail)
Re: what's wrong with $x = $y or "" (Abigail)
Re: what's wrong with $x = $y or "" <dgris@moiraine.dimensional.com>
Re: what's wrong with $x = $y or "" (Bart Lateur)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Apr 1999 14:58:31 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <7g77mn$4f7$2@client2.news.psi.net>
Uri Guttman (uri@sysarch.com) wrote on MMLXVI September MCMXCIII in
<URL:news:x7vheh8hic.fsf@home.sysarch.com>:
;;
;; i call it bind as it binds the value on the left to the m//, s/// or
;; tr/// on the right. whethere it gets modified or not depends on the
;; rigth side only.
Uhm, not quite. Tell me, does $foo in: $foo =~ s/foo/bar/; get
modified or not? I believe it depends on $foo as well....
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Wed, 28 Apr 1999 16:51:59 +0100
From: Sebastian Ahrens <dataadm@elfi2.rz.ruhr-uni-bochum.de>
Subject: BerkeleyDb/GDBM under solaris
Message-Id: <37272E9F.56DA84E1@elfi2.rz.ruhr-uni-bochum.de>
Hi,
I4ve got a strange problem with these two DBM4s here on my solaris-box.
I wrote a script to store things in either Berkeley or GNU DB via a tied
hash and everything worked fine under Linux, but if I run this script on
our solaris-box it "crashes".
The BerkeleyDB version is not able to reopen a database, i.e. you can
only create one and write to it but not reopen it for reading. Then I
switched over to GDBM and here I can write into it again (the filesize
is growing), but if I reopen it, nothing is shown up.
The problem is that I don not get any error messages - leave away my on
die() or carp() one. Has anyone an idea how to spot out the problem?
P.S.: BTW, the same programm is using tcp-socket communication;
sometimes I can4t restart it, because perl keeps on moaning about an
undefined value (= the socket-handler) if I wait for a while it works
again. The problem is really weird and reminds me of mod_perl-scripts
with no use strict in it if you know what I mean. Is there a way of
freeing sockets/ports explicitly?
thanks for any help
-Sebastian-
------------------------------
Date: 28 Apr 1999 09:15:41 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: complaints about debugger
Message-Id: <xkfpv4olqsi.fsf@valdemar.col.hp.com>
Peter Brooker <ra5589@email.sps.mot.com> writes:
> Consider the simple program below:
>
> #!/usr/local/bin/perl -dw
That's good. Where's "use strict;"?
> $aa = join('',"00",$hash_table);
> print "$aa";
>
> Note that $hash_table is not defined. When I run the program I get
<snip>
> Nothing tells me that $hash_table is undefined.
That's because you didn't "use strict;". If you don't use strict.pm,
then Perl will not warn you about undeclared variables. You can't expect
Perl to "know" that you wanted it to complain about undefined variables
if'n you don't tell it to.
-=Eric
------------------------------
Date: Wed, 28 Apr 1999 09:04:52 -0500
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Confused about s/// example in the Camel book
Message-Id: <37271584.FC07CB53@us.ibm.com>
Brian Peisley wrote:
>
> I am confused about an example of s/// on page 74 of the Camel book (2nd
> ed.).
>
> The example is as follows:
>
> #expand tabs to 8-column spacing
> s/\t+/' ' x (length($&)*8) - length($`)%8/e;
>
> I understand what this is doing, I just don't understand why
> length($`)%8 is being subtracted. I wrote the simple script below to see
[snip]
If you just had a line like:
\t\t\t\t\t\tfoo\n
then it wouldn't matter if you subtracted the length of the prematch out
or not, but consider this line:
0123\t4567\n
You don't want the \t to become literally 8 spaces, you want to account
for the text that came before it. So, in this case you need to subtract
spaces for the 4 characters that appear before the \t.
(1 tab x 8 spaces/tab) - 4 = 4 spaces
0123----4567\n
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: Wed, 28 Apr 1999 08:40:31 -0600
From: "Ron Reidy" <rreidy@skyconnect.com>
Subject: DBD for Oracle8
Message-Id: <7g76lb$492$1@news1.rmi.net>
Hi,
I am trying desperately to get DBD/DBI installed.
Here is my config:
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
Platform:
osname=dec_osf, osvers=4.0, archname=alpha-dec_osf
uname='osf1 <computer_name> v4.0 878 alpha '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O4', gccversion=
cppflags='-std -ieee -D_INTRINSICS -DLANGUAGE_C'
ccflags ='-std -fprm d -ieee -D_INTRINSICS -DLANGUAGE_C'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
intsize=4, longsize=8, ptrsize=8, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='ld', ldflags =''
libpth=/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /var/shlib
libs=-ldbm -ldb -lm
libc=/usr/shlib/libc.so, so=so, useshrplib=true, libperl=libperl.so
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
cdlflags=' -Wl,-rpath,/usr/local/lib/perl5/5.00503/alpha-dec_osf/CORE'
cccdlflags=' ', lddlflags='-shared -expect_unresolved "*" -O4 -msym -s'
Characteristics of this binary (from libperl):
Built under dec_osf
Compiled at Apr 26 1999 10:45:48
@INC:
/usr/local/lib/perl5/5.00503/alpha-dec_osf
/usr/local/lib/perl5/5.00503
/usr/local/lib/perl5/site_perl/5.005/alpha-dec_osf
/usr/local/lib/perl5/site_perl/5.005
.
I have already compiled and installed DBI v 1.06
Here is the output of "perl Makefile.PL -p"
Using DBI 1.06 installed in
/usr/local/lib/perl5/site_perl/5.005/alpha-dec_osf/auto/DBI
Configuring DBD::Oracle ...
>>> Remember to actually *READ* the README file!
Especially if you have any problems.
Using Oracle in /usr/oracle8/product
8.0.5.0.0 ORACLE Common RDBMS Libraries and Utilities
8.0.5.0.0 ORACLE PL/SQL Libraries
8.0.5.0.0 ORACLE Common Precomp Libraries
8.0.5.1.0 PL/SQL
8.0.5.1.0 Oracle8 (RDBMS and PL/SQL)
8.0.5.1.0 Precomp
8.0.5.1.0 Pro*C/C++
Found /usr/oracle8/product/precomp/demo/proc/demo_proc.mk
Found /usr/oracle8/product/rdbms/demo/demo_rdbms.mk
Using /usr/oracle8/product/precomp/demo/proc/demo_proc.mk
Reading /usr/oracle8/product/precomp/demo/proc/demo_proc.mk.
Reading /usr/oracle8/product/precomp/lib/env_precomp.mk.
Deleting ORA_NLS = $(ORACLE_HOME)/ocommon/nls/admin/data/
because it is not already set in the environment
and it can cause ORA-01019 errors.
Deleting ORA_NLS33 = $(ORACLE_HOME)/ocommon/nls/admin/data/
because it is not already set in the environment
and it can cause ORA-01019 errors.
Found header files in rdbms/demo.
System: perl5.00503 osf1 skysrv.skyconnect.com v4.0 878 alpha
Compiler: cc -O4 -std -fprm d -ieee -D_INTRINSICS -DLANGUAGE_C
Linker: /usr/bin/ld
Oracle makefiles would have used these values but we override them:
CC: cc
CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(QACCFLAGS)
$(PFLAGS)\
$(SHARED_CFLAG) $(USRFLAGS)
[$(GFLAG) -O4 -fast -fp_reorder -U_FASTMATH -O4 -fast -fp_reorder -U_FASTMAT
H $(GEMC_FLAGS) -std1 -DOSF1 -DA_OSF -Wf,-readonly_strings -D_INTRINSICS
$(QACCFLAGS) -I. -I/usr/oracle8/product/precomp/public -I/usr/oracle8/produc
t/rdbms/public -I/usr/oracle8/product/rdbms/demo -I/usr/oracle8/product/plsq
l/public -I/usr/oracle8/product/network/public $(LPFLAGS) $(SHARED_CFLAG)
$(USRFLAGS)]
CLIBS: $(TTLIBS_QA) $(LDLIBS)
Evaluating `cat $(LIBHOME)sysliblist`
expanded `cat /usr/oracle8/product/lib/sysliblist`
returned '-lexc -lmld -lrt -laio -lm'
[$(TTLIBS_QA) $(EXPDLIBS) -lexc -lmld -lrt -laio -lm
$(EXSYSLIBS) -lm $(USRLIBS)]
LDFLAGS: $(LDOPTIMIZE) $(SHARED_FLAG) -o $@
$(PRODUCT_LIBHOME) -L$(LIBHOME) $(NO_STRIP_EXE?:-s)
[$(CDEBUG?-O4 -fast -fp_reorder -U_FASTMATH:-O3) -o
$@ -L$(LIBHOME) -s]
Linking with -lclntsh [from $(PROLDLIBS)]
Warning: By default new modules are installed into your 'site_lib'
directories. Since site_lib directories come after the normal library
directories you must delete any old DBD::Oracle files and directories from
your 'privlib' and 'archlib' directories and their auto subdirectories.
Using DBD::Oracle 0.59.
Using DBI 1.06 installed in
/usr/local/lib/perl5/site_perl/5.005/alpha-dec_osf/auto/DBI
Writing Makefile for DBD::Oracle
Below is the output of the make command:
mkdir blib
mkdir blib/lib
mkdir blib/lib/DBD
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/DBD
mkdir blib/arch/auto/DBD/Oracle
mkdir blib/lib/auto
mkdir blib/lib/auto/DBD
mkdir blib/lib/auto/DBD/Oracle
mkdir blib/man1
mkdir blib/man3
cp Oraperl.pm blib/lib/Oraperl.pm
cp Oracle.pm blib/lib/DBD/Oracle.pm
cp oraperl.ph blib/lib/oraperl.ph
/usr/local/bin/perl -p -e "s/~DRIVER~/Oracle/g" <
/usr/local/lib/perl5/site_perl/5.005/alpha-dec_osf/auto/DBI/Driver.xst >
Oracle.xsi
/usr/local/bin/perl -I/usr/local/lib/perl5/5.00503/alpha-dec_osf -I/usr/loca
l/lib/perl5/5.00503 /usr/local/lib/perl5/5.00503/ExtUtils/xsubpp -typemap
/usr/local/lib/perl5/5.00503/ExtUtils/typemap Oracle.xs >xstmp.c && mv
xstmp.c Oracle.c
cc -c -I. -I/usr/oracle8/product/precomp/public -I/usr/oracle8/product/rdbms
/public -I/usr/oracle8/product/rdbms/demo -I/usr/oracle8/product/plsql/publi
c -I/usr/oracle8/product/network/public -I/usr/oracle8/product/rdbms/demo -I
/usr/oracle8/product/rdbms/demo -I/usr/local/lib/perl5/site_perl/5.005/alpha
-dec_osf/auto/DBI -std -fprm
eee -D_INTRINSICS -DLANGUAGE_C -O4 -DVERSION=\"0.59\" -DXS_VERSION=\"0.
59\" -I/usr/local/lib/perl5/5.00503/alpha-dec_osf/CORE Oracle.c
cc -c -I. -I/usr/oracle8/product/precomp/public -I/usr/oracle8/product/rdbms
/public -I/usr/oracle8/product/rdbms/demo -I/usr/oracle8/product/plsql/publi
c -I/usr/oracle8/product/network/public -I/usr/oracle8/product/rdbms/demo -I
/usr/oracle8/product/rdbms/demo -I/usr/local/lib/perl5/site_perl/5.005/alpha
-dec_osf/auto/DBI -std -fprm
eee -D_INTRINSICS -DLANGUAGE_C -O4 -DVERSION=\"0.59\" -DXS_VERSION=\"0.
59\" -I/usr/local/lib/perl5/5.00503/alpha-dec_osf/CORE dbdimp.c
cc -c -I. -I/usr/oracle8/product/precomp/public -I/usr/oracle8/product/rdbms
/public -I/usr/oracle8/product/rdbms/demo -I/usr/oracle8/product/plsql/publi
c -I/usr/oracle8/product/network/public -I/usr/oracle8/product/rdbms/demo -I
/usr/oracle8/product/rdbms/demo -I/usr/local/lib/perl5/site_perl/5.005/alpha
-dec_osf/auto/DBI -std -fprm
eee -D_INTRINSICS -DLANGUAGE_C -O4 -DVERSION=\"0.59\" -DXS_VERSION=\"0.
59\" -I/usr/local/lib/perl5/5.00503/alpha-dec_osf/CORE oci7.c
cc -c -I. -I/usr/oracle8/product/precomp/public -I/usr/oracle8/product/rdbms
/public -I/usr/oracle8/product/rdbms/demo -I/usr/oracle8/product/plsql/publi
c -I/usr/oracle8/product/network/public -I/usr/oracle8/product/rdbms/demo -I
/usr/oracle8/product/rdbms/demo -I/usr/local/lib/perl5/site_perl/5.005/alpha
-dec_osf/auto/DBI -std -fprm
eee -D_INTRINSICS -DLANGUAGE_C -O4 -DVERSION=\"0.59\" -DXS_VERSION=\"0.
59\" -I/usr/local/lib/perl5/5.00503/alpha-dec_osf/CORE oci8.c
Running Mkbootstrap for DBD::Oracle ()
chmod 644 Oracle.bs
ar cr tmp.a Oracle.o dbdimp.o oci7.o oci8.o
: tmp.a
LD_RUN_PATH="/usr/oracle8/product/lib" ld -o
blib/arch/auto/DBD/Oracle/Oracle.so -shared -expect_unresolved
"*" -O4 -msym -s -all tmp.a -none -L/usr/oracle8/product/lib/ -lclntsh
chmod 755 blib/arch/auto/DBD/Oracle/Oracle.so
cp Oracle.bs blib/arch/auto/DBD/Oracle/Oracle.bs
chmod 644 blib/arch/auto/DBD/Oracle/Oracle.bs
mkdir blib/script
cp ora_explain blib/script/ora_explain
/usr/local/bin/perl -I/usr/local/lib/perl5/5.00503/alpha-dec_osf -I/usr/loca
l/lib/perl5/5.00503 -MExtUtils::MakeMaker -e "MY->fixin(shift)"
blib/script/ora_explain
Manifying blib/man3/DBD::Oraperl.3
Manifying blib/man3/DBD::Oracle.3
Manifying blib/man1/ora_explain.1
Below is the output of "make test"
PERL_DL_NONLAZY=1
/usr/local/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.00503/al
pha-dec_osf -I/usr/local/lib/perl5/5.00503 -e 'use Test::Harness
qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/base..............ok
t/general...........dubious
Test returned status 0 (wstat 139, 0x8b)
Number found where operator expected at (eval 400) line 1, near ")0"
(Missing operator before 0?)
Number found where operator expected at (eval 401) line 1, near ")1"
(Missing operator before 1?)
Number found where operator expected at (eval 402) line 1, near ")2"
(Missing operator before 2?)
Number found where operator expected at (eval 403) line 1, near ")3"
(Missing operator before 3?)
test program seems to have generated a core
after all the subtests completed successfully
t/plsql.............ok
Failed Test Status Wstat Total Fail Failed List of failed
----------------------------------------------------------------------------
---
t/general.t 0 139 4 0 0.00% ??
Failed 1/3 test scripts, 66.67% okay. 0/58 subtests failed, 100.00% okay.
*** Exit 2
Stop.
Can anyone give me some hint as to what is wrong? Am I using the incorrect
DBI/DBD combination? Right now I will take anything that works.
Thanks for your help.
Ron Reidy
------------------------------
Date: Wed, 28 Apr 1999 17:43:05 +0200
From: Olivier Maas <olivier.maas@at-lci.com>
Subject: Global variable? (How to)
Message-Id: <37272C88.6A7A5445@at-lci.com>
Hello
I am looking for a way to keep in "mind" specific parameters for a
surfer on my site (the equivalent of asp Session("toto")=1234
(making the variable toto with its "1234" value accessible during the
whole session, from any other asp))
I initialize the values in the beginning, modify them and use them...
any one knows how to do this with CGI or perl? thanks 4 your help
olivier
please also reply to maas@ensae.fr
------------------------------
Date: Wed, 28 Apr 1999 15:32:05 GMT
From: mk@best.com (mk)
Subject: how to setup cgi
Message-Id: <372728d9.2179775@nntp1.ba.best.com>
Hi everybody,
Please help me on this matter, I try to run perl script on my system,
it works with pl files, but when I run cgi, it just displays the
content of the files, any info will help, tia.
------------------------------
Date: Wed, 28 Apr 1999 11:55:13 -0400
From: "Tim" <tim@timbury.com>
Subject: Re: how to setup cgi
Message-Id: <925314910.658.96@news.remarQ.com>
In order to get help with this, you might want to provide a little more
information. What system (Linux, BSDi, WinNT, etc.), what web
server (Apache, IIS, PWS, Netscape, etc.) and which version?
Are you the sysadmin with root/admin access or is it on an ISP's
system? Is the script directory set up with execute privileges for
the web-user-id? Is the mime type set? I'd can't really be much
help without more info.
Tim K.
mk wrote in message <372728d9.2179775@nntp1.ba.best.com>...
>Hi everybody,
>
>Please help me on this matter, I try to run perl script on my system,
>it works with pl files, but when I run cgi, it just displays the
>content of the files, any info will help, tia.
>
>
------------------------------
Date: 28 Apr 1999 10:08:50 -0500
From: "steve" <losteven@yahoo.com>
Subject: How to use Net::FTP in perl??
Message-Id: <37271672@discussions>
Hi,
I need some info on how to use net::FTP??
Any sample codes or explaination is helpful.
Thanks
--Posted from EarthWeb Discussions. http://discussions.earthweb.com
------------------------------
Date: 28 Apr 1999 16:42:44 +0200
From: Tony Curtis <Tony.Curtis@vcpc.univie.ac.at>
Subject: Re: How to use Net::FTP in perl??
Message-Id: <83n1zs24d7.fsf@vcpc.univie.ac.at>
Re: How to use Net::FTP in perl??, steve
<losteven@yahoo.com> said:
steve> I need some info on how to use net::FTP??
steve> Any sample codes or explaination is helpful.
Almost the very first thing in
perldoc Net::FTP
is an example of its use.
tony
------------------------------
Date: Wed, 28 Apr 1999 17:04:51 +0200
From: "Ysteric's" <eyounes@aol.com>
Subject: Re: How to use Net::FTP in perl??
Message-Id: <7g77mh$p6i@news.vtcom.fr>
use Net::FTP;
print "connexion...\n";
$ftp = Net::FTP->new($url, Timeout => 30) or die("$Url : $!\n");
$ftp->login($username,$passwd) or die("Id $Login/$Passwd : $!");
$ftp->type("binary") or die("ftp [type] erreur : $!\n");
$ftp->cwd($Directory) or die("ftp [cwd] erreur : $!\n");
$ftp->put($fic); # ... to send !
$ftp->quit();
steve a icrit dans le message <37271672@discussions>...
>
>Hi,
>
>I need some info on how to use net::FTP??
>Any sample codes or explaination is helpful.
>
>Thanks
>
>--Posted from EarthWeb Discussions. http://discussions.earthweb.com
>
------------------------------
Date: Wed, 28 Apr 1999 15:13:30 GMT
From: marzoram@my-dejanews.com
Subject: Re: How to use Net::FTP in perl??
Message-Id: <7g78im$7un$1@nnrp1.dejanews.com>
Hello Steven,
this is a real simple one I wrote for a mini tutorial. The "dies" are in
German as the guys it was for were German. Check out the documentation or
ftp.pm if everthing else fails.
Hope it helps,
Marco
use Net::FTP;
$server="ftp.server.com";
$username="anonymous";
$password="perl@tekromancer.com";
$datei="datei.txt"; $ftp=Net::FTP->new($server, Debug=>0) || die "Keine
Verbindung mit $server.\n";
$ftp->login($user, $password) || die "Fehler beim einloggen.\n";
$ftp->get($datei) || die "Fehler beim herunterladen von $datei auf
$server.\n";
$ftp->quit() || die "Fehler beim ausloggen von $server.\n\n";
In article <37271672@discussions>,
"steve" <losteven@yahoo.com> wrote:
>
> Hi,
>
> I need some info on how to use net::FTP??
> Any sample codes or explaination is helpful.
>
> Thanks
>
> --Posted from EarthWeb Discussions. http://discussions.earthweb.com
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 28 Apr 1999 15:30:43 GMT
From: "Craig R. Belcham" <crb@highpoint.co.uk>
Subject: Re: How to use Net::FTP in perl??
Message-Id: <37271C24.8950751@highpoint.co.uk>
steve wrote:
>
> Hi,
>
> I need some info on how to use net::FTP??
> Any sample codes or explaination is helpful.
>
The simplest method...
use Net::FTP;
$ftp = Net::FTP->new("myhost");
$ftp->login("foo","fooword");
$ftp->cwd("/somewhere/foo");
$ftp->put("bar");
$ftp->quit;
Regards
Craig
--
Craig R. Belcham. Internet Systems Management Consultant.
Email: crb@highpoint.co.uk, http://www.highpoint.co.uk/~crb
"The greatest trick the devil ever pulled was convincing the
world that he didn't exist" -- Kevin Spacey, Usual Suspects.
------------------------------
Date: Wed, 28 Apr 1999 14:11:37 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: Impythonating PERL?
Message-Id: <slrn7ie5op.n42.gabor@vnode.vmunix.com>
In comp.lang.perl.misc, Avery Andrews <andrews@Turing.Stanford.EDU> wrote :
# It seems to me that it would be cool to be able to use python-style
# whitespace-formatting when you wanted it, writing something like:
If you want to program in Python, why don't you program in Python?
This kind of idiocy is just that, idiocy.
# ---
# use impythonator;
#
# foreach $thing in @list:
# print "$dict{$thing}\n"
#
# no impythonator;
# ---
#
# Thereby loosing some of the brackets, parentheses & semicolons that
# I find mostly to be a annoyance. Has anyone thought of trying to do
# something like this?
#
# Avery.Andrews@anu.edu.au
#
#
------------------------------
Date: Wed, 28 Apr 1999 16:29:02 +0100
From: "Rob Clark" <rclark@adc.metrica.co.uk>
Subject: Many hashes with same keys
Message-Id: <925313418.17735.0.nnrp-04.c246a7ae@news.demon.co.uk>
Hello,
Can anyone tell me whether Perl does any storage optimisation on many hashes
that share the same set of keys?
Many thanks
Rob
------------------------------
Date: Wed, 28 Apr 1999 07:37:06 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: Multiline comments in perl
Message-Id: <37271D12.10A62FD@atrieva.com>
Philip 'Yes, that's my address' Newton wrote:
>
> Jerome O'Neil wrote:
> > David Cassell wrote:
> > > Jerome O'Neil wrote:
> > > > Ye Gods! Why has thou forsaken C-style comments?!!!
> > > ############################################################
> > > # I put stuff in boxes anyway, so readers can see it. #
> > > ############################################################
> > /************************
> > Ook!
> > *************************/
> /*********************************************************************
> * some people like it *
> * other people do it because of some team's "programming standards" *
> *********************************************************************/
/*
Extra Ook!
*/
// And then some!
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Wed, 28 Apr 1999 07:33:36 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: newbie: Replace \n with <br>\n
Message-Id: <MPG.1190bc19e0d06e49989967@nntp.hpl.hp.com>
In article <37270d30@news.uk.ibm.net> on Wed, 28 Apr 1999 15:32:21
+0200, Vincent Vanbiervliet <vvb@ibm.net> says...
> Larry Rosler <lr@hpl.hp.com> wrote in message
> news:MPG.118fcbca99e8f06e989958@nntp.hpl.hp.com...
> > In article <7g56tg$fu1@news.dns.microsoft.com> on Tue, 27 Apr 1999
> > 16:27:52 -0700, Scott Oseychik <scott@simsbury.com> says...
...
> > > #!c:\perl\bin -w
> >
> > Good. Next add 'use strict;'
> Am I missing something here, oris c:\perl\bin a good program?
The backslashes should clue you that this is a Windows/DOS invocation,
which in most circumstances doesn't use the apparent path to find the
perl executable. If the apparent path contains the string 'perl', the
perl implementation recognizes the flags, such as '-w'.
In my code, I use
#!/usr/local/bin/perl -w
for source portability to my Unix boxes.
<BIG SNIP> of irrelevant quote of the rest of the article.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 28 Apr 1999 15:03:11 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: PERL & Y2K
Message-Id: <7g77vf$4f7$3@client2.news.psi.net>
Sam Holden (sholden@pgrad.cs.usyd.edu.au) wrote on MMLXVI September
MCMXCIII in <URL:news:slrn7idoke.42r.sholden@pgrad.cs.usyd.edu.au>:
^^ On Wed, 28 Apr 1999 10:24:58 +0100, David Evans <davevans69@hormail.com> wrote:
^^ >I'm doing some research into PERL and the Year 2000 and was wondering if
^^ >anyone knows of an existing product that scans PERL script for Y2K
^^ >compliance?
^^
^^ If you don't know how to read documentation, or even th recent posts that
^^ have Y2K in there subject then you won't be able to fix anything it
^^ find anyway. So what does it matter.
I think you're confused. Are you saying there's nothing to be fixed in:
printf "The year is 19%d\n", (localtime) [5];
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
------------------------------
Date: Wed, 28 Apr 1999 08:23:27 -0700
From: Andy Cantrell <cantrela@agcs.com>
To: David Evans <davevans69@hormail.com>
Subject: Re: PERL & Y2K
Message-Id: <372727EF.C1456E87@agcs.com>
David Evans wrote:
>
> I'm doing some research into PERL and the Year 2000 and was
> wondering if anyone knows of an existing product that scans
> PERL script for Y2K compliance?
Consider the following code snippet:
$year = (localtime(time))[5] ;
On my machine today, this will return "99". A year from
now it will return "100". Two years, "101", etc. It is
up to me (the programmer) to take care of how the information
is used.
Tom Christiansen has a Y2K write-up somewhere on the web,
but I'm unable to find it right now. It puts a lot of things
into perspective.
As for products to scan for compliance, I'd suggest using
"grep -r time *", a good editor, and your favorite source
of caffeine.
--
Andy Cantrell
AG Communication Systems
E-Mail: cantrela@agcs.com
Office (AZ) (623) 582-7495 (Voice mail)
Office (WI) (414) 249-0215
Modem (WI) (414) 249-0239
------------------------------
Date: Wed, 28 Apr 1999 15:42:13 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: PERL & Y2K
Message-Id: <37282b62.10950781@news.skynet.be>
David Evans wrote:
>I'm doing some research into PERL and the Year 2000
Really? So how come you still dare ask this question? We're REALLY
getting fed up with this question!!!! "FAQ" is an understatement!
>and was wondering if
>anyone knows of an existing product that scans PERL script for Y2K
>compliance?
You can't. You can try and find suspicious statements in Perl scripts,
yes. Anything containing the literal strings 'localtime(' or '19$' is
suspect. But Y2K compliance should be tested by programmers who
understand exactly what the code does.
Bart.
------------------------------
Date: Wed, 28 Apr 1999 17:11:20 +0200
From: "Ysteric's" <eyounes@aol.com>
Subject: Re: Problem with DBV::CSV
Message-Id: <7g782m$p6o@news.vtcom.fr>
>
>my $dbh = DBI->connect("DBI:CSV:")
> or die ('cant connect');
> $dbh->{'csv_tables'}->{'user'} = {
> 'eol' => "\n",
> 'sep_char' => ",",
> 'quote_char' => "",
> 'escape_char' => "",
> 'file' => 'g:\agni\user',
^^^^^^^^^^^^^^
I think your problem is here ! Try "g:\\agni\\user" (this error is a
classical)
Eric - From FRANCE
------------------------------
Date: 28 Apr 1999 09:12:00 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Problem with DBV::CSV
Message-Id: <m3r9p43hkv.fsf@moiraine.dimensional.com>
"Ysteric's" <eyounes@aol.com> writes:
> > 'file' => 'g:\agni\user',
> ^^^^^^^^^^^^^^
> I think your problem is here ! Try "g:\\agni\\user" (this error is a
> classical)
Backwhacks don't need to be escaped in single quoted strings.
Please don't post incorrect answers.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Wed, 28 Apr 1999 15:22:53 GMT
From: Jeremy Gurney <c4jgurney@my-dejanews.com>
Subject: Re: Seeking Perl course info
Message-Id: <7g7947$8hn$1@nnrp1.dejanews.com>
In article <FAwFp9.2oJ@news2.new-york.net>,
"Not So Newbie" <onecor@hotmail.com> wrote:
> Am working through the Llama book, with the Camel book;
> Does anyone know of any decent courses in Perl that are
> given in the greater NYC area?
No but I know of one on-line.
http://www.free-ed.net/fr03/lfc/course%20030207_01/index.html
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 28 Apr 1999 09:28:48 -0500
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Simple if syntax Question
Message-Id: <37271B20.DEA869D1@us.ibm.com>
morti_cne@my-dejanews.com wrote:
>
> Can anyone tell me why this perl code snippet does not work? TEAM is a
> dropdown box on a form, I've double checked the spelling. It always skips the
> first if and accepts the second. The files component.db and system.db are
> simple text files with appropriate permissions assigned. I admit that my perl
> coding is a bit rusty, so any help you can provide is GREATly appreciated.
>
> if ($FORM{'TEAM'} = 'Component') {
perldoc perlop
Read all about the differences between '=', '==', and 'eq'.
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: 28 Apr 1999 10:16:01 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: Andy Cantrell <cantrela@agcs.com>
Subject: Re: Simple one?
Message-Id: <m3ogk8u8ym.fsf@joshua.panix.com>
Andy Cantrell <cantrela@agcs.com> writes:
> A bye
> B bye
Looks like a bug. I have reported it using perlbug.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 28 Apr 1999 10:22:02 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: ralawrence@my-dejanews.com
Subject: Re: String conversions (a different angle!?)
Message-Id: <m3lnfcu8ol.fsf@joshua.panix.com>
ralawrence@my-dejanews.com writes:
> "hello there!" -> "hello+there%44" (or whatever ! is in hex)
NAME
URI::Escape - Escape and unescape unsafe characters
SYNOPSIS
use URI::Escape;
$safe = uri_escape("10% is enough\n");
$verysafe = uri_escape("foo", "\0-\377");
$str = uri_unescape($safe);
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Wed, 28 Apr 1999 14:41:31 GMT
From: Aaron Shilts <ashilt01@sprintspectrum.com>
Subject: TCP socket problem
Message-Id: <7g76mq$673$1@nnrp1.dejanews.com>
I am currently writing a Perl script (5.003) that monitors a flat text file.
When a new line is added, the script notices the file size change and runs the
&send_calls subroutine to send the new line of text out the socket.
The problem is that nothing is sent out the socket unless there is a carriage
return in the text file. If two lines are added to the file it will happily
send the first line, but will not send the second until a third line is added
or a newline is appended... We've tryed adding the "\n" just about everywhere
in the code and the socket won't touch it.
Here is the subroutine that sends the contents of $line out the socket:
---------------------------------------------
sub send_calls {
open (CALLDATA, "<$call_info");
@calls = <CALLDATA>;
$total_calls = @calls;
print ("There is a total of $total_calls calls currently\n");
$clientaddr = pack ("Sna4x8", 2, 0, $rawclient);
$serveraddr = pack ("Sna4x8", 2, $portnum, $rawserver);
while ($call_processed < $total_calls) {
socket (SOCKET,2,1, $prototype) || die ("Cannot create socket");
bind (SOCKET, $clientaddr) || die ("Cannot bind socket");
connect (SOCKET, $serveraddr);
$line = "@calls[$call_processed]";
print ("This is what we're sending: $line");
printf SOCKET ("$line\n");
$call_processed++;
}
close CALLDATA;
$size_sent = -s $call_info;
&check_file;
}
---------------------------------------------
Can anyone provide some feedback?
--
Aaron Shilts
Sprint Corporate Security
ashilt01@sprintspectrum.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 28 Apr 1999 15:10:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: What does this error message mean?
Message-Id: <7g78ce$4f7$4@client2.news.psi.net>
Blair Kingsland (blairk@istar.ca) wrote on MMLXVI September MCMXCIII in
<URL:news:pdyV2.1156$Ev1.746050@NewsRead.Toronto.iSTAR.net>:
,,
,, Value of <HANDLE> construct can be "0"; test with defined() at
,, /usr/local/etc/httpd/htdocs/tigron/cgi-bin/glossary.pl line 65535.
,,
,, I can't find an explanation of this message anywhere.
Did you check perldiag?
,, What does "line
,, 65535" mean? The program file is only 25 lines long.
That's a known bug in some older version of Perl. Upgrade.
Abigail
--
perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'
------------------------------
Date: 28 Apr 1999 14:56:10 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: what's wrong with $x = $y or ""
Message-Id: <7g77ia$4f7$1@client2.news.psi.net>
that's my address' Newton (nospam.newton@gmx.net) wrote on MMLXVI
September MCMXCIII in <URL:news:3726E92B.F259BE35@gmx.net>:
// Abigail wrote:
// >
// > Now if only we had the ?? operator....
//
// What would this operator do? Logical ?: or something?
EXPR1 ?? EXPR2 would be EXPR1 if EXPR1 is defined, EXPR2 otherwise.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
------------------------------
Date: 28 Apr 1999 09:02:10 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: what's wrong with $x = $y or ""
Message-Id: <m3wvyw3i19.fsf@moiraine.dimensional.com>
"Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net> writes:
> Abigail wrote:
> >
> > Now if only we had the ?? operator....
>
> What would this operator do? Logical ?: or something?
Go search the p5p archives, this is not a fight we want
to have on clpm.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Wed, 28 Apr 1999 15:51:26 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: what's wrong with $x = $y or ""
Message-Id: <37272e10.11636794@news.skynet.be>
Abigail wrote:
>// > Now if only we had the ?? operator....
>
>EXPR1 ?? EXPR2 would be EXPR1 if EXPR1 is defined, EXPR2 otherwise.
Ah, good. I thought you ment a one-time pattern match with the empty
pattern.
Bart.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5505
**************************************