[16255] in Perl-Users-Digest
Perl-Users Digest, Issue: 3667 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 14 11:10:31 2000
Date: Fri, 14 Jul 2000 08:10:18 -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: <963587418-v9-i3667@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 14 Jul 2000 Volume: 9 Number: 3667
Today's topics:
Net::FTP error:Bad arg length for Socket::unpack_sockad (Yu Zhang)
New book on web dev with Perl <tedken@optonline.net>
Re: Newbie Globbing Question <rhomberg@ife.ee.ethz.ch>
Re: Newbie Globbing Question <taboo@doofa.net>
Re: Newbie: Reading in file contents <aqumsieh@hyperchip.com>
Perl and Dailup Networking (Rob Wilson)
Re: perl beautifier? madsere@my-deja.com
Re: perl beautifier? <DNess@Home.Com>
Re: Perl CGI and browser timeout (J. B. Moreno)
Re: Perl Expert? I need help! (Bernard El-Hagin)
Re: Perl Expert? I need help! (Bernard El-Hagin)
Re: Perl Expert? I need help! <sylvain2k@sympatico.ca>
Re: Perl on irc (Anno Siegel)
Re: Perl on irc (Randal L. Schwartz)
Re: Perl Rocks!(OT?) <mjcarman@home.com>
Problems with Proxyserver tallisyn@my-deja.com
Re: Pushing referenced objects on an array <rhomberg@ife.ee.ethz.ch>
Re: query string problem.... (Will England)
Re : Silly Question? <webmaster@host1001.com>
Re: Running a CGI-script through CGI? <flavell@mail.cern.ch>
Re: Silly Question? (Keith Calvert Ivey)
Re: slow learner needs help with splice () (M.J.T. Guy)
Re: The newbie question newsposter@cthulhu.demon.nl
Re: The problem of two Submit buttons <flavell@mail.cern.ch>
Re: The problem of two Submit buttons <iltzu@sci.invalid>
Re: untainting insecure dependancy? <rhomberg@ife.ee.ethz.ch>
what mod-perl require richard@sunjapan.com.cn
Re: Windmail/NT CGI script not sending mail tallisyn@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Jul 2000 14:03:59 GMT
From: zhangy@yuma.Princeton.EDU (Yu Zhang)
Subject: Net::FTP error:Bad arg length for Socket::unpack_sockaddr_in
Message-Id: <8kn6kf$75l$1@cnn.Princeton.EDU>
Hi folks,
I wrote a simple script using Net::FTP to download bunch of files,
each time after processing several hundred of them, the script
stops and prints
"Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16
at /usr/lib/perl5/5.00503/i386-linux/Socket.pm line
295, <FILE> chunk 1130."
Anyone has an idea what the message means and how to get round of it?
The script is as follows:
#!/usr/bin/perl
#Script for extracting latitude and longitude of each 7.5dem
use Shell;
use Net::FTP;
open(FILE0, ">7.5dem_list.d")||die;
print "Connecting to edcftp\n";
$ftp = Net::FTP->new("edcftp.cr.usgs.gov")||die;
$ftp->login("anonymous","zhangy\@princeton.edu")||die;
$ftp->cwd("/pub/data/DEM/7.5min/");
@a=$ftp->ls("*");
foreach $a(@a){
if($a=~/^\D/ && !($a=~/^n/)){
print $a,"\n";
$ftp->cwd("/pub/data/DEM/7.5min/$a/");
@dirs = $ftp->dir ();
print "/pub/data/DEM/7.5min/$a/\n";
$count=0;
foreach $dir(@dirs){
if($count>2 && $dir=~/^(drw)/){
@dirnew = split(/\s+/,$dir);
$dir = $dirnew[8];
$ftp->cwd("/pub/data/DEM/7.5min/$a/$dir/");
if(@files = $ftp->ls("*.gz")){
print $dir," $files[0]\n";
$ftp->get($files[0]);
wait();
# print ""gunzip -cd $files[0] | /bin/tar xBf - ";
system("gunzip -cd $files[0] | /bin/tar xBf - ");
$demid = `ls *IDEN.DDF`;
chomp($demid);
$data = `cat $demid`;
@dummi =split(/\:{2}/,$data);
$lat = $dummi[1];
$lon = $dummi[2];
$lat =~s/LONG//g;
$lon =~s/SCALE//g;
print "$dir $lat $lon\n";
print FILE0 "$dir $lat $lon\n";
system("/bin/rm *DDF *gz");
}
}
$count++;
}
}
}
print "Disconnecting..\n";
$ftp->quit;
------------------------------
Date: Fri, 14 Jul 2000 13:44:29 GMT
From: "Ted Kennedy" <tedken@optonline.net>
Subject: New book on web dev with Perl
Message-Id: <1PEb5.15307$t66.38559@news02>
We are evaluating a new book on web development with Apache and Perl and are
looking for a few qualified people to read and comment on the manuscript. If
interested, please send a brief description of your credentials to me at
mailto:tedken@manning.com and I will send you more information.
------------------------------
Date: Fri, 14 Jul 2000 15:16:48 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Newbie Globbing Question
Message-Id: <396F12C0.E73850D6@ife.ee.ethz.ch>
Mark Fletcher wrote:
> The files have a naming format like:
> log.processname.0714.05
> Where 0714 is the date in mm/dd 05 is the hour that the log is created.
> 1) Id like to copy logs ending in .01 to .23, while the glob statement I
> have works, is there any way of simplifying it?
> 2) Id like to cat logs of a the same process into one big file. The cat
> statement I have doesnt produce the desired effects. How do I fix it?
> #!/usr/bin/perl -w
use strict; #perldoc strict
>
> $yest = 712;
> $today = 713;
> @logs = qw(log.lotinq.0);
> # log.pfc.u.0 );
> foreach $_ (@logs) {
# $_ is implicit, I suggest using something different in the outer loop
for my $log (@logs) {
> while ( defined ( $filename =
> ### Can this glob statement be tidied up?
> <./$_$yest.0[1-9]* ./$_$yest.1[2-8]* ./$_$yest.2[0-3]* ./$_$today.00>
> ) ) {
# a good place for grep
for ("./$log$today.00", grep {/(\d+)$/, $1 <= 23 && $1 >= 1}
<./$log$yest*>) {
> system("cp $filename \/home\/mark");
> ### How do I get the cat statement to work properly?
> system("cat $filename > log");
.... >> log, see sh's documentation
> $filename =~ s#.*/##;
> print "I found the file $filename \n";
> }
> }
- Alex
------------------------------
Date: 14 Jul 2000 11:18:10 +1000
From: "Kiel Stirling" <taboo@doofa.net>
Subject: Re: Newbie Globbing Question
Message-Id: <396e6a52$1_2@nexus.comcen.com.au>
"Mark Fletcher" <MarkOn******@ukgateway.net> wrote:
>Hi,
>
>Please find enclosed a script that I wrote that attempts to use globbing.
>Unfortunately I am having problems with it. The purpose of the script is to
>copy logfiles to a certain location and then cat logfiles of a similar type
>
>The files have a naming format like:
>
>log.processname.0714.05
>
>Where 0714 is the date in mm/dd 05 is the hour that the log is created.
>
>I have two issues with my script.
>
>1) Id like to copy logs ending in .01 to .23, while the glob statement I
>have works, is there any way of simplifying it?
>2) Id like to cat logs of a the same process into one big file. The cat
>statement I have doesnt produce the desired effects. How do I fix it?
>
>Ive consulted the usual sources (Learning Perl, Perl Cookbook, Programming
>Perl) but to no avail ;-(
>
>Any help would be greatly appreciated!
>
>Thanks,
>
>Mark
>
>#!/usr/bin/perl -w
>
>$yest = 712;
>$today = 713;
>$yestlog = '$_$yest';
>$todylog = '$_$today';
>
>@logs = qw(log.lotinq.0);
> # log.pfc.u.0 );
>
>while ( defined ( $filename = glob( "/home/mark/testglob/*" ) ) ) {
> $filename =~ s#.*/##;
> print "I found the file $filename \n";
>}
>print "$yest $today \n";
>
>foreach $_ (@logs) {
> while ( defined ( $filename =
> ### Can this glob statement be tidied up?
> <./$_$yest.0[1-9]* ./$_$yest.1[2-8]* ./$_$yest.2[0-3]* ./$_$today.00>
> ) ) {
> system("cp $filename \/home\/mark");
> ### How do I get the cat statement to work properly?
> system("cat $filename > log");
> $filename =~ s#.*/##;
> print "I found the file $filename \n";
> }
>}
>
Well I think your cat statement maybe needs a >
try system "cat $filename >>log";
#!/usr/bin/perl
opendir DIRHANDLE, "/var/log/";
@files=readdir DIRHANDLE;
foreach $filename (@files)
{
$filename =~ /\./;
system "cat $filename >>log" if $' <= 24;
}
Hope this helps :)
Kiel Stirling
------------------------------
Date: Fri, 14 Jul 2000 14:02:40 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Newbie: Reading in file contents
Message-Id: <7aem4wkdx9.fsf@merlin.hyperchip.com>
Antony <mcnultya@nortelnetworks.com> writes:
> Tony Balazs said...
> > $jobs = <JOBS>;
>
> replace that line with:
>
> @jobs = <JOBS>;
>
> > print $jobs;
> > print "\n";
>
> replace those two lines with:
>
> print join("\n", @jobs);
Each entry in @jobs already ends with "\n". Your code will have
alternating empty lines.
--Ala
------------------------------
Date: 14 Jul 2000 09:04:47 -0500
From: rwilson@sherrill.kiva.net (Rob Wilson)
Subject: Perl and Dailup Networking
Message-Id: <8kn6lv$p7q$1@sherrill.kiva.net>
Posted for a friend:
--Begin Paste
I'm using ActivePerl-5.6.0.613 with the libnet and mail-pop3client ppms.
These are running on Windows98.
On this Windows98 machine I have two dialup networking entries. One called
"mail". The other called "browse". The entry called "browse" is the default
dialup networking connection. (which was defined in Start,Settings,control
panel,Internet options,Connections)
Whenever any tcp/ip application runs on the computer and a dialup connection
does not currently exist, then Windows uses the default dialup connection to
establish a connection. This is desired action for running any browser and
works just fine.
Now I have written a custom perl script application (called rosie) that uses
both smtp and pop3. I have the desire to use the dialup networking entry
called "mail" instead of the default "browse" whenever this perl script is
ran.
I would even like the "browse" dialup connection to be "disconnected" any
time the perl script rosie is executed and of course, the "mail" dialup
connection would be established.
Are there any perl routines to handle this desired action? I have found a
"dos dial v1.4" which might do the trick but was hoping for a perl solution.
Please email aschertz@interart.com if you have any questions.
--End Paste
------------------------------
Date: Fri, 14 Jul 2000 13:06:09 GMT
From: madsere@my-deja.com
Subject: Re: perl beautifier?
Message-Id: <8kn37m$9um$1@nnrp1.deja.com>
Actually there's several:
http://www.arachnoid.com/lutusp/ftp/cgi/pb.txt seems to try but not
very succesfully.
Someone else is apparently working on a (better?) perl beautifier that
is supposed to be released july 2000.
"April, 1999 Update: Planning first release of pbeaut in July, 2000,
after major rewrite to incorporate usage of some potentially helpful
CPAN modules that were brought to my attention at the Perl Conference
2.0"
See http://www.consultix-inc.com/talk.htm
In article <k6fk2tedC4v7-pn2-CXv7CCO2vyuu@mads.lokal.net>,
mads@troest.NEVERMORE.dk (Mads Orbesen Troest) wrote:
> On Thu, 13 Jul 2000 17:02:33, David Ness <DNess@Home.Com> wrote:
>
> > `perl beautifiers',
>
> Now, there's a contradiction in terms... ;-)
>
> ... /\/\\ads Orbesen Troest <mads@troest.NEVERMORE.dk>
>
> (Please remove NEVERMORE from address when replying via email...)
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 14 Jul 2000 14:50:02 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: perl beautifier?
Message-Id: <396F289C.F5A69DB0@Home.Com>
madsere@my-deja.com wrote:
>
> Actually there's several:
>
I keep hearing that, but I don't find them.
>
> http://www.arachnoid.com/lutusp/ftp/cgi/pb.txt seems to try but not
> very succesfully.
>
This is one I hadn't seen, but it is quite crude and I think I agree with
you that it isn't `very successful'.
>
> Someone else is apparently working on a (better?) perl beautifier that
> is supposed to be released july 2000.
>
> "April, 1999 Update: Planning first release of pbeaut in July, 2000,
> after major rewrite to incorporate usage of some potentially helpful
> CPAN modules that were brought to my attention at the Perl Conference
> 2.0"
>
> See http://www.consultix-inc.com/talk.htm
>
I had seen that one, but am always a little suspicious about a 15 month
`pre announcement' on web pages that don't show any active development
over the intervening time. Hopefully it will show up sometime in the next
two weeks, but I don't think I'll count on it until I see it.
Anyway, thanks for trying.
------------------------------
Date: Fri, 14 Jul 2000 11:07:11 -0400
From: planb@newsreaders.com (J. B. Moreno)
Subject: Re: Perl CGI and browser timeout
Message-Id: <1edraei.1ldcxjt172jfygN%planb@newsreaders.com>
jason <elephant@squirrelgroup.com> wrote:
> >--
> ^^...this should have a trailing space to be a proper sigdash
Deja.com doesn't allow it, complain to them and maybe they'll fix it.
--
John B. Moreno
------------------------------
Date: Fri, 14 Jul 2000 13:15:53 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Perl Expert? I need help!
Message-Id: <slrn8mu4bn.9rf.bernard.el-hagin@gdndev25.lido-tech>
On Fri, 14 Jul 2000 13:02:42 GMT, Sylvain2k <sylvain2k@sympatico.ca> wrote:
>(sorry... I'm a french canadian so my english is bad)
>
>Hi,
>
>I have a little problem. there it is:
>
>$a = "My name is Sylvain";
>
>I want to delete ALL spaces in this variable.
>I only want the first 8 caracters of the result.
>
>How can I do that?
__________________
#!/usr/bin/perl -w
use strict;
my $a = "My name is Sylvain";
$a =~ s/\s+//g;
$a =~ s/^(.{8})/$1/;
print $a;
__________________
That's just one of 1234283273122 ways of doing this in Perl.
Bernard
--
perl -e'@x=(3,2,4,1,3,2,1,3,1,3,2,3,3,2,3,0,0,1,2,1,1,1,4,1,2,1,1,2,2,1,
2,1,2,1,2,1,2,1,1,1,2,1,0,0,3,2,3,2,3,2,1,1,1,1,1,2,4,2,3,2,1,2,1,0,0,1,
2,1,1,1,4,1,2,1,1,1,2,2,1,1,4,1,1,1,2,1,1,1,2,1,0,0,3,2,4,1,1,2,1,1,1,3,
1,1,1,4,1,1,1,2,1,1,3,0,0);sub x{print q x$xx$_;print q x x x shift@x};#
while(defined($_=shift @x)){s o0o\no;$_!=0?x:print}' #Symmetry yrtemmyS#
------------------------------
Date: Fri, 14 Jul 2000 13:17:35 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Perl Expert? I need help!
Message-Id: <slrn8mu4et.9rf.bernard.el-hagin@gdndev25.lido-tech>
I wrote:
>On Fri, 14 Jul 2000 13:02:42 GMT, Sylvain2k <sylvain2k@sympatico.ca> wrote:
>>(sorry... I'm a french canadian so my english is bad)
>>
>>Hi,
>>
>>I have a little problem. there it is:
>>
>>$a = "My name is Sylvain";
>>
>>I want to delete ALL spaces in this variable.
>>I only want the first 8 caracters of the result.
>>
>>How can I do that?
>
>__________________
>#!/usr/bin/perl -w
>use strict;
>
>my $a = "My name is Sylvain";
>$a =~ s/\s+//g;
>$a =~ s/^(.{8})/$1/;
^^^
Dammit, that should be:
$a =~ s/^(.{8}).*$/$1/;
>
>print $a;
>__________________
Bernard
--
perl -e'@x=(3,2,4,1,3,2,1,3,1,3,2,3,3,2,3,0,0,1,2,1,1,1,4,1,2,1,1,2,2,1,
2,1,2,1,2,1,2,1,1,1,2,1,0,0,3,2,3,2,3,2,1,1,1,1,1,2,4,2,3,2,1,2,1,0,0,1,
2,1,1,1,4,1,2,1,1,1,2,2,1,1,4,1,1,1,2,1,1,1,2,1,0,0,3,2,4,1,1,2,1,1,1,3,
1,1,1,4,1,1,1,2,1,1,3,0,0);sub x{print q x$xx$_;print q x x x shift@x};#
while(defined($_=shift @x)){s o0o\no;$_!=0?x:print}' #Symmetry yrtemmyS#
------------------------------
Date: Fri, 14 Jul 2000 13:42:08 GMT
From: "Sylvain2k" <sylvain2k@sympatico.ca>
Subject: Re: Perl Expert? I need help!
Message-Id: <QMEb5.72770$W35.1819893@news20.bellglobal.com>
Thanks a lot... works fine!
"Bernard El-Hagin" <bernard.el-hagin@lido-tech.net> a écrit dans le message
news: slrn8mu4et.9rf.bernard.el-hagin@gdndev25.lido-tech...
> I wrote:
> >On Fri, 14 Jul 2000 13:02:42 GMT, Sylvain2k <sylvain2k@sympatico.ca>
wrote:
> >>(sorry... I'm a french canadian so my english is bad)
> >>
> >>Hi,
> >>
> >>I have a little problem. there it is:
> >>
> >>$a = "My name is Sylvain";
> >>
> >>I want to delete ALL spaces in this variable.
> >>I only want the first 8 caracters of the result.
> >>
> >>How can I do that?
> >
> >__________________
> >#!/usr/bin/perl -w
> >use strict;
> >
> >my $a = "My name is Sylvain";
> >$a =~ s/\s+//g;
> >$a =~ s/^(.{8})/$1/;
> ^^^
> Dammit, that should be:
>
> $a =~ s/^(.{8}).*$/$1/;
>
> >
> >print $a;
> >__________________
>
> Bernard
> --
> perl -e'@x=(3,2,4,1,3,2,1,3,1,3,2,3,3,2,3,0,0,1,2,1,1,1,4,1,2,1,1,2,2,1,
> 2,1,2,1,2,1,2,1,1,1,2,1,0,0,3,2,3,2,3,2,1,1,1,1,1,2,4,2,3,2,1,2,1,0,0,1,
> 2,1,1,1,4,1,2,1,1,1,2,2,1,1,4,1,1,1,2,1,1,1,2,1,0,0,3,2,4,1,1,2,1,1,1,3,
> 1,1,1,4,1,1,1,2,1,1,3,0,0);sub x{print q x$xx$_;print q x x x shift@x};#
> while(defined($_=shift @x)){s o0o\no;$_!=0?x:print}' #Symmetry yrtemmyS#
------------------------------
Date: 14 Jul 2000 13:07:15 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Perl on irc
Message-Id: <8kn3a3$8u0$1@lublin.zrz.tu-berlin.de>
Kiel Stirling <taboo@doofa.net> wrote in comp.lang.perl.misc:
>
>Any idea's on good perl irc channels?
Yes. #perl on efnet.
There's also one on dalnet, but last I looked it was comatose.
Anno
------------------------------
Date: 14 Jul 2000 06:51:58 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Perl on irc
Message-Id: <m18zv4kef5.fsf@halfdome.holdit.com>
>>>>> "Anno" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
Anno> Kiel Stirling <taboo@doofa.net> wrote in comp.lang.perl.misc:
>>
>> Any idea's on good perl irc channels?
Anno> Yes. #perl on efnet.
Please be advised that while a lot of experts hang out in real-time on
EFNET #perl (including yours truly while I'm waiting for some long
task to complete and am bored with trying to keep up with my email),
the channel has declared *all* questions about web-ish related things
to be STRICTLY OFF LIMITS. This means that if someone wanders in that
hasn't already contributed greatly to the channel, and starts asking a
CGI or HTML or HTTP question, particularly one about configuring
Apache or getting one of M**t W****t's scripts to work, they will be
quickly de-voiced and perhaps eventually kick-banned. Any and all
web. If we can smell web, it's forbidden.
This rule has been in place for about two years now, making it
tolerable for the range of questions and commentary that now occur.
Had we permitted web, the experts would have all left long ago.
The problem is that 90% of the web questions we were first getting
were, well, uninteresting. They were either directly lifted from a
FAQ (so we kept hearing the same questions over and over again), or
impossible to diagnose over IRC. (Gee, why does that sound familiar?:)
And then the questioner would become indignant, not understanding why
#perl wasn't his or her own personal help desk!
So, feel free to take advantage of the 24x7 realtime expertise on
IRC-EFNET #perl, but please please, respect the community rules. (One
such description is at
<http://pound.perl.org/RTFM/pound.perl.guide.html>.) No whining. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Fri, 14 Jul 2000 08:42:15 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Perl Rocks!(OT?)
Message-Id: <396F18B7.3950FF6F@home.com>
Rage Matrix wrote:
>
> I have come to the conclusion that Perl ROCKS! I don't see much
> point in using it on a non-UNIX based machine, but the language
> integrated so well with Linux and I LOVE it!
Hmm. Perl isn't 'integrated' with Linux, it's been ported to it, and to
damn near every other OS out there. With a few exections, most of its
features behave identically regardless of platform. This is one of
Perl's great strengths. Know it. Love it.
> [...] how many programmers here work solely with Perl
I work in Perl, Ada, C, a few other scripting languages peculiar to
specific applications, and will need to learn some Python soon.
(*ducking*) It's all about which tool fits the task at hand.
> and do most of you use it primarily on UNIX/Linux systems or Win32?
I try to write scripts that will run anywhere. :) The exception is quick
scripts to automate a tedious *nix or Win* task.
> How long did you code in Perl before you became quite proficent in
> it?
Aw, heck, I'm still learning. I *thought* I was pretty decent after six
months. I was a crude hack then. (I like to think of myself as an
elegant hack now.)
> How important is in-depth knowledge of UNIX regarding your proficieny
> in Perl?
Of Unix? Not much, I think, but a familiarity with *using* Unix (as
opposed to in-depth knowledge of it's inner workings) is very helpful in
accelerating the learning curve. Perl seems much more intuitive if
you're accustomed to mucking about from a shell prompt.
> Is the mindset for Perl different from OO languages like C++ and
> Java? i.e. Is there a different logic that helps you solve Perl
> problems faster?
I'm not really qualified to comment on this as I don't work with C++ or
Java, but to generalize it to any old language: Yes, there is a
different approach to doing things in Perl, due to the different
features of the language. e.g. a transitioning C programmer tends to
write loops like this:
for (my $i=0; $i <= $#array; $i++) {}
while a Perler writes:
foreach my $i (0 .. $#array) {}
or more likely:
foreach my $elem (@array) {}
And of course those C guys keep trying to think of strings as arrays of
characters... :)
> The motto that I have learnt so far is: Never assume anything. (This is
> regarding bugs in Perl programs).
Get friendly with -w, use strict, and perl -d.
Oh, and welcome to the Dark Side.
-mjc
------------------------------
Date: Fri, 14 Jul 2000 14:06:40 GMT
From: tallisyn@my-deja.com
Subject: Problems with Proxyserver
Message-Id: <8kn6ph$jfp$1@nnrp2.deja.com>
I'm trying to get a database connection to a MS
SQL server running over a proxy. I've got the
DBI and DBD::ODBC working from an NT machine.
But now I want to use DBD::Proxy to get the same
access from a linux machine. I think I've got
all the modules installed, but I can't get the NT
machine to run "dbiproxy". The error message it
returns:
Can't call method "tid" on an undefined value at
E:/Perl/site/lib/Net/Daemon/Log.pm line 75.
Questions:
1) Anyone know why this is happening?
2) Where can I find good documentation for
setting up and using the proxyserver.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 14 Jul 2000 15:24:11 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Pushing referenced objects on an array
Message-Id: <396F147B.3C6FF827@ife.ee.ethz.ch>
Antony wrote:
> my $human = spawn Person;
> $human->cname($temp[1]);
> $human->sname($temp[2]);
> $human->fullname($human->cname . " " . $human->sname);
> $human->dept($temp[3]);
>
> $array[$count] = \$human;
> $count++;
Why do you store a reference to $human and not $human directly
(which seems to be a blessed reference already)?
> with
> push(@array, \$human);
>
> It returns an error of "Not a SCALAR reference at ..."
what did perldiag say?
- Alex
------------------------------
Date: Fri, 14 Jul 2000 14:17:16 GMT
From: will@mylanders.com (Will England)
Subject: Re: query string problem....
Message-Id: <slrn8mu8aq.149.will@mylanders.com>
On Fri, 14 Jul 2000 01:41:07 GMT, cam <cam@home.com> wrote:
><a href="/cgi-bin/getlink.pl?id=0">ibm</a>
<when sent to>
>#!/usr/bin/perl
>print "Content-type: text/html\n\n";
>use LWP::Simple;
>$id = $ENV{'QUERY_STRING'};
>@gothere = ();
>$gothere[0]="ibm";
>$gothere[1]="apple";
>$gothere[2]="linux";
>print "@gothere[$ENV{'QUERY_STRING'}]\n";
>
>Problem is that this returns:
>id=xxxx
1) -w
2) use strict;
3) use CGI;
4) my $query = new CGI;
5) my $id_that_I_want = $query->param('id');
SHould fix you right up.
will
--
"If Al Gore invented the Internet, then I invented spellcheck!"
Dan Quayle, quoted at the National Press Club, 8/3/1999
pgpkey at http://will.mylanders.com/pub_pgp.asc
Recovery page: http://will.mylanders.com/ will@mylanders.com
------------------------------
Date: Fri, 14 Jul 2000 20:56:56 +0700
From: "HOST 1001" <webmaster@host1001.com>
Subject: Re : Silly Question?
Message-Id: <396fe0b8.0@news.cbn.net.id>
Dear Richard,
You compare string with digit comparison for string you must use :
== - > eq
!= -> ne
Regards,
Yanto Asnawi
Richard Cole Wrote:
I'm a beginner to perl and I tried the following programs:
#!/usr/bin/perl
$A = "A\nB";
if ( $A == "" ) { print "empty"; };
and
#!/usr/bin/perl
$A = "A\nB";
if ( $A != "" ) { print "not empty"; };
and
#!/usr/bin/perl
$A = "A\nB";
if (! $A == "") { print "not empty"; };
The first two didn't produce any output but the third one did. This
seems a tad inconsistent to me.
Am I missing something?
Richard Cole.
------------------------------
Date: Fri, 14 Jul 2000 15:28:19 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Running a CGI-script through CGI?
Message-Id: <Pine.GHP.4.21.0007141509290.20198-100000@hpplus03.cern.ch>
On Fri, 14 Jul 2000, langtind wrote:
> I was wondering if it's possible to start a CGI-script through a CGI?
First of all, this isn't a Perl language question. The answer is the
same for any programming language which supports the CGI software
interface specification.
The CGI specifies a programming interface between a web server (httpd)
and your program or script. One partner in the CGI deal is by
definition always a web server.
> something like:
> #!/usr/bin/perl
>
> print "I'm running count now\n";
>
> insert.cgi afile #this is the script I want to start
The CGI specification does not define the programming interface
between your script and another subsidiary script. So, the latter is
technically not a CGI script: it is not being invoked across the CGI
programming interface by a web server. You as programmer define what
programming interface is used for calling it: it might inherit the CGI
interface, or not, depending on what you did in your program etc.
> In my HTML-page I can use:
> <!--#exec cmd="/usr/bin/perl cgi-bin/insert.cgi nettet" -->
That is attempting to be an SSI (server-side include). I'm not sure
if you wanted to know "can I use server-side includes in the output
from my CGI script", and the answer to that is "usually: no, but it
depends on the server that you're using". My advice would be that even
if the server supports it, there's almost certainly a better and
more-secure way of achieving what was wanted.
f'ups redirected.
------------------------------
Date: Fri, 14 Jul 2000 13:12:26 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Silly Question?
Message-Id: <39701117.37152528@nntp.idsonline.com>
"Jim Kauzlarich" <o1technospam@skyenet.nospam.net> wrote:
>if ( $A = "" )
>will never be false, and $A (after that if) will always be ""
> = is an assignment operater. The only way that if ( $A = "" ) could be
>false is if for some reason $A could not be set to "". And I'm guessing
>that a run-time or compilation err would be more likely.
You're misunderstanding the return value of an = expression.
The condition $A = "" will *always* be false, because "" is
false. But you are, of course, right in saying that HiTekHick's
answer was completely wrong.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: 14 Jul 2000 14:40:27 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: slow learner needs help with splice ()
Message-Id: <8kn8or$juq$1@pegasus.csx.cam.ac.uk>
Stephen Carpenter <stephen_carpenter@hp.com> wrote:
>OK,
>
>@x = ("aa","bb","cc","dd");
>($x, $y, $z) = splice (@x, 0, 3);
>
>works fine.
And the moral is: Always use -w. It would have shown you what was
happening much faster than this newsgroup can.
Mike Guy
------------------------------
Date: 14 Jul 2000 14:15:42 GMT
From: newsposter@cthulhu.demon.nl
Subject: Re: The newbie question
Message-Id: <8kn7ae$nh6$1@internal-news.uu.net>
HiTekHick <HiTekHick@hillbilly.com> wrote:
> My question is, (when relevant) should I attempt a lame reply that may
> have mistakes unbeknownst to myself, or just leave it up to the old pro`s
> to handle?
Write a reply, but don't post it. Then compare it to replies posted
by other people. Why take this approach?
- you will learn which people provide excellent help, and which
people should be ignored.
- you'll learn a lot. new tricks/good ideas (and you'll learn
from your own mistakes)
- you'll get confidence when your solutions are simular to the more
experienced people.
Eventually you'll have to decide for yourself when and to what
questions to reply. After several years there still are questions
I won't even attempt to answer (but I will check the answers if
I have enough time).
But no matter how experienced you are, you will ocasionally post
wrong things, and people will correct you (sometimes not too friendly).
Better get used to that :)
Erik
------------------------------
Date: Fri, 14 Jul 2000 15:30:50 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: The problem of two Submit buttons
Message-Id: <Pine.GHP.4.21.0007141529330.20198-100000@hpplus03.cern.ch>
On Fri, 14 Jul 2000, Philip Lees wrote:
> if ( ! $add_button eq "" ){
> #add something
Boggle. Do you normally test for the negative of what you didn't
want?
------------------------------
Date: 14 Jul 2000 14:00:29 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: The problem of two Submit buttons
Message-Id: <963583114.8285@itz.pp.sci.fi>
In article <Pine.GHP.4.21.0007141529330.20198-100000@hpplus03.cern.ch>, Alan J. Flavell wrote:
>On Fri, 14 Jul 2000, Philip Lees wrote:
>
>> if ( ! $add_button eq "" ){
>> #add something
>
>Boggle. Do you normally test for the negative of what you didn't
>want?
Could've been worse. He might have written it as:
unless ( ! $add_button ne "" ){
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method." -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Fri, 14 Jul 2000 15:19:10 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: untainting insecure dependancy?
Message-Id: <396F134E.6B0A9026@ife.ee.ethz.ch>
pkey@sghms.ac.uk wrote:
> $test_user = $ARGV[0];
>
> $quota1 = `quota -v $test_user`;
>
> I then get the following taint error:
>
> Insecure dependency in `` while running with -T switch (referring to
> the quota system call.
>
> I know why I'm getting the taint error - how can I untaint the error
> so that my program runs?
by untainting $test_user
read the perlsec manpage, search for untaint
- Alex
------------------------------
Date: Fri, 14 Jul 2000 13:38:10 GMT
From: richard@sunjapan.com.cn
Subject: what mod-perl require
Message-Id: <8kn540$b97$1@nnrp1.deja.com>
Hi everyone here
I am using perl script under Apache. It run well normally. But when I
move it to mod-perl, it failed. My script is like following:
test1.pl
sub test(){
...do something here
}
1;
test2.pl
require "test1.pl";
... do something here
1;
test3.pl
require "test2.pl";
require "test1.pl";
test();
I call test3.pl by browser, it failed.
Who can help me about it.Thank in advance.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 14 Jul 2000 14:06:39 GMT
From: tallisyn@my-deja.com
Subject: Re: Windmail/NT CGI script not sending mail
Message-Id: <8kn6pg$jfo$1@nnrp2.deja.com>
Dan,
Have you considered using SMTP to send your
email? We have an NT perl script that sends mail
using SMTP. The advantage is that your script
isn't bound to a mailer on the same machine --
you can use any open SMTP gateway to send it.
You may be able to find an SMTP mailer in perl on
the web somewhere. If not, I can email you the
one we use -- it's freeware.
Tim
In article <396E28E1.B30633@ucalgary.ca>,
Dan Woods <dwoods@ucalgary.ca> wrote:
> I have written a Perl script to work on NT (I
hate NT). It is
> supposed to read a data file (list of articles)
and create the
> HTML page using a template. The user then
selects a list of
> articles they want to receive, and provide user
info with
> email address. After submit, the script should
send an email
> to the user with the requested files *attached*
to the email,
> and the admin receives an email with the user
info.
>
> I am testing on my NT workstation with Apache
and Windmail
> 3.05 eval, and the script works. However, I
then tried to
> install it on a hosting site where they use IIS
and Windmail.
> I only modified the local path of the
template/data file.
> The list of articles is created, but after
selection my script
> reports success, meaning no error from
> open(MAIL, "|windmail -t") || &error("Could not
open mail program");
> but no email is ever sent.
> Since this is on a hosting company, debugging
is very difficult
> and I am restricted on what we can use, so
using blat.exe is not ok
> (i also had blat working locally).
>
> This has been frustrating me for two weeks now.
> I am not likely to volunteer to do another NT
script anytime soon,
> however I still have to solve this problem :(
>
> Thanks...Dan.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 3667
**************************************