[25109] in Perl-Users-Digest
Perl-Users Digest, Issue: 7359 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 4 21:05:39 2004
Date: Thu, 4 Nov 2004 18:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 4 Nov 2004 Volume: 10 Number: 7359
Today's topics:
Cgi/Perl script for multiple file upload/attachment in (Avin Patel)
Re: Cgi/Perl script for multiple file upload/attachment <ioneabu@yahoo.com>
DEFINEs in Perl? <nospam@nospam.com>
Re: DEFINEs in Perl? <tony_curtis32@yahoo.com>
Re: FAQ 2.1: What machines support Perl? Where do I ge <1usa@llenroc.ude.invalid>
Re: FAQ 2.1: What machines support Perl? Where do I ge <ioneabu@yahoo.com>
Re: FAQ 2.1: What machines support Perl? Where do I ge <1usa@llenroc.ude.invalid>
Re: FAQ 2.1: What machines support Perl? Where do I ge <notvalid@email.com>
Re: FAQ 2.1: What machines support Perl? Where do I ge <ioneabu@yahoo.com>
FAQ 8.23: How can I open a pipe both to and from a comm <comdog@panix.com>
Re: Generating postscript file <Jon.Ericson@jpl.nasa.gov>
Grep -v option (Mark Lockett)
Re: Grep -v option <Jon.Ericson@jpl.nasa.gov>
Re: Grep -v option <bik.mido@tiscalinet.it>
Load information in Solaris (Perl Script.) (Alice Stamp)
map()'s BLOCK [was: "Re: Q: re Inline and Benchmark"] <bik.mido@tiscalinet.it>
Net::LDAP help (Just Curious)
Output of tar to a filehandle <whitey@newmail.net>
Re: Output of tar to a filehandle <tadmc@augustmail.com>
Re: Output of tar to a filehandle <whitey@newmail.net>
Re: Output of tar to a filehandle <1usa@llenroc.ude.invalid>
Re: Output of tar to a filehandle <whitey@newmail.net>
Re: Q: re Inline and Benchmark <bik.mido@tiscalinet.it>
Re: Q: re Inline and Benchmark <bik.mido@tiscalinet.it>
Solaris taking over Perl ownership <ahamm@mail.com>
Spurious "Use of uninitialized value" messages with '-w (Sam Denton)
Re: Spurious "Use of uninitialized value" messages with <bik.mido@tiscalinet.it>
Re: Spurious "Use of uninitialized value" messages with <rwxr-xr-x@gmx.de>
Re: Spurious "Use of uninitialized value" messages with <uguttman@athenahealth.com>
Spurious "Use of uninitialized value" with -w, redux (Sam Denton)
Re: Spurious "Use of uninitialized value" with -w, redu <rwxr-xr-x@gmx.de>
Re: Spurious "Use of uninitialized value" with -w, redu <Jon.Ericson@jpl.nasa.gov>
Re: Spurious "Use of uninitialized value" with -w, redu <postmaster@castleamber.com>
Re: Spurious "Use of uninitialized value" with -w, redu <dejanews@email.com>
Re: web hoster won't secure CGI <phaylon@dunkelheit.at>
Re: Win32 Advanced Properties <ceo@nospam.on.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 4 Nov 2004 13:15:58 -0800
From: avinpatel@gmail.com (Avin Patel)
Subject: Cgi/Perl script for multiple file upload/attachment in web form
Message-Id: <1655d2a1.0411041315.7a9d7e8d@posting.google.com>
Hi,
I am looking for perl/php script to allow multiple files can be
uploaded/attached in webform.
But I don't like the multiple input boxes using "<input type="file"
size="40" maxlength="40" name="filename[]">" html tag. As it will
limit the no. of files can be uploaded(only as many of this boxes I
write in form & doesn't look good in form also).
I ma looking for multiple file upload in web form using html tags
select or textarea.
Can any one suggest where this script can be found, I googled..., but
no luck over there.
Thanks,
Avin Patel
------------------------------
Date: Thu, 04 Nov 2004 17:31:46 -0500
From: wana <ioneabu@yahoo.com>
Subject: Re: Cgi/Perl script for multiple file upload/attachment in web form
Message-Id: <10ol845o7gi9j4a@news.supernews.com>
Avin Patel wrote:
> Hi,
> I am looking for perl/php script to allow multiple files can be
> uploaded/attached in webform.
>
> But I don't like the multiple input boxes using "<input type="file"
> size="40" maxlength="40" name="filename[]">" html tag. As it will
> limit the no. of files can be uploaded(only as many of this boxes I
> write in form & doesn't look good in form also).
>
> I ma looking for multiple file upload in web form using html tags
> select or textarea.
>
> Can any one suggest where this script can be found, I googled..., but
> no luck over there.
>
> Thanks,
> Avin Patel
Try amazon.com. There is a great book on the subject in general: 'CGI.pm'
by Dr. Lincoln Stein. It is really a lot of fun using CGI.pm to do just
what you are trying to do. Good luck!
wana
------------------------------
Date: Thu, 4 Nov 2004 20:55:50 -0500
From: "daniel kaplan" <nospam@nospam.com>
Subject: DEFINEs in Perl?
Message-Id: <1099619807.315638@nntp.acecape.com>
Hi all,
I tried looking this up in perldoc and faq, but other than using the word
DEFINE (where I know it from C)I don't know how else to describe it so can't
find it.
In Perl I am writing:
sub_XYZ (value_a, value_b, 1);
within sub_XYZ I have:
if($third_value == 1)
do this
elsif($third_value == 2)
do that
elsif($third_value == 3)
do the other thing
Now for those not familiar with C, there is something called "#define",
where I can declare:
#define OptionA 1
#define OptionB 2
#define OptionC 3
and then in the above code instead of 1, 2 or 3, I use the defines above,
which make the code easier to read, maintain, etc. is there something like
this in Perl?
Sorry for the long explination, but didn't know how to call DEFINE for those
who don't know C, but might know the equivalent in Perl.
Thanks ahead,
Daniel
------------------------------
Date: Thu, 04 Nov 2004 20:01:24 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: DEFINEs in Perl?
Message-Id: <87fz3p2gwb.fsf@limey.hpcc.uh.edu>
>> On Thu, 4 Nov 2004 20:55:50 -0500,
>> "daniel kaplan" <nospam@nospam.com> said:
> Now for those not familiar with C, there is something called
> "#define", where I can declare:
> #define OptionA 1
perldoc constant
hth
t
------------------------------
Date: 4 Nov 2004 20:30:00 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: FAQ 2.1: What machines support Perl? Where do I get it?
Message-Id: <Xns95979DAD0C60Aasu1cornelledu@132.236.56.8>
wana <ioneabu@yahoo.com> wrote in
news:10okrpu6bjsp3a3@news.supernews.com:
> What about Pocket PC (a version of win ce)?
...
> If nothing else, I can at least format my web CGI programs to look
> nice on the little screen.
Are you talking about the output of your CGI programs or the program
listing?
'Cause, if it is the former, you don't even need a PDA to do that much less
a PDA that is running Apache.
Sinan
------------------------------
Date: Thu, 04 Nov 2004 16:46:40 -0500
From: wana <ioneabu@yahoo.com>
Subject: Re: FAQ 2.1: What machines support Perl? Where do I get it?
Message-Id: <10ol5flgetric80@news.supernews.com>
A. Sinan Unur wrote:
> wana <ioneabu@yahoo.com> wrote in
> news:10okrpu6bjsp3a3@news.supernews.com:
>
>> What about Pocket PC (a version of win ce)?
>
> ...
>
>> If nothing else, I can at least format my web CGI programs to look
>> nice on the little screen.
>
> Are you talking about the output of your CGI programs or the program
> listing?
>
> 'Cause, if it is the former, you don't even need a PDA to do that much
> less a PDA that is running Apache.
>
> Sinan
Oh, I just simply meant using my PDA as a web client with the included IE
browser. Most HTML that I will be generating in the end will look fine on
the little screen anyway since I don't do anything fancy. It is good to
try to minimize the need for text entry and use popup_menus and buttons
when possible due to the clumsiness of PDA text entry.
------------------------------
Date: 4 Nov 2004 21:01:58 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: FAQ 2.1: What machines support Perl? Where do I get it?
Message-Id: <Xns9597A3184C864asu1cornelledu@132.236.56.8>
wana <ioneabu@yahoo.com> wrote in
news:10ol5flgetric80@news.supernews.com:
> A. Sinan Unur wrote:
>
>> wana <ioneabu@yahoo.com> wrote in
>> news:10okrpu6bjsp3a3@news.supernews.com:
>>
>>> What about Pocket PC (a version of win ce)?
>>
>> ...
>>
>>> If nothing else, I can at least format my web CGI programs to look
>>> nice on the little screen.
>>
>> Are you talking about the output of your CGI programs or the program
>> listing?
>>
>> 'Cause, if it is the former, you don't even need a PDA to do that
>> much less a PDA that is running Apache.
...
> Oh, I just simply meant using my PDA as a web client with the included
> IE browser.
Then how will having Perl on your PDA help with that?
Sinan
------------------------------
Date: Thu, 04 Nov 2004 21:28:15 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: FAQ 2.1: What machines support Perl? Where do I get it?
Message-Id: <P9xid.17827$6q2.887@newssvr14.news.prodigy.com>
wana wrote:
> If nothing else, I can at least format my web CGI programs to look nice on
> the little screen.
[Off topic]
Install Opera (www.opera.com), the best internet browser IMHO. Pressing
shift-F11 will display the "small screen" view, which emulates what you
will see on your handheld.
--Ala
------------------------------
Date: Thu, 04 Nov 2004 17:50:20 -0500
From: wana <ioneabu@yahoo.com>
Subject: Re: FAQ 2.1: What machines support Perl? Where do I get it?
Message-Id: <10ol970ocgu9rf2@news.supernews.com>
A. Sinan Unur wrote:
> wana <ioneabu@yahoo.com> wrote in
> news:10ol5flgetric80@news.supernews.com:
>
>> A. Sinan Unur wrote:
>>
>>> wana <ioneabu@yahoo.com> wrote in
>>> news:10okrpu6bjsp3a3@news.supernews.com:
>>>
>>>> What about Pocket PC (a version of win ce)?
>>>
>>> ...
>>>
>>>> If nothing else, I can at least format my web CGI programs to look
>>>> nice on the little screen.
>>>
>>> Are you talking about the output of your CGI programs or the program
>>> listing?
>>>
>>> 'Cause, if it is the former, you don't even need a PDA to do that
>>> much less a PDA that is running Apache.
>
> ...
>
>> Oh, I just simply meant using my PDA as a web client with the included
>> IE browser.
>
> Then how will having Perl on your PDA help with that?
>
> Sinan
Sorry to confuse the topic. Since I have been immersing myself in learning
Perl, my PDA has sat idle doing nothing as far as running new code. I
would really like to edit and run Perl programs/scripts on it but for now
the only way my PDA can experience my Perl programs at all is via the web.
I am not interested in playing around with evc++ for now because I have a
weird feeling that I will have a psychotic break down working in microsoft
visual c++ and Perl at the same time.
------------------------------
Date: Thu, 4 Nov 2004 23:03:07 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 8.23: How can I open a pipe both to and from a command?
Message-Id: <cmecfb$q8k$1@reader1.panix.com>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.
--------------------------------------------------------------------
8.23: How can I open a pipe both to and from a command?
The IPC::Open2 module (part of the standard perl distribution) is an
easy-to-use approach that internally uses pipe(), fork(), and exec() to
do the job. Make sure you read the deadlock warnings in its
documentation, though (see IPC::Open2). See "Bidirectional Communication
with Another Process" in perlipc and "Bidirectional Communication with
Yourself" in perlipc
You may also use the IPC::Open3 module (part of the standard perl
distribution), but be warned that it has a different order of arguments
from IPC::Open2 (see IPC::Open3).
--------------------------------------------------------------------
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2002 Tom Christiansen and Nathan
Torkington, and other contributors as noted. All rights
reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
------------------------------
Date: Thu, 04 Nov 2004 15:24:37 -0800
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: Generating postscript file
Message-Id: <rcgsm7pw62y.fsf@Jon-Ericson.sdsio.prv>
BCC <bryan@akanta.net> writes:
> Does anyone know of a perl module like GD that will allow me to draw
> with colors and shapes and save it as a postscript file? GD doesnt
> give me that option unfortunately.
>
> Looked in CPAN and didnt see anything.
Not a Perl solution, but I use MetaPost
(http://cm.bell-labs.com/who/hobby/MetaPost.html).
It looks like there's a PostScript::Simple module
(http://search.cpan.org/~mcnewton/PostScript-Simple-0.06/).
Jon
------------------------------
Date: 4 Nov 2004 14:05:15 -0800
From: mlockett@alfains.com (Mark Lockett)
Subject: Grep -v option
Message-Id: <4253c268.0411041405.5c61f239@posting.google.com>
I am trying to parse lines out of a txt file. Instead of running the
command three times, how can I add all the parameters together for the
-v option. Thanks for the help.
------------------------------
Date: Thu, 04 Nov 2004 14:44:56 -0800
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: Grep -v option
Message-Id: <rcgwtx1w7x3.fsf@Jon-Ericson.sdsio.prv>
mlockett@alfains.com (Mark Lockett) writes:
> I am trying to parse lines out of a txt file. Instead of running the
> command three times, how can I add all the parameters together for the
> -v option. Thanks for the help.
This isn't strictly a Perl question. In shell:
$ grep -v x filename | grep -v y | grep -v z
With perl:
$ perl -ne 'print unless /x|y|z/' filename
It sound's like you have some problem with the shell solution, but I
don't know what it might be.
Jon
------------------------------
Date: Fri, 05 Nov 2004 00:17:50 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Grep -v option
Message-Id: <q1elo0tnf773e5cbbvqrungad753hbdkdg@4ax.com>
On 4 Nov 2004 14:05:15 -0800, mlockett@alfains.com (Mark Lockett)
wrote:
>I am trying to parse lines out of a txt file. Instead of running the
>command three times, how can I add all the parameters together for the
>-v option. Thanks for the help.
Are you asking about grep or perl? Hint: '|' *may* be what you want in
both cases...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 4 Nov 2004 17:09:50 -0800
From: alstamp@gmail.com (Alice Stamp)
Subject: Load information in Solaris (Perl Script.)
Message-Id: <f3849269.0411041709.66d46b10@posting.google.com>
Hi
(Tried to post this last night, but Google seems to have swallowed it.)
I have a script which makes use of the cpu data which I can read from
/proc/stat on Linux. I need to know the number of jiffies the cpu has
spent in user, system, and idle modes since boot up - easy enough to
do on Linux :
====
open (DATA, "/proc/stat");
my $rd;
do{
$rd = <DATA>;
} until ($rd =~ /^cpu/);
close PSF;
my @cline = split (/ /, $rd);
my $u = $cline[2];
my $s = $cline[4];
my $i = $cline[5];
====
I now need to write a similar perl script which does the same on
solaris (i.e. end up with the amount of time the cpu has spent in each
mode in three variables.
I know that /proc doesn't have these kernel 'summary' files that Linux
has, and the output from iostat doesn't really help. Is there another
utility I can call to pull out this data, or can someone recommend a
module which supplies the data I need (amount of time SINCE BOOT)
spent in each mode.
Thank you for any help that you can offer.
BR
AS
------------------------------
Date: Fri, 05 Nov 2004 00:11:27 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: map()'s BLOCK [was: "Re: Q: re Inline and Benchmark"]
Message-Id: <khblo0dtcocso7jucot9e94jbu48p44t92@4ax.com>
On Wed, 03 Nov 2004 00:23:13 +0100, Michele Dondi
<bik.mido@tiscalinet.it> wrote:
> { map {
> no strict 'refs';
> $_ => \&{$_};
> } qw/sol1 sol2 .../ };
Except that this won't work! When I try it in actual code I get
"no" not allowed in expression at foo.pl line 12, at end of line
BEGIN not safe after errors--compilation aborted at foo.pl line 12.
Of course I can do
{
no strict 'refs';
cmpthese 500, { map { $_ => \&{$_} }
qw/sol1 sol2 etc/ };
}
instead, but IMHO the no-strict-'refs'-ization logically best applies
to the map()'s code block. Now I know that there are easy workarounds,
e.g. using the "EXPR-form" of map() with a do(); still I wonder why
the block of the "BLOCK-form" of map() doesn't behave like a "normal"
block.
TIA,
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 4 Nov 2004 13:14:24 -0800
From: shuchalle@hotmail.com (Just Curious)
Subject: Net::LDAP help
Message-Id: <d2573fe0.0411041314.3901b404@posting.google.com>
Hello,
I read on CPAN ( http://search.cpan.org/~gbarr/perl-ldap/lib/Net/LDAP.pod
) that in constructor for Net::LDAP - - new ( HOST, OPTIONS )
HOST can be an array of hosts - each one is tried before undef is
returned.
I tried it and its not working for me - can anyone please provide an
example how to use array of hosts with contsructor of Net::LDAP???
Any pointers will be greatly appreciated.
Regards,
AZXML
------------------------------
Date: Thu, 04 Nov 2004 13:05:58 -0600
From: Whitey Johnson <whitey@newmail.net>
Subject: Output of tar to a filehandle
Message-Id: <pan.2004.11.04.19.05.57.818152@newmail.net>
I have a small backup script that tars up a dir and puts it on a different
drive. I want to get the output of tar (the list of files being tarred)
into a file. I can do it by assigning STDOUT to a file like so:
open STDOUT, ">> $logfile" or die "Can't open the log file: $!\n";
system "tar", "cvzf", $bkfile, $dir;
Question: How do I return STDOUT back to the screen after the backup has
run so I can print a message to the screen?
I have tried selecting a file like this:
open LOGFILE, ">> $logfile" or die "Can't open the log file: $!\n";
select LOGFILE;
system "tar" yada yada..
but the output goes to the screen not the file.
I have also tried a whole different method like this:
open LOGFILE, ">> $logfile" or die "Can't open the log file: $!\n";
open TAR, "tar -cvzf $bkfile $dir" or die "Tar failed: $!\n";
print LOGFILE while (<TAR>);
but the I get an error that the directory doesn't exist.
TIA
------------------------------
Date: Thu, 4 Nov 2004 13:29:37 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Output of tar to a filehandle
Message-Id: <slrncol0p1.c0n.tadmc@magna.augustmail.com>
Whitey Johnson <whitey@newmail.net> wrote:
> open STDOUT, ">> $logfile" or die "Can't open the log file: $!\n";
> system "tar", "cvzf", $bkfile, $dir;
>
> Question: How do I return STDOUT back to the screen after the backup has
> run so I can print a message to the screen?
If you don't change STDOUT, then your question becomes moot.
So don't change STDOUT. :-)
system "tar cvzf $bkfile $dir >>$logfile";
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 04 Nov 2004 14:40:26 -0600
From: Whitey Johnson <whitey@newmail.net>
Subject: Re: Output of tar to a filehandle
Message-Id: <pan.2004.11.04.20.40.25.983555@newmail.net>
On Thu, 04 Nov 2004 13:29:37 -0600, Tad McClellan muttered incoherently:
> Whitey Johnson <whitey@newmail.net> wrote:
>
>> open STDOUT, ">> $logfile" or die "Can't open the log file: $!\n";
>> system "tar", "cvzf", $bkfile, $dir;
>>
>> Question: How do I return STDOUT back to the screen after the backup has
>> run so I can print a message to the screen?
>
>
> If you don't change STDOUT, then your question becomes moot.
>
> So don't change STDOUT. :-)
>
> system "tar cvzf $bkfile $dir >>$logfile";
Thanks!
I read in the the llama book that putting all the scalars in quotes
with a system function could get a bit scary if the user was feeding the
progam input but I guess since I am defining the variables it doesn't
matter.
Question 2: Would I be able to use the:
open TAR, "tar -cvzf $bkfile $dir" or die "Tar failed: $!\n";
with scalars? I can do it if I state the file and directory in the command
like:
open TAR, "tar -cvzf file.tar.gz /home/john" or die ...
but I have the $bkfile name created with the date it is run.
------------------------------
Date: 4 Nov 2004 20:48:44 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Output of tar to a filehandle
Message-Id: <Xns9597A0DA039E0asu1cornelledu@132.236.56.8>
Whitey Johnson <whitey@newmail.net> wrote in
news:pan.2004.11.04.20.40.25.983555@newmail.net:
> On Thu, 04 Nov 2004 13:29:37 -0600, Tad McClellan muttered
> incoherently:
Hmmmm ...
>> Whitey Johnson <whitey@newmail.net> wrote:
...
> Question 2: Would I be able to use the:
> open TAR, "tar -cvzf $bkfile $dir" or die "Tar failed: $!\n";
Maybe you should reexamine the coherency of your own mutterings. This is
gibberish. Don't write gibberish. Instead, read, I mean actually read,
Tad's response.
Sinan.
------------------------------
Date: Thu, 04 Nov 2004 15:14:57 -0600
From: Whitey Johnson <whitey@newmail.net>
Subject: Re: Output of tar to a filehandle
Message-Id: <pan.2004.11.04.21.14.56.636013@newmail.net>
On Thu, 04 Nov 2004 20:48:44 +0000, A. Sinan Unur muttered incoherently:
Just a joke I don't actually think Tad (or you now) muttered anything
incoherently.
<snip>
>
> ...
>
>> Question 2: Would I be able to use the:
>> open TAR, "tar -cvzf $bkfile $dir" or die "Tar failed: $!\n";
>
> Maybe you should reexamine the coherency of your own mutterings. This is
> gibberish. Don't write gibberish. Instead, read, I mean actually read,
> Tad's response.
>
> Sinan.
Ouch.
Well I figured it out. I was missing some ()'s and a |.
open (TAR, "tar -cvzf $bkfile $dir |") or die "Tar failed: $!\n";
It was something I had found while googling this group yesterday and
wanted to figure it out for the whole "There's more than one way to do it"
thing. Seems I copied it wrong.
------------------------------
Date: Fri, 05 Nov 2004 00:11:11 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Q: re Inline and Benchmark
Message-Id: <ml7lo0p6vqv9dk9huju9q5jordc3johr0n@4ax.com>
On Thu, 04 Nov 2004 10:40:41 +0000, Sisyphus
<kalinaubears@iinet.net.au> wrote:
>fact that it leaks. What I'm now wondering is whether the leak was not
>mentioned because:
>a) no-one noticed it;
>or because:
>b) code that leaks is of little concern, and generally not considered
>worth mentioning.
Certainly *for me* and *in this case* it's not necessarily worth
mentioning that it leaks. However since I could understand Abigail's
code[1], but I can't follow your discussion anymore and yet I'd like
to include the non-leaking code in the comparison too (for
completeness) once you all agree on "the best/correct way to do it",
for some reasonably sensible meaning of "best/correct", may you supply
a complete, working, function? You can write me privately at
<ti tod nfni tod im tod mcl ta razalb> if needed.
[1] I've not written a line in C in ten years or so, but I conserve
some reminiscence of it. ;-)
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 05 Nov 2004 00:11:19 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Q: re Inline and Benchmark
Message-Id: <649lo0l8rlm2monlmft7qle4h1havath3s@4ax.com>
On 4 Nov 2004 13:25:47 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:
>> Hmmm ... that's not what I'm finding.
>>
>> If I do \&foo all I get is a "Usage:" warning telling me that it needs
>> to be foo() - and when I try \&foo() I get a slightly different "usage:"
Me too. And this is why I asked in the first place.
>That's an artifact of Benchmark. Inline checks parameters and gives
>the "usage" message you've seen when (for instance) a function requiring
>no arguments is called with arguments. Benchmark calls a given
>coderef in the form "&$subref;" (line 646 in v 1.051), so if @_ happens to
>be non-empty at this point, the error occurs.
In fact I made a local copy of Benchmark.pm and hacked it using
"$subref->()" instead and it works as expected.
>Prototyped Perl subs would have a similar problem. Time for a bug report,
>I guess... And another lesson why one shouldn't call arbitrary subs
>with &.
Definitely!
TY,
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 5 Nov 2004 12:25:12 +1100
From: "Andrew Hamm" <ahamm@mail.com>
Subject: Solaris taking over Perl ownership
Message-Id: <2v0342F2g737sU1@uni-berlin.de>
Hi folks
I have recently built a Perl 5.8.5 binary for a new customer. I have made
it install in /usr/bin, /usr/lib etc
As many of you are probably aware, Solaris are supplying and obsolete
version of Perl in /usr/bin/perl etc. As you are may also be aware, it is
an old version - for Solaris 9 you are happily supplied 5.6.1, and for
Solaris 8 you are supplied (I think) approx 5.005.
Now the customer, who self-admittedly has very little UNIX experience, is
saying that Solaris is making threats of withdrawn support if we install a
"non-Sun" version of Perl in the same location; overriding the obsolete
version of Perl supplied by Sun. They are threatening total withdrawal of
support for Solaris, not just "support" of Perl [if the story is to be
believed]
I believe that the customer has talked to an undergraduate teenager on the
helpdesk who is making unofficial policy on the fly. It's also possible
that some member of the customer has invented this story to put up a
roadblock because they want the project to fail.
However, disregarding these latter two possibilities; if Solaris is indeed
making threats of this nature, what would the Perl community think? Has
anyone else heard such outrageous claims from Sun?
I am trying to get hold of a written statement from Sun confirming this
stance, and if I obtain it I will post it here.
------------------------------
Date: 4 Nov 2004 15:03:49 -0800
From: dejanews@email.com (Sam Denton)
Subject: Spurious "Use of uninitialized value" messages with '-w'
Message-Id: <3c863a7a.0411041503.214f3641@posting.google.com>
Here's my code:
+208 chomp ($fsmount);
+209 $fsmount .= ' ';
+210
+211 print "*** fsmount = \"$fsmount\"";
+212 print ", empty" if $fsmount eq "";
+213 print ", undef" if undef $fsmount;
+214 print " ***\n";
+215
+216 # if ( $fsmount =~ m=^/= ) {
+217 # $fsmount =~ s/:.*$//;
+218 my $firstchar = substr($fsmount,0,1);
+219 if ( $firstchar eq '/' ) {
+220 $fsmount =~ s/:.*//;
When I run this code with '-w', here's what I see:
*** fsmount = " " ***
Use of uninitialized value in substr at unix_replica.pl line 218.
Use of uninitialized value in pattern match (m//) at unix_replica.pl line 219.
*** fsmount = "/: " ***
Use of uninitialized value in substr at unix_replica.pl line 218.
Use of uninitialized value in pattern match (m//) at unix_replica.pl line 219.
Everything works just fine without the '-w' option. Any ideas?
------------------------------
Date: Fri, 05 Nov 2004 00:21:06 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Spurious "Use of uninitialized value" messages with '-w'
Message-Id: <d6elo0d834sm9ku9ubagmkn13taq2am0kc@4ax.com>
On 4 Nov 2004 15:03:49 -0800, dejanews@email.com (Sam Denton) wrote:
>Everything works just fine without the '-w' option. Any ideas?
(1) 'use warnings;' instead (unless backward compatibility is an
issue), (2) if you're really sure that what's going on is correct
anyway, then wrap a small block around the relevant line(s) of code
and set
no warnings 'uninitialized';
there.
HTH,
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 4 Nov 2004 23:19:29 GMT
From: Lukas Mai <rwxr-xr-x@gmx.de>
Subject: Re: Spurious "Use of uninitialized value" messages with '-w'
Message-Id: <cmede1$cp3$1@wsc10.lrz-muenchen.de>
Sam Denton schrob:
> Here's my code:
> +208 chomp ($fsmount);
> +209 $fsmount .= ' ';
> +210
> +211 print "*** fsmount = \"$fsmount\"";
> +212 print ", empty" if $fsmount eq "";
> +213 print ", undef" if undef $fsmount;
^^^^^^^^^^^^^^
$ perldoc -f undef
undef EXPR
undef Undefines the value of EXPR, which must be an
lvalue. [...]
> +214 print " ***\n";
> +215
> +216 # if ( $fsmount =~ m=^/= ) {
> +217 # $fsmount =~ s/:.*$//;
> +218 my $firstchar = substr($fsmount,0,1);
^^^^^^^^
$fsmount is undef here, that's why you get the warning.
[...]
> *** fsmount = " " ***
> Use of uninitialized value in substr at unix_replica.pl line 218.
[...]
HTH, Lukas
--
use warnings; use strict;
sub hacker'Perl { "Perl @_,"} sub another'Just
{print"Just @_ "}
Just another Perl hacker,
------------------------------
Date: Thu, 04 Nov 2004 18:54:23 -0500
From: Uri Guttman <uguttman@athenahealth.com>
Subject: Re: Spurious "Use of uninitialized value" messages with '-w'
Message-Id: <m3wtx1kw5s.fsf@lap.athenahealth.com>
>>>>> "SD" == Sam Denton <dejanews@email.com> writes:
SD> +211 print "*** fsmount = \"$fsmount\"";
SD> +212 print ", empty" if $fsmount eq "";
SD> +213 print ", undef" if undef $fsmount;
that should be defined and not undef. also do that before the other
print. actually you should do only one or the other since it can't be
both '' and undef. and you are also printing $fsmount before this so if
it is undef you will get the warning. it is not spurious, heed it.
SD> Everything works just fine without the '-w' option. Any ideas?
you have undefined values lurking around. fix them.
uri
------------------------------
Date: 4 Nov 2004 15:17:21 -0800
From: dejanews@email.com (Sam Denton)
Subject: Spurious "Use of uninitialized value" with -w, redux
Message-Id: <3c863a7a.0411041517.29ceee38@posting.google.com>
OK, my first post had a bug, but it's a real problem, honest.
Here's my (fixed!) code:
+208 chomp ($fsmount);
+209 $fsmount .= ' ';
+210
+211 print "*** fsmount = \"$fsmount\"";
+212 print ", empty" if $fsmount eq "";
+213 print ", undef" unless defined($fsmount);
+214 print " ***\n";
+215
+216 # if ( $fsmount =~ m=^/= ) {
+217 # $fsmount =~ s/:.*$//;
+218 my $firstchar = substr($fsmount,0,1);
+219 if ( $firstchar eq '/' ) {
+220 $fsmount =~ s/:.*//;
When I run this code with '-w', here's what I see:
# perl unix_replica.pl
*** fsmount = " " ***
Use of uninitialized value in pattern match (m//) at unix_replica.pl
line 218.
*** fsmount = "/: " ***
*** fsmount = " dev = /dev/hd4 " ***
Use of uninitialized value in pattern match (m//) at unix_replica.pl
line 218.
*** fsmount = " vol = "root" " ***
Use of uninitialized value in pattern match (m//) at unix_replica.pl
line 218.
Line 209 guarantees that there's at least one character in $fsmount,
so the 'substr($fsmount,0,1)' should always return one character
string. Everything works just fine without the '-w' option. Any ideas?
------------------------------
Date: 4 Nov 2004 23:42:03 GMT
From: Lukas Mai <rwxr-xr-x@gmx.de>
Subject: Re: Spurious "Use of uninitialized value" with -w, redux
Message-Id: <cmeeob$cp3$2@wsc10.lrz-muenchen.de>
Sam Denton schrob:
> OK, my first post had a bug, but it's a real problem, honest.
> Here's my (fixed!) code:
> +208 chomp ($fsmount);
> +209 $fsmount .= ' ';
> +210
> +211 print "*** fsmount = \"$fsmount\"";
> +212 print ", empty" if $fsmount eq "";
> +213 print ", undef" unless defined($fsmount);
> +214 print " ***\n";
> +215
> +216 # if ( $fsmount =~ m=^/= ) {
> +217 # $fsmount =~ s/:.*$//;
> +218 my $firstchar = substr($fsmount,0,1);
> +219 if ( $firstchar eq '/' ) {
> +220 $fsmount =~ s/:.*//;
> When I run this code with '-w', here's what I see:
> # perl unix_replica.pl
> *** fsmount = " " ***
> Use of uninitialized value in pattern match (m//) at unix_replica.pl
> line 218.
That's weird because line 218 is `my $firstchar = substr($fsmount,0,1)'.
In fact, I don't see any m// in your code (except for the comment in
line 216).
Your code and your error messages don't agree.
HTH, Lukas
--
There is no .
------------------------------
Date: Thu, 04 Nov 2004 15:49:16 -0800
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: Spurious "Use of uninitialized value" with -w, redux
Message-Id: <rcgk6t1w4xv.fsf@Jon-Ericson.sdsio.prv>
dejanews@email.com (Sam Denton) writes:
> OK, my first post had a bug, but it's a real problem, honest.
>
> Here's my (fixed!) code:
>
> +208 chomp ($fsmount);
> +209 $fsmount .= ' ';
> +210
> +211 print "*** fsmount = \"$fsmount\"";
> +212 print ", empty" if $fsmount eq "";
> +213 print ", undef" unless defined($fsmount);
> +214 print " ***\n";
> +215
> +216 # if ( $fsmount =~ m=^/= ) {
> +217 # $fsmount =~ s/:.*$//;
> +218 my $firstchar = substr($fsmount,0,1);
> +219 if ( $firstchar eq '/' ) {
> +220 $fsmount =~ s/:.*//;
>
> When I run this code with '-w', here's what I see:
>
> # perl unix_replica.pl
> *** fsmount = " " ***
> Use of uninitialized value in pattern match (m//) at unix_replica.pl
> line 218.
> *** fsmount = "/: " ***
> *** fsmount = " dev = /dev/hd4 " ***
> Use of uninitialized value in pattern match (m//) at unix_replica.pl
> line 218.
> *** fsmount = " vol = "root" " ***
> Use of uninitialized value in pattern match (m//) at unix_replica.pl
> line 218.
>
> Line 209 guarantees that there's at least one character in $fsmount,
> so the 'substr($fsmount,0,1)' should always return one character
> string. Everything works just fine without the '-w' option. Any ideas?
I think there's something you aren't telling us. :-) I don't see a
pattern match on line 218. If the substr were the location of the
error, I'd expect a different message:
$ perl -we 'my $f = substr(undef,0,1)'
Use of uninitialized value in substr at -e line 1.
None of the (uncommented) code above seems to be a pattern match, so I
think the line numbering must be off. Maybe you could post a
self-contained script (sans line numbers) that exhibits the problem?
Jon
------------------------------
Date: 5 Nov 2004 00:11:54 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Spurious "Use of uninitialized value" with -w, redux
Message-Id: <Xns9597B91ED9B40castleamber@130.133.1.4>
Lukas Mai wrote:
> Sam Denton schrob:
>> +218 my $firstchar = substr($fsmount,0,1);
>> Use of uninitialized value in pattern match (m//) at unix_replica.pl
>> line 218.
>
> That's weird because line 218 is `my $firstchar = substr($fsmount,0,1)'.
> In fact, I don't see any m// in your code (except for the comment in
> line 216).
If Sam is using an old version of Perl, *and* uses elsif, the line number
(s) reported can be wrong.
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Fri, 05 Nov 2004 01:10:54 GMT
From: samwyse <dejanews@email.com>
Subject: Re: Spurious "Use of uninitialized value" with -w, redux
Message-Id: <yqAid.15564$bP2.9532@newssvr12.news.prodigy.com>
On or about 11/4/2004 5:42 PM, Lukas Mai did proclaim:
> Sam Denton schrob:
>
>>OK, my first post had a bug, but it's a real problem, honest.
>
>
>>Here's my (fixed!) code:
>
>
>> +208 chomp ($fsmount);
>> +209 $fsmount .= ' ';
>> +210
>> +211 print "*** fsmount = \"$fsmount\"";
>> +212 print ", empty" if $fsmount eq "";
>> +213 print ", undef" unless defined($fsmount);
>> +214 print " ***\n";
>> +215
>> +216 # if ( $fsmount =~ m=^/= ) {
>> +217 # $fsmount =~ s/:.*$//;
>> +218 my $firstchar = substr($fsmount,0,1);
>> +219 if ( $firstchar eq '/' ) {
>> +220 $fsmount =~ s/:.*//;
>
>
>>When I run this code with '-w', here's what I see:
>
>
>> # perl unix_replica.pl
>> *** fsmount = " " ***
>> Use of uninitialized value in pattern match (m//) at unix_replica.pl
>>line 218.
>
>
> That's weird because line 218 is `my $firstchar = substr($fsmount,0,1)'.
> In fact, I don't see any m// in your code (except for the comment in
> line 216).
>
> Your code and your error messages don't agree.
Yes, I noticed that as well. Originally, my code only had lines 208,
216-217, and 220; the other lines are debugging code that I've added
trying to track things down. The message has always been the same
except for the line number, which has always pointed to whichever came
first of the "if" statement or the call to "substr". The message has
always said "pattern match" and I think that its always said "(m/)",
regardless of the way I coded the regex.
I suspect that the (m//) is a generic message for any pattern match; I
further wonder if, internally, the substr is getting translated into a
pattern match. The Perl optimizer does some strange things sometimes.
I posted the original question about two minutes before leaving work
today (my wife had to get our daughter to girl scouts), but I can
double-check things tomorrow. I'll also try shrinking the code down to
the minimum that exhibits the problem.
------------------------------
Date: Fri, 05 Nov 2004 02:54:11 +0100
From: "Robert Sedlacek" <phaylon@dunkelheit.at>
Subject: Re: web hoster won't secure CGI
Message-Id: <opsgyx8lsq2n465k@localhost>
Am 01 Nov 2004 19:55:15 GMT schrieb <ctcgag@hotmail.com>:
> I am not an expert on this, but I believe that the OS provides the
> capabilities to limit user processes in various which, if employed, would
> be just as effective against mult-megabyte uploads as the changes to CGI
> would be. (And would also protect against other things that changing CGI
> does not.)
Sure. (man) ulimit [-a] tells it's possible to limit file sizes, maximal
locked memory, maximum memory size, opened files, cpu time, maximum user
processes, virtual memory size and some others.
g,
Robert
--
http://www.dunkelheit.at/
------------------------------
Date: Fri, 05 Nov 2004 00:24:30 GMT
From: ChrisO <ceo@nospam.on.net>
Subject: Re: Win32 Advanced Properties
Message-Id: <2Lzid.26587$Qv5.19946@newssvr33.news.prodigy.com>
Mike wrote:
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in
> news:Xns95956B262E964asu1cornelledu@132.236.56.8:
>
>
>>"Jürgen Exner" <jurgenex@hotmail.com> wrote in
>>news:n%Mhd.2934$cA4.2291@trnddc01:
>>
>>
>>Fundamentally, you are correct. EXIF information should be preferred
>>rather than OS specific methods.
>>
>>NTFS does have these alternative streams that can be associated with
>>files. The OP might want to look at:
>>
>>http://tinyurl.com/5ub5n
>>
>>However, as another poster has also mentioned, I would urge the OP to
>>manipulate EXIF information than NTFS alternative streams
>>
>
>
> Hmmm...
> <DisplayOfIgnorance>
> when I right-click on an image file, and select 'Properties', am I looking
> at the EXIF information or NTFS information?
> The properties sheet (under the summary tab) shows elements like 'Width',
> 'Height', 'Horizontal Resolution', 'Frame Count', 'Camera Model', 'Focal
> Length', 'ISO Speed' and more. WHose properties are these?
> </DisplayOfIgnorance>
>
What makes you think that Microsoft didn't write the same logic you are
looking for and they just present the information in a Windows-style
Property sheet for the image file you've clicked on (which is what they
are probably doing...)?
-ceo
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 7359
***************************************