[17670] in Perl-Users-Digest
Perl-Users Digest, Issue: 5090 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 12 14:10:49 2000
Date: Tue, 12 Dec 2000 11:10:25 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <976648224-v9-i5090@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 12 Dec 2000 Volume: 9 Number: 5090
Today's topics:
Re: huh ?? (Garry Williams)
Re: huh ?? <Waarddebon@chello.nl>
Re: huh ?? (Garry Williams)
Re: huh ?? (Randal L. Schwartz)
Re: huh ?? (Jon Bell)
Re: huh ?? <mischief@velma.motion.net>
Re: huh ?? (Greg Bacon)
Re: huh ?? <bart.lateur@skynet.be>
I will pay for itRe: How to put each line of a text are <perry@in4me.tv>
Re: Image::Magick docs <mac@lsl.demon.co.uk>
local functions <eidheim@hivolda.no>
Re: local functions (Greg Bacon)
Re: local functions <bart.lateur@skynet.be>
NEED HELP ! - Trying to Search/Display info from array msalerno@my-deja.com
Re: need help with split <mjcarman@home.com>
Re: networking... <lmoran@wtsg.com>
New to Perl - script runs in IDE but not on server <koke36@hotmail.com>
ON - INTERNET TELE COMMUTE ONLY - PERL - Java - Js - cs Telecommuter@Visto.com
open window in Perl? manon_bertolini@mantacorp.com
Re: open window in Perl? <schneider@xtewa.de>
Re: open window in Perl? manon_bertolini@mantacorp.com
Oracle 06401-error while trying to connect <mischay@gmx.de>
Passing parameter to CGI in webpage link <p_sapienza@hotmail.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 12 Dec 2000 14:12:14 GMT
From: garry@zweb.zvolve.net (Garry Williams)
Subject: Re: huh ??
Message-Id: <2nqZ5.684$uF3.46245@eagle.america.net>
[Post re-ordered]
On Tue, 12 Dec 2000 13:56:23 GMT, Waarddebon <Waarddebon@chello.nl> wrote:
>> ++ $temp=$a1.$a2;
>> ++ $string = "temp=" . $temp . "&a1=" . $a1 . "&a2=" . $a2 . "&a3=" . $a3 .
>> ++ "&a4=" . $a4 . "&a5=" . $a5 . "&b1=" . $b1 . "&b2=" . $b2 . "&b3=" . $b3 .
>> ++ "&c1=" . $c1 . "&c2=" . $c2 . "&d1=" . $d1 . "&e1=" . $e1 . "&e2=" . $e2 .
>> ++ "&e3=" . $e3 . "&f1=" . $f1 . "&f2=" . $f2;
>> ++ dbmopen(%DB, "/data/database/sell", 0664) || die $!;
>> ++ $DB{$temp} = $string;
>> ++ dbmclose(%DB);
[Missing attribution of Abigail's follow-up]
>> Is that all the code? You haven't set $a1 or $a2 to anything, hence $temp
>> is empty.
>>
>The variables $a1 and $a2 get their value by reading out the parameter
>$a1=$q->param('a1');
> $a2=$q->param('a2');
So you must be able to see the problem by now, right?
--
Garry Williams
------------------------------
Date: Tue, 12 Dec 2000 14:21:33 GMT
From: "Waarddebon" <Waarddebon@chello.nl>
Subject: Re: huh ??
Message-Id: <NvqZ5.205500$nj7.2274375@Flipper>
eh.. no I cant see the problem... The parameters are read out correctly.
(both variables have a value). The problem though is that $temp doesn't
contain anything.
Garry Williams <garry@zweb.zvolve.net> schreef in berichtnieuws
2nqZ5.684$uF3.46245@eagle.america.net...
> [Post re-ordered]
>
> On Tue, 12 Dec 2000 13:56:23 GMT, Waarddebon <Waarddebon@chello.nl> wrote:
> >> ++ $temp=$a1.$a2;
> >> ++ $string = "temp=" . $temp . "&a1=" . $a1 . "&a2=" . $a2 . "&a3=" .
$a3 .
> >> ++ "&a4=" . $a4 . "&a5=" . $a5 . "&b1=" . $b1 . "&b2=" . $b2 . "&b3=" .
$b3 .
> >> ++ "&c1=" . $c1 . "&c2=" . $c2 . "&d1=" . $d1 . "&e1=" . $e1 . "&e2=" .
$e2 .
> >> ++ "&e3=" . $e3 . "&f1=" . $f1 . "&f2=" . $f2;
> >> ++ dbmopen(%DB, "/data/database/sell", 0664) || die $!;
> >> ++ $DB{$temp} = $string;
> >> ++ dbmclose(%DB);
>
> [Missing attribution of Abigail's follow-up]
>
> >> Is that all the code? You haven't set $a1 or $a2 to anything, hence
$temp
> >> is empty.
> >>
> >The variables $a1 and $a2 get their value by reading out the parameter
> >$a1=$q->param('a1');
> > $a2=$q->param('a2');
>
> So you must be able to see the problem by now, right?
>
> --
> Garry Williams
------------------------------
Date: Tue, 12 Dec 2000 15:26:47 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: huh ??
Message-Id: <XsrZ5.690$uF3.46379@eagle.america.net>
[Reordered post again -- to restore the natural flow of time]
[Fixed broken line-wrapping]
On Tue, 12 Dec 2000 14:21:33 GMT, Waarddebon <Waarddebon@chello.nl> wrote:
>Garry Williams <garry@zweb.zvolve.net> schreef in berichtnieuws
>2nqZ5.684$uF3.46245@eagle.america.net...
>> On Tue, 12 Dec 2000 13:56:23 GMT, Waarddebon <Waarddebon@chello.nl> wrote:
>>
>> [Missing attribution of Abigail's follow-up]
>>
>> >> Is that all the code? You haven't set $a1 or $a2 to anything, hence $temp
>> >> is empty.
>> >>
>> >The variables $a1 and $a2 get their value by reading out the parameter
>> >$a1=$q->param('a1');
>> > $a2=$q->param('a2');
>>
>> So you must be able to see the problem by now, right?
>
>eh.. no I cant see the problem... The parameters are read out correctly.
>(both variables have a value). The problem though is that $temp doesn't
>contain anything.
Others and myself have pointed out that your problem is *not* Perl's
concatenation operator or Perl's interpolation in double quoted
strings. If the $temp variable's value is empty after an assignment
to it, then the value assigned to it was empty. You have not shown
the real code.
I would also recommend reading Tad McClellan's article posted this
morning regarding posting in this group. There are several
recommendations that could help you to discover your problem and they
might not even involve posting to this group.
--
Garry Williams
------------------------------
Date: 12 Dec 2000 08:23:15 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: huh ??
Message-Id: <m1d7exbocs.fsf@halfdome.holdit.com>
>>>>> "Waarddebon" == Waarddebon <Waarddebon@chello.nl> writes:
Waarddebon> Well this is the actual code, I really hope you can help me...
Waarddebon> $temp=$a1.$a2;
Waarddebon> $string = "temp=" . $temp . "&a1=" . $a1 . "&a2=" . $a2 . "&a3=" . $a3 .
Waarddebon> "&a4=" . $a4 . "&a5=" . $a5 . "&b1=" . $b1 . "&b2=" . $b2 . "&b3=" . $b3 .
Waarddebon> "&c1=" . $c1 . "&c2=" . $c2 . "&d1=" . $d1 . "&e1=" . $e1 . "&e2=" . $e2 .
Waarddebon> "&e3=" . $e3 . "&f1=" . $f1 . "&f2=" . $f2;
Waarddebon> dbmopen(%DB, "/data/database/sell", 0664) || die $!;
Waarddebon> $DB{$temp} = $string;
Waarddebon> dbmclose(%DB);
If you have code like that, it's time to back up a step and figure out
how to remove the repitition. Any time you type the same thing more
than three times, there's almost certainly a better way of doing it.
First, put all the data into a hash. Instead of $temp and $a1, use
$data{temp} and $data{a1}.
Then, construct the string simply with:
$string = join "&", map "$_=$data{$_}", keys %data;
There. Done. "join" and "map" are both described in the basic
documentation. Invest a little more time learning, and you'll save
yourself a LOT of time in coding, debugging and maintenance.
print "Just another Perl hacker,"
--
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: Tue, 12 Dec 2000 16:32:30 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: huh ??
Message-Id: <G5GrA6.CL5@presby.edu>
[posting re-ordered *again*... please put your comments *after* the stuff
your're commenting on, and delete stuff that isn't relevant, but *do* keep
the attribution lines that say who wrote what.]
Waarddebon <Waarddebon@chello.nl> wrote:
>
>Garry Williams <garry@zweb.zvolve.net> schreef in berichtnieuws
>2nqZ5.684$uF3.46245@eagle.america.net...
>> [Post re-ordered]
>>
>> On Tue, 12 Dec 2000 13:56:23 GMT, Waarddebon <Waarddebon@chello.nl> wrote:
>> >[Abigail wrote:]
>> >> [Waarddebon wrote:]
>> >> ++ $temp=$a1.$a2;
>> >> ++ $string = "temp=" . $temp . "&a1=" . $a1 . "&a2=" . $a2 . "&a3=" .
>> >> ++ $a3 . "&a4=" . $a4 . "&a5=" . $a5 . "&b1=" . $b1 . "&b2=" . $b2
>> >> ++ . "&b3=" . $b3 . "&c1=" . $c1 . "&c2=" . $c2 . "&d1=" . $d1 .
>> >> ++ "&e1=" . $e1 . "&e2=" . $e2 . "&e3=" . $e3 . "&f1=" . $f1 .
>> >> ++ "&f2=" . $f2;
>> >> ++ dbmopen(%DB, "/data/database/sell", 0664) || die $!;
>> >> ++ $DB{$temp} = $string;
>> >> ++ dbmclose(%DB);
>> >>
>> >> Is that all the code? You haven't set $a1 or $a2 to anything, hence
>> >> $temp is empty.
>> >
>> >The variables $a1 and $a2 get their value by reading out the parameter
>> >$a1=$q->param('a1');
>> >$a2=$q->param('a2');
>>
>> So you must be able to see the problem by now, right?
>
>eh.. no I cant see the problem... The parameters are read out correctly.
>(both variables have a value).
So you printed out the contents of $a1 and $a2 immediately after the last
two statements above? There's nothing else in between those statements
and the one in which you try to use $a1 and $a2?
--
Jon Bell <jtbell@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
[ Help try to keep the Deja.com archive alive! Sign the petition at ]
[ http://www2.PetitionOnline.com/dejanews/petition.html ]
------------------------------
Date: Tue, 12 Dec 2000 17:46:47 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: huh ??
Message-Id: <t3cp47mllvqd0f@corp.supernews.com>
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>>>>>> "Waarddebon" == Waarddebon <Waarddebon@chello.nl> writes:
> Waarddebon> Well this is the actual code, I really hope you can help me...
> Waarddebon> $temp=$a1.$a2;
> Waarddebon> $string = "temp=" . $temp . "&a1=" . $a1 . "&a2=" . $a2 . "&a3=" . $a3 .
> Waarddebon> "&a4=" . $a4 . "&a5=" . $a5 . "&b1=" . $b1 . "&b2=" . $b2 . "&b3=" . $b3 .
> Waarddebon> "&c1=" . $c1 . "&c2=" . $c2 . "&d1=" . $d1 . "&e1=" . $e1 . "&e2=" . $e2 .
> Waarddebon> "&e3=" . $e3 . "&f1=" . $f1 . "&f2=" . $f2;
> Waarddebon> dbmopen(%DB, "/data/database/sell", 0664) || die $!;
> Waarddebon> $DB{$temp} = $string;
> Waarddebon> dbmclose(%DB);
I myself took a quick peek at the above and started coming up with
a simpler solution in my head. However, my solution was not as simple
as Randal's.
> First, put all the data into a hash. Instead of $temp and $a1, use
> $data{temp} and $data{a1}.
Check. Did that part right off.
> Then, construct the string simply with:
> $string = join "&", map "$_=$data{$_}", keys %data;
Damn. I need to check the docs on map more closely. I've read about
it before, but I haven't spent a lot of time on the subject, and
this solution was not immediately apparent to me. I know what it
does, but my background in other languages always leads me toward
a loop. This is as much simpler than a loop as a loop would be than
the original.
This goes to show that even people like me who aren't quite newbies
can still have a lot to learn. Perl's rich syntax presents
opportunities to simplify and shorten code in many ways (although
those goals are not always the most compatible).
> There. Done. "join" and "map" are both described in the basic
> documentation. Invest a little more time learning, and you'll save
> yourself a LOT of time in coding, debugging and maintenance.
/me runs off to read more examples of the uses of map.
> print "Just another Perl hacker,"
print "Just another student of the Perl masters"
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
I've been wanting to take advantage for a few years now, but haven't
had the chance. Maybe I can convince my current employer to help me do
that.
Chris
--
Christopher E. Stith
sub is_my_email($) {
my $addy = shift;
$my_email = $addy =~ /(mischief@(?:(?:(?:velma.)?motion|pikenet).net|bornnaked.com))/;
return $my_email;
}
------------------------------
Date: Tue, 12 Dec 2000 18:43:27 -0000
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: huh ??
Message-Id: <t3csef1hdhiv54@corp.supernews.com>
In article <t3cp47mllvqd0f@corp.supernews.com>,
Chris Stith <mischief@velma.motion.net> wrote:
: Randal L. Schwartz <merlyn@stonehenge.com> wrote:
:
: > $string = join "&", map "$_=$data{$_}", keys %data;
:
: Damn. I need to check the docs on map more closely. I've read about
: it before, but I haven't spent a lot of time on the subject, and
: this solution was not immediately apparent to me.
Play with more functional languages like Lisp, ML, or Haskell.
: I know what it
: does, but my background in other languages always leads me toward
: a loop. This is as much simpler than a loop as a loop would be than
: the original.
You can think of a map as an implicit loop. The following are
equivalent:
# first
@a = map "$_=$data{$_}", keys %data;
# second
@a = ();
for (keys %data) {
push @a, "$_=$data{$_}";
}
By chunking or condensing code like this, you can usually produce a
result that's more readable and more quickly understood.
Greg
--
Scope keeps symbol tables minty fresh.
-- DrForr
------------------------------
Date: Tue, 12 Dec 2000 18:57:32 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: huh ??
Message-Id: <r9tc3t0ontnqd5st6vh9094kfjkbm2eefd@4ax.com>
Chris Stith wrote:
>but my background in other languages always leads me toward
>a loop. This is as much simpler than a loop as a loop would be than
>the original.
map() is a loop.
--
Bart.
------------------------------
Date: Tue, 12 Dec 2000 19:54:44 +0100
From: "Perry Smit" <perry@in4me.tv>
Subject: I will pay for itRe: How to put each line of a text area into a field
Message-Id: <OouZ5.26524$fy2.1774364@news.soneraplaza.nl>
Maybe I had to add the line,
That I will pay for the answer of this question, than please contact me when
you are able to solve this.
Thanks, Perry Smit
Perry Smit <perry@in4me.tv> wrote in message
news:g2oZ5.25527$fy2.1731280@news.soneraplaza.nl...
> I'm puzzling to get each line of a text area field into seperate fields.
>
> I have two textarea's. One containing fieldnames and the other contains
the
> fieldvalues.
>
> Now I want print this in an e-mail where each text line of the fieldname
> textarea correspondent by the fieldvalue textarea.
>
> You can find the interface on:
http://www.in4me.tv/goldmine_crm/grabber.html
>
> What's the formula to create a pair of fields which will give me the
results
> like this
>
>
> <<Textare_fieldnames> <<textareafieldvalue>>
> Company = Firm Jansen
> Address1 = Dorpstraat 35
> Zip = 21523 RT
> City = Amsterdam
> Phone1 = 383838993
>
> I've tried already this (copied rom other sources and tried and
> tried...wothj no result):-)
>
> @fieldvalues = ();
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> @pairs = split(/&/, $buffer);
> foreach $pair (@pairs) {
> ($name, $value) = split(/=/, $pair);
> $value =~ tr/+/ /;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> if ($name eq "fieldvalue") {
> push(@fieldvalues,$value);
> } else {
> $FORM{$name} = $value;
> }
> }
>
>
> Any help appreciated to get this done,
>
>
> Perry Smit
>
>
>
>
------------------------------
Date: Tue, 12 Dec 2000 16:26:35 -0000
From: "Peter McGarrigle" <mac@lsl.demon.co.uk>
Subject: Re: Image::Magick docs
Message-Id: <976638304.4545.0.nnrp-10.c2ded332@news.demon.co.uk>
"Jordan Hiller" <jhiller@online-testing.net> wrote in message
news:3A328336.1F50939B@online-testing.net...
> Hi,
> I'm trying to use Image::Magick to simply check an image's size, resize
> it, and save it as a different image. It would be nice if I could find
> some documentation...the perldoc docs contain basically no information
> and the web page help does not work
> (http://www.wizards.dupont.com/cristy/www/perl.html). Can someone help
> me find some documentation or explain how to read the size of and resize
> an image?
>
Jordan,
Example proglet follows, tested on Solaris and WinNT...
---------------------------------------------------------------------
#!/usr/bin/perl
use strict;
use Image::Magick;
resize_image("00000000.jpg","xyz.jpg",100,100);
exit;
# --------------------------------------------------------
# Resize Image:
#
# takes $source image file and crops it so that it fits
# within ($tw x $th). it will then save the resulting image
# as $destination.
#
sub resize_image {
my ($source,$destination,$tw,$th) = @_;
my ($image,$e,$w,$h,$s,$nw,$nh,$nx,$ny);
print "resize $source => $destination ${tw}x${th}\n";
eval { # eval {} will
catch any exceptions
$image = Image::Magick->new(magick=>'JPEG');
$e = $image->Read($source);
if ($e) {
$e =~ m/(\d+)/; # get error code
die("ImageMagick Read: ($source; $e)") if ($1 >= 400); # bail
out if non-recoverable
}
($w,$h) = $image->Get('width','height');
die("cannot get image attributes") if ($w == 0);
if ($w < $h) { # take smallest dimension
$s = $tw / $w; # and take that as basis
} # for scaling factor
else {
$s = $th / $h;
}
$nw = int($w * $s);
$nh = int($h * $s);
$e = $image->Scale(width=>$nw,height=>$nh); # maybe use Sample
method here?
die("ImageMagick Scale: ($source; $e)") if ($e);
$nx = ($nw - $tw) / 2; # find offset for centre of image
$ny = ($nh - $th) / 2; # ImageMagick ignores -ve offsets
$nw = $tw if ($w > $tw); # crop width
$nh = $th if ($h > $th); # crop height
$e = $image->Crop("${nw}x${nh}+$nx+$ny");
die("ImageMagick Crop: ($source; $e)") if ($e);
$e = $image->Write(filename=>$destination);
die("ImageMagick Write: ($source; $e)") if ($e);
};
if ($@) {
print "$@\n";
return 0;
}
return 1;
}
------------------------------
Date: Tue, 12 Dec 2000 19:17:34 +0100
From: Ole Christian Eidheim <eidheim@hivolda.no>
Subject: local functions
Message-Id: <3A366BBE.3020700@hivolda.no>
Hi!
Is there a way to create a local function A within a function B that
doesn't override an existent function with the same name anywhere but
within function B?
Thanks,
Ole Christian Eidheim
------------------------------
Date: Tue, 12 Dec 2000 18:50:32 -0000
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: local functions
Message-Id: <t3csrook2vi976@corp.supernews.com>
In article <3A366BBE.3020700@hivolda.no>,
Ole Christian Eidheim <eidheim@hivolda.no> wrote:
: Is there a way to create a local function A within a function B that
: doesn't override an existent function with the same name anywhere but
: within function B?
You can play games like
#! /usr/bin/perl -w
use strict;
sub foo {
local *bar = \&baz;
bar();
}
sub bar {
print "bar!\n";
}
sub baz {
print "baz!\n";
}
foo();
bar();
baz();
Be sure you understand the semantics of dynamic scope (i.e., the
local() operator).
I don't know what you plan to do, but it's probably safer to pass
in a reference to the subroutine you want to call:
#! /usr/bin/perl -w
use strict;
sub foo {
my $sub = shift;
$sub->();
}
sub bar {
print "bar!\n";
}
sub baz {
print "baz!\n";
}
foo \&bar;
foo \&baz;
Hope this helps,
Greg
--
A priest advised Voltaire on his death bed to renounce the devil.
Replied Voltaire, "This is no time to make new enemies."
------------------------------
Date: Tue, 12 Dec 2000 18:52:45 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: local functions
Message-Id: <2qsc3tgp07ugr5u0febvr5so2rmv428ja2@4ax.com>
Ole Christian Eidheim wrote:
>Is there a way to create a local function A within a function B that
>doesn't override an existent function with the same name anywhere but
>within function B?
You mean something like:
sub A {
"global"
}
sub B {
sub A {
"local";
}
print A();
}
B();
It works (in Perl5.6), but there's a complaint under -w:
Subroutine A redefined at test.pl line 6.
Another way:
sub A {
"global"
}
sub B {
local *A = sub {
"local";
};
print A();
}
B();
No complaint. But don't forget the semicolon after the sub.
--
Bart.
------------------------------
Date: Tue, 12 Dec 2000 18:52:22 GMT
From: msalerno@my-deja.com
Subject: NEED HELP ! - Trying to Search/Display info from array
Message-Id: <915s52$rrh$1@nnrp1.deja.com>
I need to search the /etc/passwd file for usernames and show all of the
names that match the search criteria. I am still new at this and I am
pretty sure that perls grep does not do what I need it to do. I am not
100% sure what I need to use.
Please help.
Thanks,
Matt
#!/usr/bin/perl -w
use strict;
print "Enter the information that you want to search for : "; chomp(my
$search = <STDIN>);
setpwent();
my @passwd = getpwent;
my($username, $passwd, $uid, $gid, $quota, $comment, $name, $dir,
$shell) = @passwd;
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 12 Dec 2000 08:10:51 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: need help with split
Message-Id: <3A3631EB.61C94473@home.com>
Joe wrote:
>
> I got 2 people telling me I missed the point, so I probably am =)
He has seen the light! Hallelujah, brother!
> Jim posted 2 codes, first one with split and second one with match.
> I understand about what you are saying about the first one:
>
> It does not generate any warnings, but it returns wrong data to wrong
> variable.
Yes, exactly.
> What I tried was the second code he
> posted (with matching), and here's what I have:
>
> [snip of code, sample output kept]
>
> id : |MVCD05|
> Use of uninitialized value at tt.pl line 23, <DATA> chunk 3.
> call : ||
> copies: |1,2|
> lang : |SPA|
> title : |Residencia San Juan de La Penitencia|
>
> [...]
>
> My question is, should i be concerned with such
> warning messages as shown above?
That's up to you. The warning itself is legitimate, but you'll have to
decide what to do with it. If there's *supposed* to be something in
every field, then the warning tells you that either your regexp or your
data has something wrong with it. If it's okay to have empty fields,
then you probably just want to default them to something (after the
match) to shut up the warning:
$callnum ||= '';
Unless $callnum can have a value like 0 which would be read as false.
Then you'll want to use defined instead:
$callnum = '' unless defined $callnum;
'' (the empty string) is just a dummy to shut up -w. If some other value
makes more sense as a default for you, use that instead.
Optionally, you could disable warnings (locally!) but I don't recommend
that, because you could silence something that you do want to hear
about.
-mjc
------------------------------
Date: Tue, 12 Dec 2000 12:35:51 -0500
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: networking...
Message-Id: <9coc3ts3g8chnclvhpeg1pvrp2mg6r76il@4ax.com>
On Sun, 10 Dec 2000 20:51:27 +1100, mgjv@tradingpost.com.au (Martien
Verbruggen) wrote wonderful things about sparkplugs:
>On Sun, 10 Dec 2000 00:18:20 -0800,
> Rucus20 <rucus20@hotmail.com> wrote:
SNIP
>
>Martien
MV --
--You need to emote. Let these things out. You will have an ulcer
otherwise.
--Of course Rucus20 is in fact from Mars where Martians write really
complicated programs and give them away for free. They are also known
under the name Netscape.
lmoran@wtsg.com
print "\x{263a}"
------------------------------
Date: Tue, 12 Dec 2000 13:31:00 -0500
From: "mk" <koke36@hotmail.com>
Subject: New to Perl - script runs in IDE but not on server
Message-Id: <915r77$4ji$1@news.kellnet.com>
I am an experienced administrator, but not a Perl programmer. We have a
script we purchased for our site that was written for Unix and we are trying
to run it on Linux. I have downloaded and may purchase Perl Builder 2.0
(any input here would be appreciated) in order to test the script. By the
way, the authors have decide to ignore our requests for assistance.
I suspect there are permissions problems (at least some of the problem) but
there may be some slight difference in running the script on Linux vs Unix -
I don't know yet. But, if I load PB2 as root and run the script in the IDE
I get output (however, the output is not viewable by clicking the view in
browser button, it is viewable only after I move the output file to the
webserver). The script is supposed to build a graph using GD.pm and
Graph.pm but they do not show up in the IDE (the image file names do, but
they have 0 length). As far as I can tell GD is installed correctly. If I
run PB2 as a user - I get no html output. This is why I think there may be
permissions problems (0755 is what it is set to for the script and the
associated html document that the input form resides in).
In the webserver log file (apache that comes with RH 6.2) there is the
following error:
"undefined subroutine &main::open_error called at line ..." and then a
"premature end of script headers..." error after that.
The sub opens and writes to a counter file - what the counter does I am not
sure so far. Anyway,
If there is any input on permissions that I am missing or if there is some
interest in assisting in getting the script running, let me know.
Mike Kokinda
------------------------------
Date: Tue, 12 Dec 2000 17:28:47 GMT
From: Telecommuter@Visto.com
Subject: ON - INTERNET TELE COMMUTE ONLY - PERL - Java - Js - css - html - DreamWeaver
Message-Id: <jftZ5.8849$c32.1917186@typhoon.san.rr.com>
*** TELE COMMUTE ONLY ****
WEB PAGE * PERL * PROGRAMMER
MUST HAVE EXCELLENT EXPERIENCE WITH:
* DREAMWEAVER (Large Domain Mgt.) PREFERRED
* DHTML AND CSS CAPABILITIES OF DREAMWEAVER
* WINDOWS NT 4.0 IIS 5.0 (server)
* WEB PROGRAMMING: PERL / CGI / JavaScript / DHTML / CSS / JAVA
* PROGRAMMING: C / Java
***** ON A SCALE FROM 1 - 10 PERL must be 10 *****
***** ON A SCALE FROM 1 - 10 NT4.0 ISS SERVER = 10 ***
15 TO 20 HOURS PER WEEK
$15.00 to $25.00 per hour commensurate with experience.
* Using a Remote Control software utility called TIMBUKTU
* 2 people can work on the same computer simultaneously
even though thousands of miles apart..
* Timbuktu has an audio channel and chat features.
* High-Bandwidth Not necessary, but PREFERRED.
* Specific "Log-On' Schedule required.
* Flexible
* Prefer Mornings: Pacific Standard Time (PST),
but afternoons, ok.
* 2 to 3 hours per remomte 'log-on' session using Timbuktu
* 2 to 3 times per week minimum.
* Some work done off-line, but this is PRIMARILY a
real-time, log-on position.
* Instead of having a specific schedule at an office,
a specific computer log-on schedule is required.
* Mainly, position is for highly qualified 'back-end'
programmers to use their skills on front-end web
page programming mainly using PERL & JavaScript.
* Please respond directly to:
Telecommuter@Law.com
++++++ MUST INCULDE +++++++
+ RESUME / CV
+ URL's DEMONSTRATING WEB PAGE PROGRAMMING WORK
+ NEWSGROUP THAT YOU SAW THIS ANNOUNCEMENT
------------------------------
Date: Tue, 12 Dec 2000 15:46:22 GMT
From: manon_bertolini@mantacorp.com
Subject: open window in Perl?
Message-Id: <915h8b$hiq$1@nnrp1.deja.com>
Hi there,this may be a very silly question ...
i am a newbie - I need to generate the HTML to open a new small window,
but this does not actually have a HTML URL ... is this possible? May I
please have a sample snippet?
ie:
print "WIndow.open(NO_URL ...,param2.param3
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>POLL RESULTS</TITLE>\n";
print "</HEAD>\n";
etc...
Manon
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 12 Dec 2000 16:25:45 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: open window in Perl?
Message-Id: <915jht$jrc$1@nnrp1.deja.com>
You could use the TARGET parameter in your calling html-document.
Example:
<A HREF="http://www.yourdomain.com/cgi-bin/script.pl"
TARGET="NEWWINDOW">
If that window does not exist, a new one will pop up (at least with IE).
Or you could use JS in the calling document to do the same:
window.open('http://www.yourdomain.com/cgi-bin/script.pl', 'NEWWINDOW');
Good Luck!
--
Ciao,
SimBean.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 12 Dec 2000 17:01:54 GMT
From: manon_bertolini@mantacorp.com
Subject: Re: open window in Perl?
Message-Id: <915lls$ln5$1@nnrp1.deja.com>
Actually I got it - sorry. The only weird thing is it works fine in
Netscape 4.7 but opens two windows in IE. One is fine, and the other
says:
Not Found
The requested URL /Blank.html was not found on this server.
In a web sample, Blank.HTML was the supplied code. I actually don't
have a HTML file to specify because Perl generates a new file.
Any suggestions? Here's the code
function openWindow()
{
window.open("Blank.html","MainWindow","toolbar=no,location=no,directorie
s=no,status,menubar=no,scrollbars,resizable=no,copyhistory=yes,width=500
,height=350");
And then:
<form name=poll action="/cgi-bin/Instapoll.cgi" method="post"
target="MainWindow" onSubmit="openWindow()">
}
In article <915h8b$hiq$1@nnrp1.deja.com>,
manon_bertolini@mantacorp.com wrote:
> Hi there,this may be a very silly question ...
>
> i am a newbie - I need to generate the HTML to open a new small
window,
> but this does not actually have a HTML URL ... is this possible? May
I
> please have a sample snippet?
>
> ie:
> print "WIndow.open(NO_URL ...,param2.param3
> print "<HTML>\n";
> print "<HEAD>\n";
> print "<TITLE>POLL RESULTS</TITLE>\n";
> print "</HEAD>\n";
>
> etc...
>
> Manon
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 12 Dec 2000 16:51:10 +0100
From: Michael <mischay@gmx.de>
Subject: Oracle 06401-error while trying to connect
Message-Id: <3A36496E.C5E3EA8@gmx.de>
Hello,
I installed DBD::Oracle and all modules I need to connect to my Oracle 8
database which resides on a host in my network, but I can't connect
myself to it. I always get the following error:
DBI->connect() failed: ORA-06401: NETCMN: invalid driver designator (DBD
ERROR:OCIServerAttach) at ./db.pl line 21
I already tried different kinds of syntax but I never could connect.
Can anybody tell me what I do make wrong?
My code looks like this:
#!/usr/bin/perl -w
use DBI;
use DBD::Oracle qw(:ora_types);
$dbh = DBI->connect('dbi:Oracle:', q{user/passw@TEST.world}) or die
"Cant connect to Oracle Database: $DBI::errstr\n";
exit;
------------------------------
Date: Tue, 12 Dec 2000 09:06:27 -0500
From: Paula Powell Sapienza <p_sapienza@hotmail.com>
Subject: Passing parameter to CGI in webpage link
Message-Id: <3A3630E3.7713DBE@hotmail.com>
I'm trying to write a script that, depending on a parameter passed to
it,
will run one of three subroutines. The trick is that I wish to
implement this from
within a web page.
How does one pass a command-line (or otherwise) parameter to a Perl
script? Say, from a link in a webpage? (i.e., <a href="mything.cgi?4">)
-- or
some other syntax? Perhaps I have to use a Javascript?
Thank you.
Filipp Sapienza
Cu-Denver
------------------------------
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 5090
**************************************