[18296] in Perl-Users-Digest
Perl-Users Digest, Issue: 464 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 11 11:05:31 2001
Date: Sun, 11 Mar 2001 08:05:08 -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: <984326708-v10-i464@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 11 Mar 2001 Volume: 10 Number: 464
Today's topics:
Re: "uninitiatlized value" errors? (Garry Williams)
Re: "uninitiatlized value" errors? (Garry Williams)
cgi redirect not working <replytogroup@nowhere.com>
Re: cgi redirect not working <tony_curtis32@yahoo.com>
Re: cgi redirect not working <godzilla@stomp.stomp.tokyo>
Detecking when new files are present, (Michael Chapman)
Re: Detecting User Country in CGI Script (Mihai N.)
Re: Grokking map and grep <abe@ztreet.demon.nl>
Re: How can I create files in directories other than th <galen.menzel@mail.utexas.edu>
Re: Maintaining the number format and not exponential <m0rejunkmail@home.com>
multidimensional arrays <eglamkowski@worldnet.att.net>
Re: newbie Q : problems with using 'use lib qw(....' to <nospamplease@thankyou.com>
Re: newbie Q : problems with using 'use lib qw(....' to <nospamplease@thankyou.com>
Re: Objects in Perl <jon_rew@learn-it.demon.co.uk>
Re: Objects in Perl <flavell@mail.cern.ch>
Re: Objects in Perl <bart.lateur@skynet.be>
POP3 Password Change <anton.bawab@roches.vsnet.ch>
Re: POP3 Password Change (Alan Barclay)
Re: using Perl for B2B? <michael-a-mayo@att.net>
Re: using Perl for B2B? (Craig Berry)
Re: What's wrong with ... (Garry Williams)
Re: Why glob doesn't take a list? (Craig Berry)
Re: Why glob doesn't take a list? <bart.lateur@skynet.be>
Re: Why glob doesn't take a list? <bart.lateur@skynet.be>
Re: Would LOVE help sorting results numerically - clear (Jay Tilton)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 11 Mar 2001 13:53:31 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: "uninitiatlized value" errors?
Message-Id: <vrLq6.92$by1.9212@eagle.america.net>
On Sat, 10 Mar 2001 23:43:48 -0500, Tad McClellan <tadmc@augustmail.com> wrote:
>John A. Grant <jazrant@zsc.nrcan.zc.ca> wrote:
>>"Tad McClellan" <tadmc@augustmail.com> wrote in message
>>news:slrn9ack2f.9vo.tadmc@tadmc26.august.net...
>>> John A. Grant <jazrant@zsc.nrcan.zc.ca> wrote:
>> [...]
>>> When perl says "uninitialized value" you should think "undef".
>>> You are using the special "undef" value somewhere in your program.
>>
>> Yes, I am using "undef", here:
>> DoIt($reason,$title,$config,\%captions,\%param,
>> $param{$VAR_EMAIL},undef,undef,1,$font3);
>>
>> In the function, I have:
>> my ($reason, $title, $config, $refcaptions, $refparam,
>> $to, $cc, $bcc, $ccquery, $font3)=@_;
>> ...
>> if($cc) ...
>
>
> if( defined $cc ) ...
There's something else going on here. `if ($var)' is exempt from that
warning. Actually, using a variable in boolian context exempts it:
perlsyn:
Declarations
...
If you enable warnings, you'll be notified of an
uninitialized value whenever you treat `undef' as a string
or a number. Well, usually. Boolean ("don't-care")
contexts and operators such as `++', `--', `+=', `-=', and
`.=' are always exempt from such warnings.
$ perl -wle '$x = undef;if ($x) {print "true"} else {print "false"}'
false
$
--
Garry Williams
------------------------------
Date: Sun, 11 Mar 2001 13:55:30 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: "uninitiatlized value" errors?
Message-Id: <mtLq6.93$by1.9212@eagle.america.net>
On 10 Mar 2001 20:05:29 -0600, Tony Curtis <tony_curtis32@yahoo.com> wrote:
>>> On Sat, 10 Mar 2001 20:54:40 -0500,
>>> "John A. Grant" <jazrant@zsc.nrcan.zc.ca> said:
>
>> Yes, I am using "undef", here:
>> DoIt($reason,$title,$config,\%captions,\%param,
>> $param{$VAR_EMAIL},undef,undef,1,$font3);
>
>> In the function, I have: my ($reason, $title,
>> $config, $refcaptions, $refparam, $to, $cc, $bcc,
>> $ccquery, $font3)=@_; ... if($cc) ...
>
>At which point $cc needs to have a defined value, as you
>are interrogating its value in a boolean context.
>
>If you want to pass undef over, you need to change the
>test to be
>
> if (defined $cc) ...
No you don't. See my followup to Tad's post.
--
Garry Williams
------------------------------
Date: Sun, 11 Mar 2001 15:42:00 -0000
From: "st" <replytogroup@nowhere.com>
Subject: cgi redirect not working
Message-Id: <98g6e2$1q6$1@news5.svr.pol.co.uk>
I want one script to redirect to another website or script these methods are
not working
print $q->redirect( =>uri 'http://www.google.com');
or
print $q->redirect('http://www.google.com');
Is there any methods of redirecting to another script
Many Thanks
------------------------------
Date: 11 Mar 2001 09:48:38 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: cgi redirect not working
Message-Id: <87k85w71d5.fsf@limey.hpcc.uh.edu>
>> On Sun, 11 Mar 2001 15:42:00 -0000,
>> "st" <replytogroup@nowhere.com> said:
> I want one script to redirect to another website or
> script these methods are not working
> print $q->redirect( =>uri 'http://www.google.com');
^-----^
print $q->redirect( -uri => 'http.......' );
from "perldoc CGI", "GENERATING A REDIRECTION HEADER".
> print $q->redirect('http://www.google.com');
Correct.
> Is there any methods of redirecting to another script
What you've done above. "doesn't work" tells us nothing.
If you want some help you have to supply details, like
perl's error messages and contextualised code (e.g. is $q
actually set to a CGI object?), have you already output a
$q->header()?
hth
t--
The avalanche has already started.
It is too late for the pebbles to vote.
------------------------------
Date: Sun, 11 Mar 2001 07:57:45 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: cgi redirect not working
Message-Id: <3AABA079.89C224A6@stomp.stomp.tokyo>
st wrote:
> I want one script to redirect to another website or
> script these methods are not working
> print $q->redirect( =>uri 'http://www.google.com');
> or
> print $q->redirect('http://www.google.com');
> Is there any methods of redirecting to another script
"Are there any methods for...."
Six-thousand-five-hundred plus lines of CGI.pm are
not needed to accomplish this task, or most often,
to fail to accomplish this simple task.
print "Location: http...url path\n\n";
Godzilla!
--
@ø=(a .. z);@Ø=qw(6 14 3 25 8 11 11 0 17 14 2 10 18);
$§="\n";$ß="\b";undef$©;print$§x($Ø[4]/2);
for($¡=0;$¡<=$Ø[2];$¡++){foreach$¶(@Ø){
$ø[$¶]=~tr/A-Z/a-z/;if(($¡==1)||($¡==$Ø[2]))
{$ø[$¶]=~tr/a-z/A-Z/;}print$ø[$¶];if($¶==0)
{print" ";}if($¶==$Ø[12]){print" !";}&D;}
print$ßx($Ø[4]*2);}print$§x($Ø[10]*2);
sub D{select$©,$©,$©,.25;}exit;
------------------------------
Date: 11 Mar 2001 03:32:29 -0600
From: kreios*@hotmail.com (Michael Chapman)
Subject: Detecking when new files are present,
Message-Id: <Xns9061112A9534Bnothotmailcom@209.189.89.243>
I have the task of propagating huge zip files from the WAN when thaey have
been FTP'd to a certain (known) directory and then I need to move them to
another server on a local server. All of the files transfered have a start /
stop file indicating that they have been FTP'd. After the zip files have
been moved and unziped, they are deleted. We also know what the next FTP
directory is because the directory number is increased by 1. I would like to
know what the best possible way is to detect when the new folder has been
added and then move the zip files, unzip them and then remove the zip files
only. Any ideas would be appreciated!
Thanks!
Michael Chapman
Attachmate Corp.
-----= 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: Sun, 11 Mar 2001 08:33:55 GMT
From: nmihai_2000@yahoo.com (Mihai N.)
Subject: Re: Detecting User Country in CGI Script
Message-Id: <90616292MihaiN@24.1.64.32>
Juha.Laiho@iki.fi (Juha Laiho) wrote in <98dfg0$d61$1@ichaos.ichaos-int>:
Not the country. I remember it was a big talk about this when
France asked Yahoo (and others) to block the search for nazi stuff
for the clients in France.
But if in fact what you wish to find out is the language or the acceptable
encoding, a method is to check in the header of the request.
Most of the browsers will include in the request header the
Accept-Language and Accept-Charset fields.
Mihai
------------------------------
Date: Sun, 11 Mar 2001 14:21:23 +0100
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Grokking map and grep
Message-Id: <tetmatgn7m170l774m5g39ch6mfjudhm94@4ax.com>
On Wed, 07 Mar 2001 11:07:55 GMT, pjlees@ics.forthcomingevents.gr
(Philip Lees) wrote:
> On Tue, 06 Mar 2001 12:48:12 +0100, Philip Newton
> <pne-news-20010306@newton.digitalspace.net> wrote:
>
> >On Tue, 06 Mar 2001 10:19:10 GMT, pjlees@ics.forthcomingevents.gr
> >(Philip Lees) wrote:
> >
> >> print OUT map { ++$count; join ',', @$_ } sort { $$a[0] <=> $$b[0] }
> >> map { [ split /,/ ] } grep { /^\d+,/ } (<IN>);
> >
> >Or you could remember the original line:
[ Schwartz Transform snipped ]
> >> 2. Is there any trick for getting the scalar result of the leftmost
> >> map _as well as_ the list ouput, so that I could get rid of that
> >> annoying $count variable?
> >
> >Well, the scalar result of map is the number of elements generated --
> >so assigning to an array and using that array in scalar context will
> >give you the answer. I can't think of how to do it without the
> >intermediate array variable, however.[1]
If you _insist_ on doing away with the intermediate variables you could
write:
printf OUT "\n\nTotal: %u\n",
scalar map { print OUT $_->[1] }
sort { $a->[0] <=> $b->[0] }
map { [ (split /,/, $_, 2)[0], $_ ] }
grep { /^\d+,/ } <IN>;
Although I think I'd never write that in a real program.
> I was afraid of that. What I was hoping for was some environment
> variable that counts the elements in a map. I couldn't find one in
> perlvar, but I suppose that Perl must 'know' how many elements map has
> processed.
The number of elements *processed* is not what you are interested in,
it's the number of elements "produced" by map():
my @array = map { ($_, $_+1) } (0, 2, 4, 6, 8);
print "@array\n";
--
Good luck,
Abe
perl -e '$_=sub{split//,pop;print pop while@_};&$_("rekcah lreP rehtona
tsuJ")'
------------------------------
Date: Sun, 11 Mar 2001 03:38:06 -0600
From: Galen Menzel <galen.menzel@mail.utexas.edu>
Subject: Re: How can I create files in directories other than the one that the perl script executes from?
Message-Id: <3AAB477E.4EBB0457@mail.utexas.edu>
Costas Tzimeas wrote:
> since I want the script to be as general as possible, in order to move it to
> many different directories (with subtle variable changes), I get the path of
> the executing script by using a system call of "pwd" and with some string
> editing,
> I get it to work.
> Is there a better way of doing this?
How about using the chdir function to change the current working directory of
the perl process to wherever you want to put the files?
galen
------------------------------
Date: Sun, 11 Mar 2001 14:46:48 GMT
From: FORM Rookie <m0rejunkmail@home.com>
Subject: Re: Maintaining the number format and not exponential
Message-Id: <3AAB94B8.9AFF7CAD@home.com>
FORM Rookie wrote:
> $adder = 5;
> $form_data = $formdata{'data'}; #data=123456789123456
> $result = $adder + $form_data;
> print "$result";
> #the result comes out as an exponential number 1.123456789123e+15
> #actual result that I wanted should read 123456789123461
--------------------------------------------
Okay, I really didn't want to start anything in here. But okay, I take
it that GODZILLA has went too far in performing a simple function that I
needed to create.
Now, URI suggested, "use Math::BigInt to keep it as a long integer."
Okay, my question is: How do you exactly do that?
I kinda new to PERL and just starting out. Can we all please stay with
the subject? :-)
Thanks for your help,
FORM Rookie
------------------------------
Date: Sun, 11 Mar 2001 15:44:49 GMT
From: Edward Glamkowski <eglamkowski@worldnet.att.net>
Subject: multidimensional arrays
Message-Id: <3AAB9E14.6800@worldnet.att.net>
I can't make the leap of logic from the "access and printing" examples
for multidimensional arrays to what I want to do:
@multidimarray = (
[ 100, 149, 237, "description" ],
[ 72, 61, 139, "description" ],
[ 0, 191, 255, "description" ],
[ 135, 206, 235, "description" ],
);
for $i (0 .. $#multidimarray) {
@one_array = @multidimarray[$i];
# Normalize the values:
$elem1 = $one_array[0] / 255;
$elem2 = $one_array[1] / 255;
$elem3 = $one_array[2] / 255;
$elem4 = $one_array[3]; # text string!
# ... yadadada
}
I just get "Use of uninitialized value" for each $elem. Presumably
it is the "@one_array = @multidimarray[$i];" line that is wrong, but
it isn't obvious to me what is wrong about it. Any help is much
appreciated :)
------------------------------
Date: Sun, 11 Mar 2001 03:53:17 -0500
From: "null" <nospamplease@thankyou.com>
Subject: Re: newbie Q : problems with using 'use lib qw(....' to point to modules
Message-Id: <98feda$itk$1@bob.news.rcn.net>
Thank you again for your help
Here's my script :
#!/usr/bin/perl
use strict;
use lib qw(/home/mydomain/mydomain-www/perlmods/GD-1.32/);
use Config; # now we can load it safely
#use GD;
use CGI::Carp 'fatalsToBrowser';
my $im;
my $white;
my $black;
my $red;
my $blue;
$im = new GD::Image(100,100);
$white = $im->colorAllocate(255,255,255);
$black = $im->colorAllocate(0,0,0);
$red = $im->colorAllocate(255,0,0);
$blue = $im->colorAllocate(0,0,255);
$im->transparent($white);
$im->interlaced('true');
$im->rectangle(0,0,99,99,$black);
$im->arc(50,50,95,75,0,360,$blue);
$im->fill(50,50,$red);
binmode STDOUT;
print "Content-type: image/png\n\n";
print $im->png;
If I comment out the line that tries to wire in the newer GD.pl and the use
Config line and uncomment the use GD line, I will get a broken image icon.
Then, if I also change the last two lines to :
print "Content-type: image/gif\n\n";
print $im->gif;
I get a gif image a-ok.
Thank you for the hint about the CGI::Carp line - it gives me the following
additional info along with the 500 error:
Software error:
Can't locate object method "new" via package "GD::Image" at maydaytest.pl
line 17.
Changing the path specified for the newer GD module (from the path to
directory containing GD.pm to the path to GD.pm itself) doesn't change the
result...
Does the error message clarify things?
thank you,
brian
"Charles K. Clarkson" <c_clarkson@hotmail.com> wrote in message
news:D5C3718ADF21E201.90E3C0E4AF765BD6.CB9856228A96C634@lp.airnews.net...
> null <nospamplease@thankyou.com> wrote:
>
> [SNIP]
> :
> : The previous version of the script would work fine when told to output
> gifs
> : and would at least give me a broken image icon when told to kick out
png's
> : (I have been very careful to always upload in ascii and chmod 755 the pl
> : file), but now all that I can get are 500 internal server errors.
>
> Add this line, it will allow you to see any errors in your browser
> window:
>
> use CGI::Carp 'fatalsToBrowser';
>
> :
> : Uncommenting the #use GD line will give me the broken image icon again
>
> Did you test this with .gif and .png formats like your last script?
>
> This might indicate that GD.pm was found. and there is an error
> sending to the browser. Show us the code for that part.
>
> : (so I am sure that i didn't introduce any other errors accidentally) -
it
> seems
> : that Perl can't find my GD.pm. The path given to me by my host to use
was
> : "/home/mydomain/mydomain-www/perlmods/GD-1.32/GD.pm", I was
> : still getting the 500 error and, during testing on my own machine, I got
> the
> : "point to the directory containing the file, not the file itself" error
> (although
> : using /home/mydomain/mydomain-www/perlmods/GD-1.32/ or
> : /home/mydomain/mydomain-www/perlmods/GD-1.32 have not fixed the
> : problem at my site or locally, where I used the equivalent paths
beginning
> : with C:\).
> :
> : The problem definitely seems to be that Perl cannot find GD.pm, but I
> don't
> : know what I've done wrong.
>
> If perl can't find the module it will give an error similar to:
>
> Can't locate StatusFile.pm in
> @INC (@INC contains: ../rt/modules/ C:/Perl/lib C:/Perl/site/lib .)
> at prog.pl line 43.
>
>
> You should be able see to it with the CGI::Carp line above.
>
>
> HTH,
> Charles K. Clarkson
>
>
>
>
------------------------------
Date: Sun, 11 Mar 2001 04:00:41 -0500
From: "null" <nospamplease@thankyou.com>
Subject: Re: newbie Q : problems with using 'use lib qw(....' to point to modules
Message-Id: <98fer5$km1$1@bob.news.rcn.net>
> Thank you for the hint about the CGI::Carp line - it gives me the
following
> additional info along with the 500 error:
>
> Software error:
> Can't locate object method "new" via package "GD::Image" at maydaytest.pl
> line 17.
doh - i meant "instead of" and not "along with"
*bangs head on desk*
=D
------------------------------
Date: Sun, 11 Mar 2001 12:48:45 -0000
From: "Jonathan Rew" <jon_rew@learn-it.demon.co.uk>
Subject: Re: Objects in Perl
Message-Id: <984315027.28761.0.nnrp-14.c2def305@news.demon.co.uk>
"Chris Stith" <mischief@velma.motion.net> wrote
> Don't assume the object orientation is more efficient. It can be more
> promgrammer efficient, but isn't always. It can be more running time
> efficient, but isn't always. It can be more memory efficient, but
> often is not (usually is not, in my experience).
>
> The methodology and theory under which you choose to program should be
> mostly decided by with what ideaology you are most comfortable. Second
> to that, code reuse and maintenance time should be the improtant factors.
> Beyond those, running time and memory efficiency can be important to
> particular projects.
>
Perhaps, I should explain where I'm coming from and what I'm hoping to do:
I learnt Perl from 'Learning Perl on Win32 Systems by Randall L.
Schwartz, et al - O'Reilly, which largely uses the procedural/function based
approach (in the CGI programming section it introduces references and OO
programming);
I have a Website for which I have written some Perl programs to do
various things (mainly, to search through a number of fairly large text
files to find the user's input);
I am using Cascading Style Sheets on the rest of the site and want to be
able to use them on the searching programs;
the examples given in CGI.pm, which offers some support for CSS, use
references and I don't know anything about them;
as far as I am aware, I cannot use partly object oriented and partly
procedural programming in the same program so if I want to incorporate css
in my Perl programs, I am going to have to learn how to write OO programs in
Perl
That's it, I think.
--
Jon
------------------------------
Date: Sun, 11 Mar 2001 14:28:01 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Objects in Perl
Message-Id: <Pine.LNX.4.30.0103111359450.15920-100000@lxplus003.cern.ch>
On Sun, 11 Mar 2001, Jonathan Rew wrote:
> I am using Cascading Style Sheets on the rest of the site and want to be
> able to use them on the searching programs;
> the examples given in CGI.pm, which offers some support for CSS, use
> references and I don't know anything about them;
what exactly do you mean by 'the examples use references' ?
I'm looking at http://stein.cshl.org/WWW/software/CGI/
When you say "references" are you perhaps looking at these bits? :
The value of this parameter may be a scalar, in which case it is
incorporated directly into a <STYLE> section, or it may be a hash
reference.
[..]
Pass an array reference to -style in order to incorporate multiple
stylesheets into your document.
If so, then this isn't directly related to your level of expertise
with _object_oriented_ methods. For hash references and array
references see e.g p.192 in Learning Perl 2nd ed., or chap 4 of
Programming Perl, or the perlref manpage/perldoc. Or try perldoc
perlreftut.
At http://stein.cshl.org/WWW/software/CGI/#stylesheets
in fact the documentation seems to be using function calls, rather
than object method calls, in this area.
> as far as I am aware, I cannot use partly object oriented and partly
> procedural programming in the same program so if I want to incorporate css
> in my Perl programs, I am going to have to learn how to write OO programs in
> Perl
Sorry, but I think you're a bit confused here.
First of all, I _think_ that what you're describing can be done with
function calls in CGI.pm; maybe your problem is that the documentation
often only shows the object method calls, and you're not comfortable
with turning those into the corresponding function-oriented calls.
But anyway, even if you use object calls, you can do it by following
the recipes in the documentation. There's no need to develop the
expertise to be able to write your own object-oriented libraries/
modules, before you can take advantage of object method calls in
existing libraries/ modules. Just get on with it by following the
recipes in the documentation, and maybe asking the odd question (on
c.l.p.modules, presumably) if you seem to be stuck.
When you're referring to documentation, though, it's really useful if
you say exactly what you're reading that's giving you trouble, then
people can offer you better-focussed answers to your worries.
hth, good luck
------------------------------
Date: Sun, 11 Mar 2001 15:18:12 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Objects in Perl
Message-Id: <uc5natcg2uqsm5m8innf7t5cbad4eqslh7@4ax.com>
Jonathan Rew wrote:
>I've been using Perl just as a procedural language for all my programs
>to date. I'm certain that it is much more efficient to use objects in Perl,
Huh? For you, or for the computer? BEcause the latter most definitely
isn't true.
>but can't make head or tail of them. Can anyone suggest a good place to
>look, book to read, etc?
Start with Randal Schwartz' tutorial. Oh, I think that it is included
with the Perl distribution as of 5.6.0, under the name "perlboot".
And then there's the book: Damian Conway, "Object Oriented Perl". See
<http://www.csse.monash.edu.au/~damian/> for his own homepage. For what
I've heard, it's one of the best books on OOP available, Perl or not
Perl.
--
Bart.
------------------------------
Date: Sun, 11 Mar 2001 14:01:20 +0100
From: "Anton Bawab" <anton.bawab@roches.vsnet.ch>
Subject: POP3 Password Change
Message-Id: <3aab760e@news.vsnet.ch>
Hi,
Twice a year we create some 150 POP accounts for our new students. These are
created with a default password. Since Microsoft Outlook Express does not
offer the feature of password change we revert to an old version of Eudora
to do that.
I am trying to put this functionality in a Perl script that would prompt for
a user name, old password and a new one and then do the change... the change
password procedure however is not in any of the POP modules I have seen,
neither is it mentioned in any of the POP related RFC standards.
Has anybody done this before or found it mentioned in any documentation?
Thank you,
AB.
------------------------------
Date: 11 Mar 2001 14:37:05 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: POP3 Password Change
Message-Id: <984321390.383758@elaine.furryape.com>
In article <3aab760e@news.vsnet.ch>,
Anton Bawab <anton.bawab@roches.vsnet.ch> wrote:
>I am trying to put this functionality in a Perl script that would prompt for
>a user name, old password and a new one and then do the change... the change
>password procedure however is not in any of the POP modules I have seen,
>neither is it mentioned in any of the POP related RFC standards.
That's because the POP3 protocol doesn't support password change. Pick
another protocol which does.
------------------------------
Date: Sun, 11 Mar 2001 08:35:11 GMT
From: "Michael A Mayo" <michael-a-mayo@att.net>
Subject: Re: using Perl for B2B?
Message-Id: <3NGq6.4615$fw6.336702@bgtnsc04-news.ops.worldnet.att.net>
----- Original Message -----
From: "Hermel Michaud" <hermel_michaud@hotmail.com>
> Hello, I don't know Perl too much...Im currently learning Java Server
> Programming for building b2b applications.
> I want to specialize in building b2b for small and medium companies.
> Someone told me Java technologie is too complicated for my needs and
> recommended Perl.
Keep in mind that Java is a very poweful buzzword these days. Many
buisnesses are "standardizing" on java. You may find that if you use Perl
instead of Java, your project gets less support from higher-ups / gets less
funding / is less likely to be noticed / you and your team members are less
likely to be promoted. Obviously, it depends on your particular situation.
But java is such a safe choice that it's probably the "right" choice unless
you _know_ for sure you have the support there. And, if you plan on working
for other companies in this area, java is pretty much a must.
-Mike
------------------------------
Date: Sun, 11 Mar 2001 08:49:52 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: using Perl for B2B?
Message-Id: <tamf1gq42302@corp.supernews.com>
Hermel Michaud (hermel_michaud@hotmail.com) wrote:
: Hello, I don't know Perl too much...Im currently learning Java Server
: Programming for building b2b applications.
: I want to specialize in building b2b for small and medium companies.
: Someone told me Java technologie is too complicated for my needs and
: recommended Perl.
: I would appreciate it if someone can tell me if this is true...
: Is Perl ideal for building b2b web sites?
: Thanks in advance to any response!
B2B is a buzzword, not a technology or particular specification. Which
tools are appropriate depends on the details of the job at hand. In
general, Perl is much easier to use for relatively small and less
performance-critical web apps, while Java shines on more complex and
higher-load apps, but is in general harder to work with.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "When the going gets weird, the weird turn pro."
| - Hunter S. Thompson
------------------------------
Date: Sun, 11 Mar 2001 15:02:27 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: What's wrong with ...
Message-Id: <7sMq6.98$by1.9379@eagle.america.net>
On Mon, 05 Mar 2001 10:08:09 +0100, Christoph Neubauer
<christoph.neubauer@siemens.at> wrote:
>I tried several variations, but ...
>
>
>my @ima_list = glob "$ENV{SESO_IMAGES}/*";
>(system ( "/bin/uncompress", "@ima_list" ) == 0 ) or (die "ERROR>
>uncompress failed: $! <-");
>
>... always gives ...
>
>/home/sn_root/opt/seso/images/image256.Z
>/home/sn_root/opt/seso/images/image512.Z: No such file or directory
>ERROR> uncompress failed: Illegal seek <- at errtest.pl line 9.
Others have pointed out the problem with the parameter passed to
system().
I note that your error message is printing $! when system() returns
non-zero. The value of $! is not relevant in this case. It's
whatever happened to be there since errno was last set.
You could print the returned status, which is in $? to be more
informative. See the system() section of the perlfunc manual page for
information about how to interpret the exit status of a child process.
--
Garry Williams
------------------------------
Date: Sun, 11 Mar 2001 08:20:55 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Why glob doesn't take a list?
Message-Id: <tamdb7mnqir0dc@corp.supernews.com>
Antoine Beaupre (LMC) (lmcabea@lmc.ericsson.se) wrote:
: I was just wondering why glob() takes only a $scalar instead of using a
: full @array?
That would be kind of useful, actually.
: You know, I always end up making something like:
:
: sub sglob {
: my (@glob) = ();
: push (@glob, glob($_)) foreach(@_);
: return @glob;
: }
Easier way:
sub sglob {
map { glob } @_;
}
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "When the going gets weird, the weird turn pro."
| - Hunter S. Thompson
------------------------------
Date: Sun, 11 Mar 2001 10:25:42 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Why glob doesn't take a list?
Message-Id: <lmkmat4evi05tt67bbf8vngfcl9je9m8tm@4ax.com>
Craig Berry wrote:
>: I was just wondering why glob() takes only a $scalar instead of using a
>: full @array?
>
>That would be kind of useful, actually.
As an aside: I have the same wondering WRT undef().
--
Bart.
------------------------------
Date: Sun, 11 Mar 2001 10:33:11 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Why glob doesn't take a list?
Message-Id: <r4lmat4t5jqbjfmp4ik3nlsfjp37j4d7ai@4ax.com>
Craig Berry wrote:
>: I was just wondering why glob() takes only a $scalar instead of using a
>: full @array?
>
>That would be kind of useful, actually.
As an aside: I have always wondered the same thing WRT undef().
--
Bart.
------------------------------
Date: Sun, 11 Mar 2001 15:17:08 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Would LOVE help sorting results numerically - clearing up an array issue
Message-Id: <3aab81bf.69021219@news.erols.com>
On Sun, 11 Mar 2001 02:13:07 -0600, "Chris Bell" <cbell@interlog.com>
wrote:
>I want to sort the records by distance, starting with the smallest value.
In more abstract terms, you want to sort a list according to a
numerical value calculated for each element of the list.
perldoc -f sort
perldoc -q sort
How do I sort an array by (anything)?
>I believe I can do this in the "zip_matches" subroutine, and I have found a
>numerical sort in my PERL reference book:
perldoc perlfaq1
What's the difference between "perl" and "Perl"?
> print join(' ', sort { $a <=> $b } @array),"\n";
The block
{ $a <=> $b }
is very flexible. It can call a separate subroutine, e.g.
sort { some_sub($a) <=> some_sub($b) } @array;
sub some_sub {
my @pieces = split /\|/, shift;
my $distance = ... ; #calculations based on @pieces
return $distance;
}
The block is not limited to a single statement. With some
restrictions, anything that can be done in a sub can be pasted into
that sort block.
sort {
my @a_pieces = split /\|/, $a;
my @b_pieces = split /\|/, $b;
my $a_distance = ... ; #calculations based on @a_pieces
my $b_distance = ... ; #calculations based on @b_pieces
$a_distance <=> $b_distance;
} @array
>My problem is that I don't know how to create an array of the "$distances"
>that can be related to my list of matches of records under 50 miles (in sub
>"zipdata").
There's probably no need to do that. Whatever values would go in that
array can be calculated within the scope of the sort statement itself.
On the other hand, if relating a distance value to the list is
otherwise necessary or useful, the standard recommendation is to use a
hash.
sort { $distance_hash{$a} <=> $distance_hash{$b} } @array;
------------------------------
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 V10 Issue 464
**************************************