[18314] in Perl-Users-Digest
Perl-Users Digest, Issue: 482 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 13 18:05:47 2001
Date: Tue, 13 Mar 2001 15:05:15 -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: <984524715-v10-i482@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 13 Mar 2001 Volume: 10 Number: 482
Today's topics:
Re: "uninitiatlized value" errors? <bart.lateur@skynet.be>
Re: "uninitiatlized value" errors? <jazrant@zsc.nrcan.zc.ca>
Re: "uninitiatlized value" errors? (Tad McClellan)
Re: "uninitiatlized value" errors? (Tad McClellan)
Re: "uninitiatlized value" errors? (Tad McClellan)
Re: "uninitiatlized value" errors? (Tad McClellan)
Re: "uninitiatlized value" errors? <mischief@velma.motion.net>
Array Comparison question ("shazad malik")
Re: Array Comparison question <maheshasolkar@yahoo.com>
Autodelete (Michael Chapman)
Re: Autodelete <galen.menzel@mail.utexas.edu>
Re: Autodelete (Tad McClellan)
Behavior of => after newline (Gary E. Ansok)
Re: Behavior of => after newline (Abigail)
Re: Can a regex do this? <webmaster@webdragon.munge.net>
Re: Can a regex do this? <juex@deja.com>
Re: Can a regex do this? (Tad McClellan)
Re: Can a regex do this? (Tad McClellan)
Re: CGI module and file upload <rliu2@ford.com>
CGI on win2000 server timeout question <stujreyn@acs.eku.edu>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 13 Mar 2001 19:19:25 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: "uninitiatlized value" errors?
Message-Id: <e4ssatc2f3n6tdv13uao15sld4kk63rut6@4ax.com>
John A. Grant wrote:
> If I have this on the first line of the program:
²
Your dollar sign certainly looks out of place. I think you meant
my $HELLO="hello";
> is that considered a global, visible to all functions below
> it in the same module? That's what my $MAGIC_NOHTML
It is visible to all functions below it in the same module, but it is
not a global. A global is accessible from anywhere, even from other
files. A lexical always has limited and static scope. The scope, in your
particular case, is probably: anywhere in the source file, that is, if
it's top at the top level. Otherwise, the scope is limited to the
enclosing block (so a file is a kind of block by itself). Also note that
you can put subs together in one block:
{
my $seed;
sub randomize {
$seed = shift;
}
sub rand {
$seed *= $A;
$seed += $B;
$seed %= $M;
return $seed;
}
}
sub foo {
...
}
In this example (incomplete, because the constants $A, $B and $M are not
given), $seed is accessible from both subs, randomize and rand, but NOT
from within foo because it is outside the block, that limits the scope
of $seed.
--
Bart.
------------------------------
Date: Tue, 13 Mar 2001 14:35:24 -0500
From: "John A. Grant" <jazrant@zsc.nrcan.zc.ca>
Subject: Re: "uninitiatlized value" errors?
Message-Id: <98lsvj$5tm16@nrn2.NRCan.gc.ca>
"Chris Stith" <mischief@velma.motion.net> wrote in message
news:tasoa39ehn9534@corp.supernews.com...
> John A. Grant <jazrant@zsc.nrcan.zc.ca> wrote:
> > "Tad McClellan" <tadmc@augustmail.com> wrote in message
> > news:slrn9am0k4.kui.tadmc@tadmc26.august.net...
> >> 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:
> >> > [...]
> > [...]
> >> > #return filename part of pathname
> >> > sub FilenameFromPathname()
> >> ^^
> >> ^^
> >> There you have prototyped the function to take no arguments at all.
>
> > It's not a prototype. it's the function body. There is
> > no prototype. While we're on the subject, I don't mind saying
> > that Perl prototypes suck real bad, at least compared
> > to C++.
>
> Nope. If it was the function body, it would be within
> curlies. Prototypes take parens, and bodies take curlies.
> >> > {
> >> > my ($pathname)=@_;
> >> ^^^^^^^^^
> >>
> >> There you access arguments.
> >> You should fix the prototype, or delete it.
> > It's not a prototype, at least not in the sense that I use
> > prototypes in C++.
>
> It is a prototype. See above. This isn't C++. C++ does use
> parens for prototypes and curlies for bodies. What's your
> argument again?
Initially I started out to explain that you weren't seeing
my {} because they were on the next line, since I use
this form:
sub somefunction()
{
....
}
but I realize now that it's the () that is causing the problem,
not the {}. I never did understand what the purpose of ()
was, since arguments were not enumerated in the (), instead
being passed through @_, but I left the () in I guess, thinking
this was somehow related to the archaic K&R C where
"prototyping" consisted of this:
somefunc();
effectively amounting to telling the compiler "all you need
to know is that this is a function - let me worry about whether
I'm using it correctly or not".
Reviewing perlsub, I see that if I am going to use this form
of my functions:
sub NAME(PROTO) BLOCK
then I should also be listing the arguments (PROTO).
So I've changed functions like this:
sub somefunc()
{
my ($a,$b,$c)=@_;
}
to this:
sub somefunc($$$)
{
my ($a,$b,$c)=@_;
}
It was either that or this:
sub somefunc
{
my ($a,$b,$c)=@_;
}
Right?
[...other corrections - thanks]
--
John A. Grant * I speak only for myself * (remove 'z' to reply)
Radiation Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here
------------------------------
Date: Tue, 13 Mar 2001 13:55:55 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: "uninitiatlized value" errors?
Message-Id: <slrn9asr9r.vnv.tadmc@tadmc26.august.net>
John A. Grant <jazrant@zsc.nrcan.zc.ca> wrote:
>"Garry Williams" <garry@zvolve.com> wrote in message
>news: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
> [...]
>> >> 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.
>>
>> $
> Well, after I agreed with Tad's "if(defined $cc)" suggestion,
> I see you are disagreeing with with him and saying it is ok.
> Both stances seem reasonable to me, but I don't know
> enough about it. Who is right?
I am right if you have an old perl.
Garry is right if you have a new perl.
I've been using Perl so long that I don't notice when warning
messages go away between version releases.
The "exemption" part there was added at some point. Used to
get warnings there in the olden days.
What does "perl -v" say about the version of perl you have?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 13 Mar 2001 14:04:03 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: "uninitiatlized value" errors?
Message-Id: <slrn9asrp3.vnv.tadmc@tadmc26.august.net>
John A. Grant <jazrant@zsc.nrcan.zc.ca> wrote:
>"Tony Curtis" <tony_curtis32@yahoo.com> wrote in message
>news:873dclys9i.fsf@limey.hpcc.uh.edu...
>> >> On Sat, 10 Mar 2001 20:54:40 -0500,
>> >> "John A. Grant" <jazrant@zsc.nrcan.zc.ca> said:
> [...]
>> If you want to pass undef over, you need to change the
>> test to be
>>
>> if (defined $cc) ...
>
> Ok, I will do that. Is passing "undef" and testing for
> "defined" the common/best way to do it?
Yes.
> In C I would have:
> somefunc("some string");
> somefunc(NULL);
>
> and
> void somefunc(char *string)
> {
> if(string) ...
> }
In Perl that would be:
somefunc("some string"); # or, better, somefunc('some string');
somefunc(undef);
sub somefunc {
my($arg) = @_; # convert to pass-by-value semantics by making
# a copy and working with only the copy
if (defined $arg) ...
}
If you had _this_ C case:
somefunc("\0");
Then in Perl it would be:
somefunc(''); # pass the empty string
>> csh is certainly odd :-) Try reading this:
> Well, I never thought I'd be told to use Bourne instead of
> csh in a Perl group.
^^^^^^^^^^^^^^^
Why not?
Because you have heard that csh is good? (where'd you hear that?)
Because Perl is into freedom, and you should use whatever shell
you want?
Because Perl is somehow more csh-ish than sh-ish?
Enquiring minds want to know what the connection is between Perl
and shell-preference.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 13 Mar 2001 14:28:03 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: "uninitiatlized value" errors?
Message-Id: <slrn9ast62.vnv.tadmc@tadmc26.august.net>
John A. Grant <jazrant@zsc.nrcan.zc.ca> wrote:
>"Tad McClellan" <tadmc@augustmail.com> wrote in message
>news:slrn9am0k4.kui.tadmc@tadmc26.august.net...
>> 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:
>> > [...]
> [...]
>> > #return filename part of pathname
>> > sub FilenameFromPathname()
>> ^^
>> ^^
>> There you have prototyped the function to take no arguments at all.
>
> It's not a prototype. it's the function body.
It's not the function body, it is a prototype.
We aren't in C++ anymore Toto.
:-)
>There is
> no prototype.
There is a prototype, and you should still read up on them:
perldoc perlsub
(then decide that you really don't need them)
> While we're on the subject, I don't mind saying
> that Perl prototypes suck real bad, at least compared
> to C++.
How can you comment on Perl's prototypes and not recognize a
Perl prototype when it is used? Something is fuzzy there...
>> > {
>> > my ($pathname)=@_;
>> ^^^^^^^^^
>>
>> There you access arguments.
>> You should fix the prototype, or delete it.
> It's not a prototype, at least not in the sense that I use
> prototypes in C++.
But you aren't writing C++, you are writing Perl, where it *is*
a prototype.
> I understand arrays and I understand scalars. I don't
> understand the syntax of associating a list of names
> with the array of values passed to the function. If there
> are several arguments this makes sense to me:
> my ($arg1,$arg2,$arg3)=@_;
That is a "list assignment". A "list assignment" has a list on
each side of the equals sign.
If there are too many items in the RHS list, they are ignored.
If there are too few items in the RHS list, the corresponding
elements in the LHS list get 'undef'.
> but what do I do when there is only one argument? Do
> I do this:
> my ($filename)=@_;
I recommend the above, only because it allows you to easily add
more arguments should the need arise.
> my ($filename)=$_[0];
That will work too. It is a list assignment with a one-element list
on each side (the RHS is DWIMed into a one-element list).
>> > I still have this problem:
>> > 1703: my $method=$ENV{'REQUEST_METHOD'};
>> > 1704: if($method eq "POST"){
>> > Use of uninitialized value in string eq at contact.cgi line 1704.
>> > Use of uninitialized value in string eq at contact.cgi line 1704.
>> >
>> > Why do I get 2 errors?
>> ^^^^^^
>> You have _zero_ errors.
>> You have 2 warnings there.
> Yeah, yeah, yeah.
Don't be so flip. There is an important difference between the two.
warnings never change the execution of your program, errors do
(or even prevent it from executing in the first place).
If your program was broken without warnings, it will be broken
with warnings. If your program works without warnings, it will
work with warnings.
Cannot say the same about errors.
> My personal philosophy for programming in
> any language is to treat warnings and errors alike. In almost
> all cases, the compiler is much smarter than me.
I agree that you should get no messages at all, warnings or errors.
> No, it didn't here's the complete code:
^^^^^^^^
^^^^^^^^
> my $MAGIC_NOHTML="!";
>
> my $html=1;
> if (substr($message,0,1) eq $MAGIC_NOHTML){
^^^^^^^^
Since this is the complete code, then we have identified the problem!
You never assigned anything to $message before this statement.
> $message=substr $message, 1;
> $html=0;
> }
>> Try adding this at line number 1638.5:
>> print "what the heck happen to the value of \$MAGIC_NOHTML\n" unless
>> defined $MAGIC_NOHTML;
> You're right. It printed the phrase, so it's not defined.
Something is not as you say it is then.
> Sigh. What
> an incredibly powerful but dopey language to debug.
Time to quit circling the issue.
Show us a complete Perl program that we can run that generates
the message, and we will help you fix it.
>> >> >But 2>err doesn't work on my solaris box (also running perl 5.6)
>> >> ^^^^^^^
>> What is the underlining for? You make no further mention of the OS...
>
> I didn't underline it. Tad underlined it in his reply.
Doh! Don't even recognize my own underlining...
> I was told
> to use Bourne instead of csh.
You were told to use the sh instead of csh if you want to redirect
only STDERR, which is a pain in csh. Otherwise it might not make
much of a difference (as long as you never _program_ using csh).
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 13 Mar 2001 15:07:39 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: "uninitiatlized value" errors?
Message-Id: <slrn9asvgb.vs3.tadmc@tadmc26.august.net>
John A. Grant <jazrant@zsc.nrcan.zc.ca> wrote:
> Reviewing perlsub, I see that if I am going to use this form
> of my functions:
> sub NAME(PROTO) BLOCK
>
> then I should also be listing the arguments (PROTO).
>
> to this:
> sub somefunc($$$)
> {
> my ($a,$b,$c)=@_;
> }
>
> It was either that or this:
> sub somefunc
> {
> my ($a,$b,$c)=@_;
> }
(This last one (no prototype) gets my vote)
> Right?
Stand on the shoulders of a giant, and read:
http://www.perl.com/pub/language/misc/fmproto.html
wherein all will be revealed.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 13 Mar 2001 21:45:42 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: "uninitiatlized value" errors?
Message-Id: <tat586a3h5ej4d@corp.supernews.com>
Tad McClellan <tadmc@augustmail.com> wrote:
> John A. Grant <jazrant@zsc.nrcan.zc.ca> wrote:
>> Reviewing perlsub, I see that if I am going to use this form
>> of my functions:
>> sub NAME(PROTO) BLOCK
>>
>> then I should also be listing the arguments (PROTO).
>>
>> to this:
>> sub somefunc($$$)
>> {
>> my ($a,$b,$c)=@_;
>> }
>>
>> It was either that or this:
>> sub somefunc
>> {
>> my ($a,$b,$c)=@_;
>> }
> (This last one (no prototype) gets my vote)
I agree -- sometimes. ;-)
What I mean is, I write mounds of code on some projects
and little on others. Often, I write the whole thing
myself from scratch (with the help of modules when
needed, so not really _entirely_ from scratch when I
say that), but not always. I often work independently
of any other programmers, but not always. The prototypes
can come in handy when you're used to knowing all the
code by heart and then suddenly don't.
I realize my job is a somewhat special case, but I doubt
I'm the only one being the sole staff programmer for a
non-programming shop. When you're used to staring at
your own code and then modify someone else's, it can be
nice to have the extra hints even if they are bother when
yu're familiar with the code.
Chris
--
Christopher E. Stith
Programming is a tool. A tool is neither good nor evil. It is
the user who determines how it is used and to what ends.
------------------------------
Date: Tue, 13 Mar 2001 21:49:18 +0000 (UTC)
From: hallian@hotmail.com ("shazad malik")
Subject: Array Comparison question
Message-Id: <F218B2J4XtliS01qCcW0000f8b6@hotmail.com>
<html><DIV>Hi all -</DIV>
<DIV> </DIV>
<DIV>I'm trying to resolve this issue with two array. When there is a match between the two arrays I'm splice[ing] the array in which case I have removed the element. But the problem is that once I have removed the remaining elements from the array have reduced, therefore all elements are shifted to the left. So watever element was sitting at $arrayname[20] would be residing in $arrayname[19] now.</DIV>
<DIV> </DIV>
<DIV>Basically, I have small array which is a subset of the big array. So all elements in small array will be present in the big array. In a nutshell, I'm trying to:</DIV>
<DIV>"GROUP COMMON ELEMENTS" between the two and one array</DIV>
<DIV>"UNIQUE ELEMENTS" in another array." </DIV>
<DIV> </DIV>
<DIV>regards,</DIV>
<DIV>hallian</DIV><br clear=all><hr>Get your FREE download of MSN Explorer at <a href="http://explorer.msn.com">http://explorer.msn.com</a><br></p></html>
--
Posted from [216.178.233.250] by way of f218.law7.hotmail.com [216.33.237.218]
via Mailgate.ORG Server - http://www.Mailgate.ORG
------------------------------
Date: Tue, 13 Mar 2001 14:22:51 -0800
From: "Mahesh A" <maheshasolkar@yahoo.com>
Subject: Re: Array Comparison question
Message-Id: <tat7dt3hmpmqdb@corp.supernews.com>
> ""shazad malik"" hallian@hotmail.com> wrote in message
> news:F218B2J4XtliS01qCcW0000f8b6@hotmail.com...
> Basically, I have small array which is a subset of the big array. So all
elements in small
> arrayll be present in the big array. In a nutshell, I'm trying to:
> "GROUP COMMON ELEMENTS" between the two and one array
> "UNIQUE ELEMENTS" in another array."
A Hash can be used to do the kind of grouping you intend to, like ...
#!/usr/local/bin/perl -w
my @arrayOne = qw ( zero one two four five six seven eight);
my @arrayTwo = qw ( one two three four six seven nine);
map { if (exists ($tempHash{$_})) { $tempHash{$_}++ } else { $tempHash{$_} =
1}} @arrayOne;
map { if (exists ($tempHash{$_})) { $tempHash{$_}++ } else { $tempHash{$_} =
1}} @arrayTwo;
map {
(($tempHash{$_} == 1) ? push (@arrayUnique, $_) : push (@arrayCommon,
$_));
} (keys %tempHash);
print "One : @arrayOne\n";
print "Two : @arrayTwo\n";
print "\nCommon : @arrayCommon\n";
print "Unique : @arrayUnique\n";
hth,
- M.
------------------------------
Date: 13 Mar 2001 14:45:52 -0600
From: michaech_@attachmate.com (Michael Chapman)
Subject: Autodelete
Message-Id: <3aae8700_2@news4.newsfeeds.com>
I would like to use this script on a Win32 system and
delete all directories and files in a specific location but
I'm not sure if this script will work. Any ideas?
Thanks!
$dir = "/usr/home25/phoenixb/public_html/mylist";
opendir FH, "$dir" || die $!;
my @filenames = readdir(FH);
closedir FH;
foreach my $file(@filenames){
if(-e "$dir/$file"){
if (-M "$dir/$file" > 30) { unlink("$dir/$file"); }
}
}
print "Content-type: text/html\n\n";
print "Files deleted !\n";
-----= 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: Tue, 13 Mar 2001 15:13:20 -0600
From: Galen Menzel <galen.menzel@mail.utexas.edu>
Subject: Re: Autodelete
Message-Id: <3AAE8D70.8F962A4F@mail.utexas.edu>
Michael Chapman wrote:
>
> I would like to use this script on a Win32 system and
> delete all directories and files in a specific location but
> I'm not sure if this script will work. Any ideas?
You should use the File::Path module instead of doing this by hand. It has a
function called rmtree that does just what you're looking for.
galen
------------------------------
Date: Tue, 13 Mar 2001 15:32:11 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Autodelete
Message-Id: <slrn9at0ub.vtg.tadmc@tadmc26.august.net>
Michael Chapman <michaech_@attachmate.com> wrote:
>I would like to use this script on a Win32 system and
>delete all directories and files in a specific location but
>I'm not sure if this script will work.
What happened when you tried it?
>$dir = "/usr/home25/phoenixb/public_html/mylist";
^^
I think windoze wants a drive letter in its filespecs?
[snip code]
>print "Content-type: text/html\n\n";
^^^^
You should output headers near the beginning of your program.
>print "Files deleted !\n";
That does not look like the html that you promised.
That looks like text/plain...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Mar 2001 19:18:21 GMT
From: ansok@alumni.caltech.edu (Gary E. Ansok)
Subject: Behavior of => after newline
Message-Id: <98lrpt$1p@gap.cco.caltech.edu>
I discovered something about the behavior of => when the statement
is broken across two lines, and was wondering whether there is a
reason for this behavior. (using 5.6.0, ActiveState build 623)
my @in = qw(. ..);
my @f;
@f = grep -f =>
@in;
print "Arrow on 1:", scalar @f, "\n";
@f = grep -f
=> @in;
print "Arrow on 2:", scalar @f, "\n";
For the first grep, the => quotes the word before it, and we are
testing the truth value of the string "-f" (always true).
For the second, no auto-quoting is done, and the value tested is
that returned by the -f function for each data item (false for
this data).
Yes, in this case a regular comma would have been better than a
"fat comma", and that's what I switched to once I figured out
what was going on.
But I'm still curious whether this behavior was deliberate or
just a parser artifact. "perlop" says that => quotes the word
to its left, which is consistent with the observed behavior.
But it seems to go against the feeling of "newline is just like
other whitespace (except in specific line-oriented contexts)."
-- Gary Ansok
------------------------------
Date: 13 Mar 2001 21:22:14 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Behavior of => after newline
Message-Id: <slrn9at3s6.c5n.abigail@tsathoggua.rlyeh.net>
Gary E. Ansok (ansok@alumni.caltech.edu) wrote on MMDCCLI September
MCMXCIII in <URL:news:98lrpt$1p@gap.cco.caltech.edu>:
-- I discovered something about the behavior of => when the statement
-- is broken across two lines, and was wondering whether there is a
-- reason for this behavior. (using 5.6.0, ActiveState build 623)
--
-- my @in = qw(. ..);
-- my @f;
--
-- @f = grep -f =>
-- @in;
-- print "Arrow on 1:", scalar @f, "\n";
--
-- @f = grep -f
-- => @in;
-- print "Arrow on 2:", scalar @f, "\n";
--
-- For the first grep, the => quotes the word before it, and we are
-- testing the truth value of the string "-f" (always true).
--
-- For the second, no auto-quoting is done, and the value tested is
-- that returned by the -f function for each data item (false for
-- this data).
--
-- Yes, in this case a regular comma would have been better than a
-- "fat comma", and that's what I switched to once I figured out
-- what was going on.
--
-- But I'm still curious whether this behavior was deliberate or
-- just a parser artifact. "perlop" says that => quotes the word
-- to its left, which is consistent with the observed behavior.
-- But it seems to go against the feeling of "newline is just like
-- other whitespace (except in specific line-oriented contexts)."
This is one of those specific line-oriented contexts.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$==-2449231+gm_julian_day+time);do{until($=<$#r){$_.=$r[$#r];$=-=$#r}for(;
!$r[--$#r];){}}while$=;$,="\x20";print+$_=>September=>MCMXCIII=>=>=>=>=>=>=>=>'
------------------------------
Date: 13 Mar 2001 19:13:55 GMT
From: "Scott R. Godin" <webmaster@webdragon.munge.net>
Subject: Re: Can a regex do this?
Message-Id: <98lrhj$lpn$1@216.155.33.44>
In article <3AAC9975.95532C1A@bigfoot.com>, Thorbjørn Ravn Andersen
<thunderbear@bigfoot.com> wrote:
| blahblah wrote:
|
| > Yet another fucking loser who can't read. I said REGEX. I never said
| > PERL. I guess it's true that only old fucks who can't use current
| > languages still use perl. Sad.
|
| Have you considered for even the briefest of moments, asking people who
| use the same language as you do?
which language would that be... SLANG[1]? (:
[1] heh.. shall we play "fill in the acronym"? :D
--
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw";
# ( damn spammers. *shakes fist* take a hint. =:P )
------------------------------
Date: Tue, 13 Mar 2001 12:00:07 -0800
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: Can a regex do this?
Message-Id: <3aae7c47$1@news.microsoft.com>
> blahblah wrote:
>
> > Yet another fucking loser who can't read. I said REGEX. I never said
> > PERL. I guess it's true that only old fucks who can't use current
> > languages still use perl. Sad.
Ah, sorry about that. I guess nobody took your question literally.
The literal answer to your question ("I am looking for a regex that will do
two replacements") is:
No, it cannot be done because RegExps match only, they don't replace
anything.
jue
------------------------------
Date: Tue, 13 Mar 2001 15:12:03 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Can a regex do this?
Message-Id: <slrn9asvoj.vs3.tadmc@tadmc26.august.net>
Jürgen Exner <juex@deja.com> wrote:
>> blahblah wrote:
>>
>> > Yet another fucking loser who can't read. I said REGEX. I never said
>> > PERL. I guess it's true that only old fucks who can't use current
>> > languages still use perl. Sad.
>
>Ah, sorry about that. I guess nobody took your question literally.
>The literal answer to your question ("I am looking for a regex that will do
>two replacements") is:
>
> No, it cannot be done because RegExps match only, they don't replace
>anything.
If we're to pull out the pedantry, then the above is not accurate either.
Regexs don't _do_ anything!
Operators do things. The pattern match operator does the matching,
the regex is just one of the operands.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 13 Mar 2001 15:25:51 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Can a regex do this?
Message-Id: <slrn9at0if.vtg.tadmc@tadmc26.august.net>
I myself <tadmc@augustmail.com> wrote:
>Regexs don't _do_ anything!
>
>Operators do things. The pattern match operator does the matching,
>the regex is just one of the operands.
^^^^^^^^
Errr, arguments?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 13 Mar 2001 15:04:38 -0500
From: "Roger Liu" <rliu2@ford.com>
Subject: Re: CGI module and file upload
Message-Id: <98lugn$gjp4@eccws12.dearborn.ford.com>
You have to use 'POST' method to upload file.
> > > in web form, a entry set as :
> > > <INPUT TYPE="file" NAME="upfile" enctype="multipart/form
> > > -data">
^^^^^^^^^
Add 'method="post"' in the '<IN ....>'. because the default Method is 'GET'.
Roger Liu
------------------------------
Date: Tue, 13 Mar 2001 14:33:48 -0500
From: "Josh Reynolds" <stujreyn@acs.eku.edu>
Subject: CGI on win2000 server timeout question
Message-Id: <2001Mar13.143408.15660@acs.eku.edu>
Hello all. I'm having a problem running perl 5.005_03 under IIS5. I made
the webserver recognize .pl as a perl file in the webservers properties, but
when I try to access any .pl file through the webserver, it just freezes and
eventually gives this error message: "cgi timeout. The specified CGI
application exceeded the allowed time for processing. The server has deleted
the process." The directory on the server, where the .pl file resides,
permissions are set to allow script and executable access to the default web
user.
Anybody have an idea what hopefully simple and common mistake I could have
made? I figured as long as the server had the association for the .pl file
and the perms were set right, there would be no problem, but I guess I was
wrong. Thanks in advance to anyone who replies.
Josh
------------------------------
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 482
**************************************