[16564] in Perl-Users-Digest
Perl-Users Digest, Issue: 3976 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 10 14:05:35 2000
Date: Thu, 10 Aug 2000 11:05:22 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <965930721-v9-i3976@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 10 Aug 2000 Volume: 9 Number: 3976
Today's topics:
Re: "more" with perl (Decklin Foster)
[Q]s: sizeof in perl, ioctl.ph... <kj0@mailcity.com>
Best way to copy Dirs containing both binary and text d linga@my-deja.com
Re: Best way to copy Dirs containing both binary and te <bcaligari@shipreg.com>
Re: Cant figure this out. <uri@sysarch.com>
Re: Cant figure this out. (Anno Siegel)
Re: Cant figure this out. <psychoNOpsSPAM@pcpatches.com.invalid>
Re: CGI / Pearl Interfacing w/ Dos Program Question (Jon S.)
Re: CGI/Pearl Interfacing w/ DOS Program Question <bart.lateur@skynet.be>
Check existence of a remote file!!! <JohnP@townpages.co.uk>
Re: Check existence of a remote file!!! <bcaligari@shipreg.com>
Re: Example in FAQ (Tim)
Re: Exporting variables from packages <daniel@blackomega.com>
File handle and symbolic link <yidao.cai@uth.tmc.edu>
form replies in HTML <jtalbain@nospam.kimochi3d.com>
get rid of the empty space in the string <sduan@newbridge.com>
Re: get rid of the empty space in the string (Andreas Kahari)
Re: get rid of the empty space in the string (Tim)
Re: help for Insert rows into table by DBI (Jon S.)
Help with PPM <sg@loralskynet.com>
RE: HELP!! with Install on HP-UX.. where to start!?? btaneja@my-deja.com
Re: HELP!! with Install on HP-UX.. where to start!?? <russ_jones@rac.ray.com>
integers <verence1964@hotmail.com>
Re: Large-File Reformatting Problem (Regexp gurus, et a <bart.lateur@skynet.be>
Re: Large-File Reformatting Problem (Regexp gurus, et a (Greg Bacon)
Re: London £30-35K Perl Programmers Required <red_orc@my-deja.com>
Re: London £30-35K Perl Programmers Required <bcaligari@shipreg.com>
Re: London =?iso-8859-1?Q?=A330=2D35K?= Perl Programmer <care227@attglobal.net>
LWP::UserAgent & login <lliu00@my-deja.com>
modify environment variables ? videmos@my-deja.com
Re: modify environment variables ? (Andreas Kahari)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 10 Aug 2000 16:12:25 GMT
From: decklin+usenet@red-bean.com (Decklin Foster)
Subject: Re: "more" with perl
Message-Id: <JvAk5.15479$f_5.76493@news1.rdc1.ct.home.com>
jason <elephant@squirrelgroup.com> writes:
> just write a loop that outputs a line at a time .. but have it pause
> after X lines where X = the number of lines in a screen (get it from the
> environment - or guess it - or ask the user for it)
And Nick Condon <nickco3@yahoo.co.uk> writes:
> open (STDOUT, "| more") or warn "Can't run more: $!\n";
Remember not to to any of these without checking that -t STDOUT && -t
STDIN. If you have to do them at all, that is.
--
There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)
------------------------------
Date: 10 Aug 2000 12:30:44 -0400
From: kj0 <kj0@mailcity.com>
Subject: [Q]s: sizeof in perl, ioctl.ph...
Message-Id: <8mulbk$khv$1@panix3.panix.com>
I have:
$x = pack "L", 1;
I want to follow it with:
syswrite OUT, $x, $sizeof_x;
But I know of no easy, portable way of finding out what $sizeof_x
should be. (Obviously, this is a gap in my knowledge, because it is
just not possible that Perl would lack the functionality of C's
sizeof.)
Someone please tell me how one finds $sizeof_x (portably).
On a related note, when I try the one-liner
perl -e 'require "sys/ioctl.ph"; $size = pack("L", 0); ioctl(FH, FIONREAD(), $size; $size = unpack("L", $size))'
(from The Perl Cookbook)
I get the cryptic error
Undefined subroutine &main::_POSIX_C_SOURCE called at (eval 123) line 1.
How do I fix this?
Many thanks in advance!
KJ
------------------------------
Date: Thu, 10 Aug 2000 15:16:58 GMT
From: linga@my-deja.com
Subject: Best way to copy Dirs containing both binary and text data
Message-Id: <8muh13$nhi$1@nnrp1.deja.com>
Hi, my script needs to copy directories from a network share onto my
box. The contents of the directories are a mix of both binary and text
data. I was thinking about using File::Recurse as such:
recurse {copy($_, dir2)} dir1
but the File::Copy command doesn't check for the format of the data. I
was considering modifying the File::Copy module so that it would test
the filehandle which would switch the filehandle to binary if
necessary, but I was concerned about portability. How should I
approach this? Is the use of File::Copy::copydir preferable? This is
my modification to the File::Copy module...any suggestions regarding
these? Thanks for your help,
Sanjay
File::Copy v.2.0
Running NT 4.0
ActiveState 616
Perl 5.6.0
Modifications occur ~ line 78
## begin modification ##
stat (FROM);
if (-B _) { #tests for binary mode
binmode (TO); #sets FHs to binary if necessary
binmode (FROM);
}
## end modification...continue w/ regular mod. ##
$buf = '';
while(defined($r = read(FROM,$buf,$size)) && $r > 0) {
if (syswrite (TO,$buf,$r) != $r) {
goto fail_inner;
}
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 10 Aug 2000 19:38:49 +0200
From: "Brendon Caligari" <bcaligari@shipreg.com>
Subject: Re: Best way to copy Dirs containing both binary and text data
Message-Id: <8muomp$hdt$1@news.news-service.com>
<linga@my-deja.com> wrote in message news:8muh13$nhi$1@nnrp1.deja.com...
> Hi, my script needs to copy directories from a network share onto my
> box. The contents of the directories are a mix of both binary and text
> data. I was thinking about using File::Recurse as such:
> recurse {copy($_, dir2)} dir1
> but the File::Copy command doesn't check for the format of the data. I
> was considering modifying the File::Copy module so that it would test
> the filehandle which would switch the filehandle to binary if
> necessary, but I was concerned about portability. How should I
> approach this? Is the use of File::Copy::copydir preferable? This is
> my modification to the File::Copy module...any suggestions regarding
> these? Thanks for your help,
> Sanjay
>
system("xcopy $source $dest /e /s");
should do the trick........dirty....lazy...but works.
Brendon
++++
------------------------------
Date: Thu, 10 Aug 2000 15:38:36 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Cant figure this out.
Message-Id: <x71yzx15z7.fsf@home.sysarch.com>
>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:
BL> Uri Guttman wrote:
>> why the assigment? just use s///
>>
>> $var =~ s/(.*)#/$1/ ;
BL> ^var =~ s/(.*)#.*/$1/;
BL> You don't want to delete just that character.
yep. 3am coding is not smart. but still the assignment was not the best way.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 10 Aug 2000 15:44:36 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Cant figure this out.
Message-Id: <8muil4$69n$1@lublin.zrz.tu-berlin.de>
jason <elephant@squirrelgroup.com> wrote in comp.lang.perl.misc:
>psycho wrote ..
>>Easily put, need to be able to cut the last part of a scarlar at
>>a determind character. There would be more then of these
>>characters, but the last one and all data after that character
>>is to be deleted.
>
> perldoc -f substr
> perldoc -f rindex
Why rindex? The way I understand the OP, everything after (and including)
the *first* occurence of some character is to be deleted.
Anno
------------------------------
Date: Thu, 10 Aug 2000 09:54:06 -0700
From: psycho <psychoNOpsSPAM@pcpatches.com.invalid>
Subject: Re: Cant figure this out.
Message-Id: <2b309490.6cde1839@usw-ex0104-033.remarq.com>
post that you want it to cut the last occurence of the character
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: Thu, 10 Aug 2000 15:09:08 GMT
From: jonceramic@nospammiesno.earthlink.net (Jon S.)
Subject: Re: CGI / Pearl Interfacing w/ Dos Program Question
Message-Id: <3992c199.5262921@news.earthlink.net>
On Thu, 10 Aug 2000 12:27:08 GMT, vagabond_nomad@my-deja.com wrote:
>
>> And, finally, don't bug the regulars on comp.lang.perl.misc with
>> questions about cgi. Post those to
>> comp.infosystems.www.authoring.cgi.
>>
>> Jon (also a newbie)
>>
>
>Jon, I'm glad you brought this up. I've already tried to connect to the
>site you listed but am unable. I've tried both as a regular url to an
>HTTP site, and also as news:comp.infosystems.www.authoring.cgi. When as
>a news site, I am prompted for a username and password. If you can tell
>me how to access this site, I'd be more than happy to check it out as
>well.
How do you manage to access comp.lang.perl.misc? Either way, my
preferred newsreader on any platform is freeagent for Windows. With
the cgi group, you need to post a "passme" to get authenticated as a
poster, but I've never had trouble reading it.
>Lastly, if this is a site about Perl, then why can't I ask people
>questions about CGI? From my understanding, they are both closely
>related.
While Perl may be related to CGI, CGI is not related to Perl.
CGI just is the way the data gets passed and handled in the client
server relationship.
Perl is just a programming language/environment.
You can run many, many different programming language/environments
through CGI. Perl is just one of many. C is also used. PHP is
similar, but I'm not sure if it goes through CGI or not. Then you've
got .asp, etc. which also follow the same model as classic CGI.
Basically, as long as you can call a proper compiler/executer for your
server platform, I believe you can write a .cgi script for any
language you want.
Likewise, Perl can be used for much more than just CGI scripts. It's
just that it's a great text manipulator which is what html is. And,
Lincoln Stein gave the world CGI.pm which makes Perl easy to use for
CGI.
And, in practical terms, people will bitch at you for posting CGI
questions to this group. It breaks down like this. If it's a question
relating to web page interaction, and you're using perl, post to the
CGI group. So, if you have a problem with CGI.pm, or 500 errors or
whatever, that's specific to CGI, and not to miscellaneous perl.
If it's a question relating to strict code manipulation (why doesn't
my reg exp work? How do I call a subroutine? etc.), it's okay to ask
here regardless of if the script is used for CGI or not. You are ok
if it's specific to how Perl code works, not how CGI's work.
Best of luck,
Jon
------------------------------
Date: Thu, 10 Aug 2000 15:24:24 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: CGI/Pearl Interfacing w/ DOS Program Question
Message-Id: <c9i5psc4s1fptve9dj0qmnbb37epca7q8c@4ax.com>
vagabond_nomad@my-deja.com wrote:
> this DOS program is ultimately going to be a
>component of a Win98 application but has only been compiled as a DOS
>program in order to get it to run on the Unix machine.
I wonder where those stupid people keep coming from. And these are
actually professionals?!?!
Anyway, if for example the source is in ANSI C, they could get there by
compiling it for that Unix platform.
--
Bart.
------------------------------
Date: Thu, 10 Aug 2000 17:36:57 +0100
From: "JohnnyP" <JohnP@townpages.co.uk>
Subject: Check existence of a remote file!!!
Message-Id: <GSAk5.18$3T6.1780@monolith.news.easynet.net>
Hi, I am trying to figure out how to check the existence of a remote file in
my perl program on a Solaris 7 system running perl 5.003. The remote host
is not sharing filesystems, but does allow rsh, rlogin etc.
The purpose of this is to perform an error check after rcp'ing a number of
files to the remote host from the master server.
I just can't figure out how to connect to the remote host, check for the
file and return a value back into the perl script to flag it's existence or
not.
I would really appreciate any help on this.
Cheers
John Parsons
Systems/Web Administrator
Townpages Ltd
------------------------------
Date: Thu, 10 Aug 2000 19:29:28 +0200
From: "Brendon Caligari" <bcaligari@shipreg.com>
Subject: Re: Check existence of a remote file!!!
Message-Id: <8muo5b$gmc$1@news.news-service.com>
"JohnnyP" <JohnP@townpages.co.uk> wrote in message
news:GSAk5.18$3T6.1780@monolith.news.easynet.net...
> Hi, I am trying to figure out how to check the existence of a remote file
in
> my perl program on a Solaris 7 system running perl 5.003. The remote host
> is not sharing filesystems, but does allow rsh, rlogin etc.
>
> The purpose of this is to perform an error check after rcp'ing a number of
> files to the remote host from the master server.
>
> I just can't figure out how to connect to the remote host, check for the
> file and return a value back into the perl script to flag it's existence
or
> not.
could you possibly ftp to wherever, do a listing and check for the file?
B
------------------------------
Date: Thu, 10 Aug 2000 15:48:34 GMT
From: SPAM+indigo@dimensional.com (Tim)
Subject: Re: Example in FAQ
Message-Id: <8F8C6E542indigodimcom@166.93.207.145>
azielke@hotmail.com (Andreas Zielke) wrote in
<8F8CAB1C9andreaszielkesdmde@127.0.0.1>:
>Hi,
>
>I just studied the FAQ (Part 4) and found an answer that I don't under-
>stand.
>Initially I was wondering about how to remove duplicate array elements,
>one of the possible answers in the FAQ is:
>
>undef %saw;
>@saw{@in} = ();
>@out = sort keys %saw; # remove sort if undesired
>
>What I don't understand is the second line - I know it does something
>like
>
>foreach (@in) {
> $saw{$_} = 'whatever';
>}
It is called a hash slice. In a nutshell, the expression:
@saw{@in}
is equivalent to:
($saw{$in[0]}, $saw{$in[1]}, $saw{$in[2]}, ....)
Since a hash slice is an lvalue as well as an rvalue, it is
a useful way for both populating and extracting information
from a hash.
Check out Uri Guttman's hash slice tutorial at:
http://www.sysarch.com/~uri/perl/tutorials/hash_slices.txt
-T
------------------------------
Date: Thu, 10 Aug 2000 16:27:25 +0100
From: "Daniel Foster" <daniel@blackomega.com>
Subject: Re: Exporting variables from packages
Message-Id: <8mup3l$aue$1@news5.svr.pol.co.uk>
> It works for me. What version are you using? I think it must be an
> older one. I'm using Perl 5.6. I think that is just a superfluous
> warning, saying that $co is used only once *in that script*. It
workls
> ubnder "use strict", so it *must* be exported. Also, try printing
$co
> instead of $co->header. I dare bet that you'll still get the
warning,
> and an output that a bit looks like "CGI=HASH(0x8b35f90)".
>
> Just use $co more than once.
That wan't the only error message I was getting. I tried to do some
of the stuff you suggested and it started working, without me
knowingly having changed anything from before. Weird. Thanks though.
---
I don't like spinach, and I'm glad I don't, because if I liked it I'd
eat it, and I just hate it. - Clarence Darrow
Daniel Foster - daniel@blackomega.com
------------------------------
Date: Thu, 10 Aug 2000 10:27:45 -0500
From: Yidao Cai <yidao.cai@uth.tmc.edu>
Subject: File handle and symbolic link
Message-Id: <3992C9F1.E375E492@uth.tmc.edu>
1. File handle
Suppose in Sub1, we open "fileA" with
open(FIN, "<$filename);
where $filename = "fileA".
Now we call Sub2, and Sub2 call Sub1 and use the same open() line, only
that $filename = "fileB". Now the since FIN is associated with "fileB"
and we have no way to access "fileA" again.
Is there a my() equivelent for file handles?
2. Symbolic link
SymLink is soft-link to "realDir".
-f SymLink returns true
-f SymLink/ returns false
Why is this?
cai
--
email: yidao.cai@uth.tmc.edu
------------------------------
Date: Fri, 11 Aug 2000 00:14:19 +0800
From: "Kimochi3D" <jtalbain@nospam.kimochi3d.com>
Subject: form replies in HTML
Message-Id: <8mujvc$2s7$1@mawar.singnet.com.sg>
Hi!
Is it possible to receive html emails from a self made script? Is it as
simple as placing the <HTML> tags into the output meant for the targeted
user? I have a client who wants her reply forms looking exactly as what her
customers fill in on her website, which means the emails she receives from
them must look like the website....
Do post here I lurk.... and miss.... replies to email are of course best!
Thanks!
--
*remove nospam from email address before reply!*
Regards,
Alvin Yap
http://www.kimochi3d.com
------------------------------
Date: Thu, 10 Aug 2000 11:23:27 -0400
From: Sheila Duan <sduan@newbridge.com>
Subject: get rid of the empty space in the string
Message-Id: <3992C8EF.87894E78@newbridge.com>
hi,
I am really appreciated anyone to give me this help!
How to get rid of the space in the string?
ie: $string = " test ";
I need to get rid of the empty space in the front and back of the
$string.
the output should like $string="test".
Thank you very much!
Sheila Duan
------------------------------
Date: 10 Aug 2000 17:33:30 +0100
From: andkaha@hello.to.REMOVE (Andreas Kahari)
Subject: Re: get rid of the empty space in the string
Message-Id: <3992cb4a@merganser.its.uu.se>
In article <3992C8EF.87894E78@newbridge.com>,
Sheila Duan <sduan@newbridge.com> wrote:
>hi,
>
>I am really appreciated anyone to give me this help!
>
>How to get rid of the space in the string?
>ie: $string = " test ";
>I need to get rid of the empty space in the front and back of the
>$string.
>the output should like $string="test".
>
>Thank you very much!
>
>Sheila Duan
>
It's in the FAQ.
perldoc -q 'strip blank'
/A
--
# Andreas Kähäri, <URL:http://hello.to/andkaha/>.
# ...brought to you from Uppsala, Sweden.
# All junk e-mail is reported to the appropriate authorities.
# Criticism, cynicism and irony available free of charge.
------------------------------
Date: Thu, 10 Aug 2000 16:14:03 GMT
From: SPAM+indigo@dimensional.com (Tim)
Subject: Re: get rid of the empty space in the string
Message-Id: <8F8C65EC2indigodimcom@166.93.207.145>
sduan@newbridge.com (Sheila Duan) wrote in
<3992C8EF.87894E78@newbridge.com>:
>hi,
>
>I am really appreciated anyone to give me this help!
>
>How to get rid of the space in the string?
>ie: $string = " test ";
>I need to get rid of the empty space in the front and back of the
>$string.
>the output should like $string="test".
If you are sure the whitespace contains only the space character:
$string =~ tr/ //d;
If it can contain other whitespace:
$string =~ s/\s+//g;
man perlop for more info.
-T
------------------------------
Date: Thu, 10 Aug 2000 15:21:03 GMT
From: jonceramic@nospammiesno.earthlink.net (Jon S.)
Subject: Re: help for Insert rows into table by DBI
Message-Id: <3992c782.6776899@news.earthlink.net>
On Thu, 10 Aug 2000 18:04:56 +0800, "Lucas Tsoi" <lucas@cplhk.com>
wrote:
>Hi all,
>
>I met some problems about DBI calling mySQL.
>
>When either of elements(element1, element2, element3, element4, element5)
>has
>the character liked ' or ", the error message "Cannot update database
>payment"
>would be returned.
>
>I guess the problem is from the qq interpolation, but I don't know how to
>solve it.
I'm a newbie too, but I seem to recall that there is a "quote"
function in DBI which converts any string for you. I know I have a
tutorial description somewhere. Probably in the book, "Programming
the Perl DBI."
Perl in a Nutshell lists it, but doesn't give a blow by blow
description other than-
$sql = $db_handle->quote(string)
Escapes special characters in a string for use in a SQL statement
Best of luck,
Jon
------------------------------
Date: Thu, 10 Aug 2000 13:40:21 -0400
From: Stephan Gross <sg@loralskynet.com>
Subject: Help with PPM
Message-Id: <9sp5psor7iaps8s89vee8quqdh7jhqgpn3@4ax.com>
I'm running the latest version of Activestate Perl (616) on Windows NT
4.0. PPM is driving me crazy. After some proxy setup problems, it
appears to be working - somewhat. It does do installs if I know the
name of the package. However, if I do a "search gui" (for example), I
get back this:
no element found at line 1874, column 5, byte 110532 at
C:/site/lib/SOAP/Parser.pm at line 73
and then I'm thrown out of PPM and back to a DOS prompt. If I do a
"verify", it verifies three packages and then the same thing occurs.
Can someone tell me what's going on?
================================================================
Stephan Gross Loral Skynet sg@loralskynet.com
Senior Software Engineer 908-470-2388
------------------------------
Date: Thu, 10 Aug 2000 15:44:17 GMT
From: btaneja@my-deja.com
Subject: RE: HELP!! with Install on HP-UX.. where to start!??
Message-Id: <8muikf$ouc$1@nnrp1.deja.com>
Thank you Merijin :) :)
that did the trick !!!! thank you! thank you :)
-Bruce
Chicago
In article <8F8C769D7Merijn@192.0.1.90>,
h.m.brand@hccnet.nl (H. Merijn Brand) wrote:
> btaneja@my-deja.com wrote in <8msia5$b7l$1@nnrp1.deja.com>:
>
> >
> >
> >sorry forgot to mention this is on a HP-UX 11.0
> >and the Perl I downloaded is a binary install..
> >
> >the question is then do I even do a make?? can
> >I just ignore the install/ readme files and untar
> >under /opt/perl5 (e.g.) and it will all work??
> >
> >thanks!!
> >-Bruce
> >bruce@ereliable.com
> >
> >
> >In article <8msh72$aac$1@nnrp1.deja.com>,
> > btaneja@hotmail.com wrote:
> >>
> >>
> >> I have downloaded a Perl 5.6 version of HP-UX, untar-ed it and read
> >> it .. Basically I need to :
> >>
> >> rm -f config.sh Policy.sh
> >> sh Configure
> >> make
> >> make test
> >> make install
> >>
> >> BUT WHERE IS THE MAKE FILE ??
> >> I HAVE UNZIPPED IN /home/root
> >> and the INSTALL/ readme is in:
> >> /home/root/perl/perl/perl-RUN/opt/perl5/doc
> >>
> >> But no matter where I do "make", I get:
> >>
> >> # make
> >> Make: No arguments or description file. Stop.
> >>
> >> HELP!
> >> thanks, Bruce
>
> What's the name of the tar file? Where did you get it?
>
> If it's something like 'perl-5.6.0.SD.tar.gz' your sequence will be:
>
> # gzip -d perl-5.6.0.SD.tar
> # swinstall -s `pwd`/perl-5.6.0.SD.tar
>
> And that should do the trick. Most binary HP-UX distributions are in
> SD (Software Distribution) format, and will need swinstall to get it
> to the right places.
>
> --
> H.Merijn Brand
> using perl5.005.03 and 5.6.0 on HP-UX 10.20, HP-UX 11.00, AIX 4.2,
AIX 4.3,
> DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-
Unify
> ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
> Member of Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 10 Aug 2000 11:03:44 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: HELP!! with Install on HP-UX.. where to start!??
Message-Id: <3992D260.33195BF5@rac.ray.com>
btaneja@my-deja.com wrote:
>
> sorry forgot to mention this is on a HP-UX 11.0
> and the Perl I downloaded is a binary install..
>
Is it a .depot file that you got from HP's software depot? If so, you
use swinstall to install it. If you want to build Perl from the
stable.tar file, you'll need an ansi C compiler (either HP's or
someone else's, like gcc). The bundled C compiler that HP ships for
"free" won't compile perl.
Good luck!
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Thu, 10 Aug 2000 17:07:36 +0100
From: King Verence <verence1964@hotmail.com>
Subject: integers
Message-Id: <9pk5pssm6jg4eh5o6malsbd36v37ct088k@4ax.com>
I have a Javascript routine that encrypts numbers, below. It encrypts
and decrypts fine, but when I rewrite it in perl (see snippet), it
breaks, I think because of the different ways perl and JS use
integers.
I believe that the JS code works with int being 32bit signed, and perl
is too clever.
Anyone know how to get round the unstrict typing to preserve the
functionality in perl ( I really don;t want to use another language if
at all avoidable)
Many thanks.
---------------
Javascript code
---------------
function encipher(p1, p2, k1, k2, k3, k4)
{ var y = new Number(p1)
var z = new Number(p2)
var a = new Number(k1)
var b = new Number(k2)
var c = new Number(k3)
var d = new Number(k4)
var sum = 0
var delta = 0x9E3779B9
var n = 32
while (n --> 0)
{
sum += delta
alert("sum="+sum)
y += (z << 4) + a ^ z + sum ^ (z >> 5) + b
z += (y << 4) + c ^ y + sum ^ (y >> 5) + d
}
p3 = y
p4 = z
}
function decipher(p1, p2, k1, k2, k3, k4)
{ var y = new Number(p1)
var z = new Number(p2)
var a = new Number(k1)
var b = new Number(k2)
var c = new Number(k3)
var d = new Number(k4)
// sum = delta<<5, in general sum = delta * n
var sum = 0xC6EF3720
var delta = 0x9E3779B9
var n = 32
while (n --> 0)
{ z -= (y << 4) + c ^ y + sum ^ (y >> 5) + d
y -= (z << 4) + a ^ z + sum ^ (z >> 5) + b
sum -= delta
}
p3 = y
p4 = z
}
---------
Perl Code
---------
sub encipher
{
$y = $_[0];
$z = $_[1];
$a = $_[2];
$b = $_[3];
$c = $_[4];
$d = $_[5];
$sum = 0x0;
$delta = 0x9E3779B9;
$n = 32;
while ($n-- > 29) {
$sum += $delta;
$y += ($z << 4) + $a ^ $z + $sum ^ ($z >> 5) + $b;
$z += ($y << $4) + $c ^ $y + $sum ^ ($y >> 5) + $d;
}
$_[0] = $y;
$_[1] = $z;
}
sub decipher
{
$y = $_[0];
$z = $_[1];
$a = $_[2];
$b = $_[3];
$c = $_[4];
$d = $_[5];
# sum = delta<<5, in general sum = delta * n
$sum = 0xC6EF3720;
$delta = 0x9E3779B9;
$n = 32;
while ($n--> 0) {
$z -= ($y << 4) + $c ^ $y + $sum ^ ($y >> 5) + $d;
$y -= ($z << 4) + $a ^ $z + $sum ^ ($z >> 5) + $b;
$sum -= $delta;
}
$_[0] = $y;
$_[1] = $z;
}
------------------------------
Date: Thu, 10 Aug 2000 15:43:00 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Large-File Reformatting Problem (Regexp gurus, et al.)
Message-Id: <v1j5psge2g0flr12nilv65u5o0ikdjpc3e@4ax.com>
Martien Verbruggen wrote:
>\begin{heresy}
>
>Hmm. I might be missing something, but I'd probably try to do this with
>awk.. not perl.
>If I interpreted it correctly, then this is one of the things that awk
>probably is better at. :) It allows RS to be a regexp.
I sure hope that this feature will be added in Perl6. If nobody else
cares enough to impleent it, I'll end up trying to implement it myself
(shudder).
Using a less powerful but speedingly fast DFA regex engine, it should be
possible to add this feature, with a barely noticable slowdown.
--
Bart.
------------------------------
Date: Thu, 10 Aug 2000 17:45:17 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Large-File Reformatting Problem (Regexp gurus, et al.)
Message-Id: <sp5qhdcn4t174@corp.supernews.com>
In article <v1j5psge2g0flr12nilv65u5o0ikdjpc3e@4ax.com>,
Bart Lateur <bart.lateur@skynet.be> wrote:
: I sure hope that [regular expressions in $/] will be added in Perl6.
: If nobody else cares enough to impleent it, I'll end up trying to
: implement it myself (shudder).
:
: Using a less powerful but speedingly fast DFA regex engine, it should be
: possible to add this feature, with a barely noticable slowdown.
Yeah, but then everyone would bitch about not having backreferences
in $/. :-)
Greg
--
And as for when the new millennium starts, which of these dates looks more
like the start of a new millennium: 01/01/00 or 01/01/01?
-- Dan Harper
------------------------------
Date: Thu, 10 Aug 2000 16:38:00 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: London £30-35K Perl Programmers Required
Message-Id: <8mulp8$rgu$1@nnrp1.deja.com>
In article <325cbd74.235e50ad@usw-ex0104-031.remarq.com>,
checker <c_barnes_ukNOc_SPAM@hotmail.com.invalid> wrote:
> London £30-35K Perl Programmers Required
>
> http://www.hotrecruit.co.uk ,a rapidly expanding Internet
> recruitment advertising company require Perl programmers to join
> our team.
is this a legal requirement? or can the Perl programmer choose not to
join? ;^)
>
> Extensive experience required of Perl and MySQL on UNIX.
extensive experience for only £30-35K ? In your dreams, perhaps
>
> Please contact chrisb@hotrecruit.co.uk
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 10 Aug 2000 19:32:43 +0200
From: "Brendon Caligari" <bcaligari@shipreg.com>
Subject: Re: London £30-35K Perl Programmers Required
Message-Id: <8muobd$h4r$1@news.news-service.com>
man....you could stick some coloured flyers in london phone boots like
whores to
"checker" <c_barnes_ukNOc_SPAM@hotmail.com.invalid> wrote in message
news:325cbd74.235e50ad@usw-ex0104-031.remarq.com...
> London £30-35K Perl Programmers Required
>
> http://www.hotrecruit.co.uk ,a rapidly expanding Internet
> recruitment advertising company require Perl programmers to join
> our team.
>
> Extensive experience required of Perl and MySQL on UNIX.
>
> Please contact chrisb@hotrecruit.co.uk
>
------------------------------
Date: Thu, 10 Aug 2000 13:00:00 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: London =?iso-8859-1?Q?=A330=2D35K?= Perl Programmers Required
Message-Id: <3992DF90.338ACA40@attglobal.net>
checker wrote:
>
> London £30-35K Perl Programmers Required
>
> http://www.hotrecruit.co.uk ,a rapidly expanding Internet
> recruitment advertising company require Perl programmers to join
> our team.
>
Ohhh, you've done it now...
dha should be along any time now...
------------------------------
Date: Thu, 10 Aug 2000 16:39:33 GMT
From: beginner <lliu00@my-deja.com>
Subject: LWP::UserAgent & login
Message-Id: <8muls4$rhn$1@nnrp1.deja.com>
Hi, All
I am using LWP::UserAgent to access web page at
http://www.xxx.com/login.dll, there is login dialog in the first place,
asking for login and password information. How do I pass login and
password to the server and pass througth login screen?
Thanks a lot
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 10 Aug 2000 15:34:13 GMT
From: videmos@my-deja.com
Subject: modify environment variables ?
Message-Id: <8mui1l$oe9$1@nnrp1.deja.com>
Hello,
I would like to modify existing environment variables (DISPLAY) from the
Perl script. I tried to use the ENV hash, but the changes are visible
only in the script (and its children) and are gone after the script
terminates. How can I do that on a permanent basis ? So I could see the
changes even after the script exited.
Thank you for your help,
Martin
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 10 Aug 2000 17:50:57 +0100
From: andkaha@hello.to.REMOVE (Andreas Kahari)
Subject: Re: modify environment variables ?
Message-Id: <3992cf61@merganser.its.uu.se>
In article <8mui1l$oe9$1@nnrp1.deja.com>, <videmos@my-deja.com> wrote:
>Hello,
>
>I would like to modify existing environment variables (DISPLAY) from the
>Perl script. I tried to use the ENV hash, but the changes are visible
>only in the script (and its children) and are gone after the script
>terminates. How can I do that on a permanent basis ? So I could see the
>changes even after the script exited.
>Thank you for your help,
>
>Martin
Another FAQ...
See perlfaq8: I {changed directory, modified my environment} in a perl
script. How come the change disappeared when I exited the script? How
do I get my changes to be visible?
/A
--
# Andreas Kähäri, <URL:http://hello.to/andkaha/>.
# ...brought to you from Uppsala, Sweden.
# All junk e-mail is reported to the appropriate authorities.
# Criticism, cynicism and irony available free of charge.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3976
**************************************