[24393] in Perl-Users-Digest
Perl-Users Digest, Issue: 6581 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 19 11:05:44 2004
Date: Wed, 19 May 2004 08:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 19 May 2004 Volume: 10 Number: 6581
Today's topics:
Called as CGI or from command line? <please_post@nomail.edu>
Re: Called as CGI or from command line? <tadmc@augustmail.com>
Re: Called as CGI or from command line? <blah@blah.com>
Re: Called as CGI or from command line? <flavell@ph.gla.ac.uk>
Re: Called as CGI or from command line? <1usa@llenroc.ude>
Re: Can't build GD.pm on Solaris8 <jure.simsic@mobitel.si>
Re: How do I scope a variable if the variable name cont (Anno Siegel)
Re: how to clear the terminal <me@privacy.net>
iterating over arrays with map - problem <mothra@mothra.com>
Re: iterating over arrays with map - problem <remorse@partners.org>
Re: Meaning of Orthogonality <gnari@simnet.is>
Re: Meaning of Orthogonality <ewijaya@singnet.com.sg>
Re: Meaning of Orthogonality <1usa@llenroc.ude>
Re: Password scheme/Persistent session... <tadmc@augustmail.com>
pcap -> sniffer <cruxnor@seekline.net>
Re: performance questions <gnari@simnet.is>
Re: random IP chris-usenet@roaima.co.uk
rmdir Question <georgekinley@hotmail.com>
Re: rmdir Question <mothra@mothra.com>
Re: rmdir Question <jurgenex@hotmail.com>
Re: rmdir Question <tadmc@augustmail.com>
Re: rmdir Question <georgekinley@hotmail.com>
Re: rmdir Question <jwillmore@remove.adelphia.net>
script aborting <jcharth@hotmail.com>
Re: script aborting <tadmc@augustmail.com>
Re: SOLVED: How do I scope a variable if the variable n <richard@zync.co.uk>
Re: SOLVED: How do I scope a variable if the variable n <uri@stemsystems.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 19 May 2004 13:45:45 +0000 (UTC)
From: bill <please_post@nomail.edu>
Subject: Called as CGI or from command line?
Message-Id: <c8foe9$hcp$2@reader2.panix.com>
Is there a way for a Perl script to know whether it was called via
a CGI request or through the command line?
Thanks,
-bill
------------------------------
Date: Wed, 19 May 2004 08:52:47 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Called as CGI or from command line?
Message-Id: <slrncamplf.6k8.tadmc@magna.augustmail.com>
bill <please_post@nomail.edu> wrote:
>
>
> Is there a way for a Perl script to know whether it was called via
> a CGI request or through the command line?
I dunno off-hand.
But I _do_ know how to tell if it was run from a tty (command line)
or not:
perldoc -f -t
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 19 May 2004 10:31:24 -0400
From: Sherif Zaroubi <blah@blah.com>
Subject: Re: Called as CGI or from command line?
Message-Id: <opr783ymtfcx74rp@news.videotron.ca>
On Wed, 19 May 2004 08:52:47 -0500, Tad McClellan <tadmc@augustmail.com>
wrote:
> bill <please_post@nomail.edu> wrote:
>>
>>
>> Is there a way for a Perl script to know whether it was called via
>> a CGI request or through the command line?
>
>
> I dunno off-hand.
>
> But I _do_ know how to tell if it was run from a tty (command line)
> or not:
>
> perldoc -f -t
>
>
Check the environement variables ( %ENV, for example: $ENV{REMOTE_ADDR} )
------------------------------
Date: Wed, 19 May 2004 15:43:09 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Called as CGI or from command line?
Message-Id: <Pine.LNX.4.53.0405191538120.24426@ppepc56.ph.gla.ac.uk>
On Wed, 19 May 2004, bill wrote:
> Is there a way for a Perl script to know whether it was called via
> a CGI request or through the command line?
But what's your _real_ question?
The CGI defines a common gateway interface. That interface includes
some environment variables, standard input, and standard output.
Those define the "common gateway". Anything else would be incidental,
and probably dependent on the web server etc.
So, if you wanted to test a CGI script from the command line, you
could set those variables beforehand. And then the script would think
it was being called from a CGI request. Now tell us whether you'd
define that to be "the command line" or "a CGI request". In a sense
it would be both, since you would have established the defined
requirements for the Common Gateway Interface.
------------------------------
Date: 19 May 2004 14:51:54 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: Called as CGI or from command line?
Message-Id: <Xns94EE6E8699EB7asu1cornelledu@132.236.56.8>
Sherif Zaroubi <blah@blah.com> wrote in
news:opr783ymtfcx74rp@news.videotron.ca:
> On Wed, 19 May 2004 08:52:47 -0500, Tad McClellan
> <tadmc@augustmail.com> wrote:
>
>> bill <please_post@nomail.edu> wrote:
>>>
>>> Is there a way for a Perl script to know whether it was called via
>>> a CGI request or through the command line?
>>
>> I dunno off-hand.
>
> Check the environement variables ( %ENV, for example: $ENV{REMOTE_ADDR} )
IMHO, checking $ENV{GATEWAY_INTERFACE} interface communicates the purpose
of the code more clearly.
--
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)
------------------------------
Date: Wed, 19 May 2004 11:42:42 GMT
From: "Jure Simsic" <jure.simsic@mobitel.si>
Subject: Re: Can't build GD.pm on Solaris8
Message-Id: <SKHqc.3331$37.401510@news.siol.net>
Thanks..This solved the issue at once..
Jure
Martien Verbruggen wrote:
> On Tue, 18 May 2004 07:31:45 GMT,
> Jure Simsic <jure.simsic@mobitel.si> wrote:
> > I cant't build GD-1.41 on Solaris 8. When building, I get:
> ^^^^^^^
>
> > I'm using
> > - v5.8.3 built for sun4-solaris
> > - gcc version 3.2.3
> > - libgd gd-2.0.23 with jpeg & png & freetype
> ^^^^^^
>
> The underlined version numbers are your problem. The GD module with
> versions starting with 1 require a libgd version starting with 1. The
> libgd versions starting with 2 are matched by a GD version starting
> with 2. The main reason for this is that the library and its API
> changed considerably when libgd version 2 was released. The GD
> module's interface hasn't changed that much.
>
------------------------------
Date: 19 May 2004 09:46:49 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How do I scope a variable if the variable name contains a variable?
Message-Id: <c8fae9$qn7$1@mamenchi.zrz.TU-Berlin.DE>
Uri Guttman <uri@stemsystems.com> wrote in comp.lang.perl.misc:
> >>>>> "JC" == Jim Cochrane <jtc@shell.dimensional.com> writes:
>
> JC> In article <e4c916dd.0405181656.5d92e96e@posting.google.com>,
> David Filmer wrote:
> >> I can do this:
> >>
> >> my @bar; #explicit name - fine
> >>
> >> but not this:
> >>
> >> my $foo = 'bar'; #fine
>
> >> my @{$foo}; #oops
>
> JC> my $f = [1, 2, 3];
> JC> print "@{$f}\n";
> JC> print "@$f\n";
>
> JC> Is this what you're looking for?
>
> he is looking for the evil symrefs, which luckily you didn't provide.
Not necessarily, though the subject certainly looks like that.
I read the question as: "How can I make the array "@{ $foo}" a lexical
array?". This question makes as much (or as little) sense whether
$foo contains a variable name (symref) or a legit array-reference (hard
ref).
In either case the answer is "You can't". In the case of a symref the
actual array *must* be a package variable, so it can't be a lexical.
But we're not talking about symrefs anyway, are we?
In the case of an arrayref the actual array is anonymous. "Lexical"
pertains to the scope where a variable *name* is valid. Since @{ $foo}
doesn't have a name, the distinction doesn't apply. The scope of an
anonymous variable, if we want to apply the term, would be the scope
of the underlying named variable ($foo in this case). It doesn't
have one of its own.
Anno
------------------------------
Date: Wed, 19 May 2004 23:00:18 +1200
From: "Tintin" <me@privacy.net>
Subject: Re: how to clear the terminal
Message-Id: <2h0t0qF7jlrsU1@uni-berlin.de>
"Hobbit HK" <hobbit_hk@hotmail.com> wrote in message
news:22ee5d47.0405181104.68b85c89@posting.google.com...
> Robert Meyer <egoist99NO@SPAMyahoo.de> wrote in message
news:<pan.2004.05.17.16.16.02.824151@SPAMyahoo.de>...
> > Hi NG,
> >
> > sorry for my question, but i didn't found anything about how to clear
the
> > terminal.
> > I try `clear`; in the script but this does not work.
> >
>
> You can always print the output of clear:
> print `clear`;
That's about as useful as doing
echo `ls -l`
------------------------------
Date: Wed, 19 May 2004 13:23:35 GMT
From: Mothra <mothra@mothra.com>
Subject: iterating over arrays with map - problem
Message-Id: <rdJqc.15775781$Of.2631913@news.easynews.com>
Trying (just for fun) to write my own Perl version of 'Crack' but am
stumbling a bit trying to iterate over my dictionary file to generate
possible passwords. When I run the code below with "dictionary.txt"
containing the single word "password", I get around 4,000 entries, most
of which are identical, even though on most occassions there is no
subsitution to be made.
I tried using next in the map block, but it won't let me. What I would
like it to generate (for each word in the dictionary file) all possible
letter/number substitution combinations, that is, not to simply
accumulate changes, but nor to needlessly repeat them either.
The best I can get is either:
password
p4ssword
p455word
p455w0rd
which is useless; the only other result I get is thousands of redundant
entries.
What is the more efficient way I should be writing this (see below)?
---------------------------------
sub init_dictionary {
open(DICT,"dictionary.txt");
chomp(@dict=<DICT>);
close DICT;
push @dict, map { s/[aA]/4/g;$_ } @dict;
push @dict, map { s/[bB]/8/g;$_ } @dict;
push @dict, map { s/[eE]/3/g;$_ } @dict;
push @dict, map { s/[gG]/6/g;$_ } @dict;
push @dict, map { s/[iI]/1/g;$_ } @dict;
push @dict, map { s/[lL]/1/g;$_ } @dict;
push @dict, map { s/[oO]/0/g;$_ } @dict;
push @dict, map { s/[sS]/5/g;$_ } @dict;
push @dict, map { s/[tT]/7/g;$_ } @dict;
push @dict, map { s/[zZ]/2/g;$_ } @dict;
}
------------------------------
Date: Wed, 19 May 2004 10:47:00 -0400
From: Richard Morse <remorse@partners.org>
Subject: Re: iterating over arrays with map - problem
Message-Id: <remorse-2C92CE.10470019052004@plato.harvard.edu>
In article <rdJqc.15775781$Of.2631913@news.easynews.com>,
Mothra <mothra@mothra.com> wrote:
> Trying (just for fun) to write my own Perl version of 'Crack' but am
> stumbling a bit trying to iterate over my dictionary file to generate
> possible passwords. When I run the code below with "dictionary.txt"
> containing the single word "password", I get around 4,000 entries, most
> of which are identical, even though on most occassions there is no
> subsitution to be made.
>
> I tried using next in the map block, but it won't let me. What I would
> like it to generate (for each word in the dictionary file) all possible
> letter/number substitution combinations, that is, not to simply
> accumulate changes, but nor to needlessly repeat them either.
>
> The best I can get is either:
> password
> p4ssword
> p455word
> p455w0rd
>
> which is useless; the only other result I get is thousands of redundant
> entries.
>
> What is the more efficient way I should be writing this (see below)?
>
> ---------------------------------
> sub init_dictionary {
> open(DICT,"dictionary.txt");
> chomp(@dict=<DICT>);
> close DICT;
>
> push @dict, map { s/[aA]/4/g;$_ } @dict;
> push @dict, map { s/[bB]/8/g;$_ } @dict;
> push @dict, map { s/[eE]/3/g;$_ } @dict;
> push @dict, map { s/[gG]/6/g;$_ } @dict;
> push @dict, map { s/[iI]/1/g;$_ } @dict;
> push @dict, map { s/[lL]/1/g;$_ } @dict;
> push @dict, map { s/[oO]/0/g;$_ } @dict;
> push @dict, map { s/[sS]/5/g;$_ } @dict;
> push @dict, map { s/[tT]/7/g;$_ } @dict;
> push @dict, map { s/[zZ]/2/g;$_ } @dict;
>
> }
I think the following may do what you want, although I'm not positive it
catches every possible variation. I've left in the print statements
that show everything it tries...
#!/usr/bin/perl
use strict;
use warnings;
my $init_word = 'password';
my %sub_matrix;
@sub_matrix{qw/A a B b E e G g I i L l O o S s T t Z z/} =
qw/4 4 8 8 3 3 6 6 1 1 1 1 0 0 5 5 7 7 2 2/;
my %words;
$words{$init_word}++;
my $was_new = 1;
while($was_new) {
$was_new = 0;
foreach my $word (keys %words) {
foreach my $sub_let (keys %sub_matrix) {
my $temp = $word;
while ($temp =~ s/$sub_let/$sub_matrix{$sub_let}/) {
print "# tried $temp";
if (!defined($words{$temp})) {
$was_new++;
$words{$temp}++;
print " - was new";
}
print "\n";
}
}
}
}
print "\n";
print map { $_ . "\n" } sort keys %words;
__END__
Output:
# tried p4ssword - was new
# tried passw0rd - was new
# tried pa5sword - was new
# tried pa55word - was new
# tried p4ssw0rd - was new
# tried p45sword - was new
# tried p455word - was new
# tried p4ssword
# tried passw0rd
# tried pa5sword
# tried pa55word
# tried p45sword
# tried pa5sw0rd - was new
# tried pa55word
# tried p4ssw0rd
# tried pa5sw0rd
# tried pa55w0rd - was new
# tried p455word
# tried pa55w0rd
# tried p4ssw0rd
# tried p45sword
# tried p455word
# tried p4ssword
# tried passw0rd
# tried pa5sword
# tried pa55word
# tried p455w0rd - was new
# tried p45sword
# tried pa5sw0rd
# tried pa55word
# tried p45sw0rd - was new
# tried p455w0rd
# tried p45sw0rd
# tried pa55w0rd
# tried p4ssw0rd
# tried pa5sw0rd
# tried pa55w0rd
# tried p455w0rd
# tried p45sw0rd
# tried p455word
# tried p455word
# tried pa55w0rd
# tried p4ssw0rd
# tried p45sword
# tried p455word
# tried p4ssword
# tried passw0rd
# tried pa5sword
# tried pa55word
# tried p455w0rd
# tried p4ssw0rd
# tried pa5sw0rd
# tried pa55w0rd
# tried p455w0rd
# tried p455word
# tried pa55w0rd
# tried p455w0rd
# tried p45sword
# tried pa5sw0rd
# tried pa55word
# tried p45sw0rd
# tried p455w0rd
# tried p45sw0rd
# tried pa55w0rd
# tried p45sw0rd
# tried p455word
p455w0rd
p455word
p45sw0rd
p45sword
p4ssw0rd
p4ssword
pa55w0rd
pa55word
pa5sw0rd
pa5sword
passw0rd
password
----------
HTH,
Ricky
--
Pukku
------------------------------
Date: Wed, 19 May 2004 08:34:03 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Meaning of Orthogonality
Message-Id: <c8f62u$qbm$1@news.simnet.is>
"Gregory Toomey" <nospam@bigpond.com> wrote in message
news:6461687.pkFTbbq1S8@GMT-hosting-and-pickle-farming...
[about orthogonality]
> For example, many of Perl's functions work on both scalars and arrays.
but many times, the scalar functionality does something different
than the other one, so I am not sure 'orthogonal' applies to Perl
in fact all the DWIMmery sounds pretty non-orthogonal to me.
gnari
------------------------------
Date: Wed, 19 May 2004 22:35:45 -0000
From: Edward Wijaya <ewijaya@singnet.com.sg>
Subject: Re: Meaning of Orthogonality
Message-Id: <opr79qdvt4uj0cst@news.singnet.com.sg>
Mr. Wall said so can be found in Camel Book.
On Wed, 19 May 2004 08:43:13 -0000, Edward Wijaya <ewijaya@singnet.com.sg>
wrote:
> Perl is said to be an "orthogonal" programming language.
> What does it mean?
>
> Regards
> Edward WIJAYA
> SINGAPORE
>
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
------------------------------
Date: 19 May 2004 15:00:45 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: Meaning of Orthogonality
Message-Id: <Xns94EE700741B0Aasu1cornelledu@132.236.56.8>
Edward Wijaya <ewijaya@singnet.com.sg> wrote in
news:opr79qdvt4uj0cst@news.singnet.com.sg:
[ please do not top-post ]
> On Wed, 19 May 2004 08:43:13 -0000, Edward Wijaya
> <ewijaya@singnet.com.sg> wrote:
>
>> Perl is said to be an "orthogonal" programming language.
>> What does it mean?
> Mr. Wall said so can be found in Camel Book.
Could you give a page number please? I would like to see the quotation in
context.
--
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)
------------------------------
Date: Wed, 19 May 2004 07:19:06 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Password scheme/Persistent session...
Message-Id: <slrncamk5q.692.tadmc@magna.augustmail.com>
Pinocchio <krakle@visto.com> wrote:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<c82i7e$n92$1@mamenchi.zrz.TU-Berlin.DE>...
>> krakle <krakle@visto.com> wrote in comp.lang.perl.misc:
>> > Thank you. However, the whole point to my post was to see if I could
>> > do a session with out cookies...
>>
>> ...which is way off topic for clpm. Why ask that here?
> So, how doesn't a
> miscellaneous perl question belong here?
A miscellaneous Perl question _does_ belong here.
But that isn't the kind of question you asked above.
There is nothing language-specific in your question.
Your question is not about Perl. Your question is about how to
maintain state in CGI applications.
Correctly partitioning the problem is a huge step toward solving
the problem.
First find out if maintaining state without cookies is possible,
if it is, _then_ it is appropriate to turn your attention to how
to implement it in some particular programming language.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 19 May 2004 15:52:39 +0200
From: cruxnor <cruxnor@seekline.net>
Subject: pcap -> sniffer
Message-Id: <pan.2004.05.19.13.52.39.256682@seekline.net>
Hello,
I'm trying to code a simple sniffer in perl, but the results I get
from pcap aren't those I had expected!
My process sub looks like this:
sub process_pkt {
my($user_data, $hdr, $pkt) = @_;
print "$pkt\n";
}
And the results is something like this:
@ø7À¨K8À¨KÝngóAÍsPúð^3
@ù7À¨K8À¨KÝngóAÍsPúð^3
âmûôuóÚE6ë@ø$À¨K8À¨KÝngóAÍPúÅBÀUSER XXXX
uóQâmûE6ë@ù$À¨K8À¨KÝngóAÍPúÅBÀUSER XXXX
âmûôuóÚE4ë@ø!À¨K8À¨KÝngó¡AÍÄPú¶?PASS XXXX
uóQâmûE4ë@ù!À¨K8À¨KÝngó¡AÍÄPú¶?PASS XXXX
âmûôuóÚE.ë@ø"À¨K8À¨KÝngóAÍòPúq¼XSTAT
uóQâmûE.ë@ù"À¨K8À¨KÝngóAÍòPúq¼XSTAT
âmûôuóÚE.ë!@øÀ¨K8À¨KÝngó³AÎPúc±]LIST
When I sniff the network with ngrep, the result is much more
readable!
The initialization of pcap is the same as in the documentation.
Does anybody has an idea for this problem?
I'm looking for a sniffer like ngrep output-style.
ciau, cruxnor
------------------------------
Date: Wed, 19 May 2004 08:49:58 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: performance questions
Message-Id: <c8f70n$qe0$1@news.simnet.is>
"Charlie" <cji_work@yahoo.com> wrote in message
news:1dc70d61.0405182057.12540fca@posting.google.com...
[application testing]
> So far I have created some testcases to test two kinds of orders. The
> first one takes about 20 mi-seconds for that period of time, while the
> second one takes about 20,000 mi-seconds. To create those two kinds of
> orders, it may needs some extra informations for the second one than
> the first one.
>
> So based on the above description, can I necessarily say that the
> performance of the second one is not as good as the first one ???
I am not sure I understand what you are asking.
whether 20 seconds is too long depends on:
a) how much processing has to take place
b) how much processing the user imagines has to take place
what you should be concerned about is how does your
system scale with load. does the 20 sec request take 2 secs under
low load? in that case you are suffering from a bottleneck
also, you should make sure that the same request sequences return
the same results under high and inder low load
also, you should find out if there is some load shreshold where
your application fails miserably, and figure out if that
level is acceptable, and make plans to monitor when you are
nearing that shreshold.
gnari
------------------------------
Date: Wed, 19 May 2004 10:32:59 +0100
From: chris-usenet@roaima.co.uk
Subject: Re: random IP
Message-Id: <b7mrn1-n09.ln1@moldev.cmagroup.co.uk>
In article <XFoqc.18062$qJ5.471120@news20.bellglobal.com>,
Bob <bob.lockie.NOSPAM@mail.com> wrote:
> I need to generate an IP address based on a random number.
Are there any "business" restrictions on your generated IP address? For
example, would 127.0.0.1 be acceptable? What about 192.168.255.255?
Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca> suggested:
> my @t = unpack "C*", pack "L", time;
> my $ip = join ".", @t[-4..-1];
This will generate a different 4-octet value for each second. These are
not necessarily valid IP addresses (but nor is putting a dot between
every two decimal digits of the current time in seconds, as suggested
by the OP).
Chris
------------------------------
Date: Wed, 19 May 2004 12:51:28 GMT
From: "George Kinley" <georgekinley@hotmail.com>
Subject: rmdir Question
Message-Id: <kLIqc.16799$k4.338713@news1.nokia.com>
Hi
On Win2K, When I use rmdir , if the directory is open in other command
window or in Explorer, it does not delete , and prints our "cannot remove
%"#" ,
my question is , is it possible to override this limitation
-
------------------------------
Date: Wed, 19 May 2004 13:24:33 GMT
From: Mothra <mothra@mothra.com>
Subject: Re: rmdir Question
Message-Id: <leJqc.15682722$Id.2599651@news.easynews.com>
George Kinley wrote:
> Hi
> On Win2K, When I use rmdir , if the directory is open in other command
> window or in Explorer, it does not delete , and prints our "cannot remove
> %"#" ,
> my question is , is it possible to override this limitation
> -
No, and with good reason.
------------------------------
Date: Wed, 19 May 2004 13:43:36 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: rmdir Question
Message-Id: <cwJqc.256$dq4.36@nwrddc01.gnilink.net>
George Kinley wrote:
> On Win2K, When I use rmdir , if the directory is open in other
> command window or in Explorer, it does not delete , and prints our
> "cannot remove %"#" ,
> my question is , is it possible to override this limitation
And your Perl question is ....?
jue
------------------------------
Date: Wed, 19 May 2004 08:56:35 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: rmdir Question
Message-Id: <slrncampsj.6k8.tadmc@magna.augustmail.com>
Jürgen Exner <jurgenex@hotmail.com> wrote:
> George Kinley wrote:
>> On Win2K, When I use rmdir , if the directory is open in other
>> command window or in Explorer, it does not delete , and prints our
>> "cannot remove %"#" ,
>> my question is , is it possible to override this limitation
>
> And your Perl question is ....?
He's made off-topic posts before too:
Message-ID: <jmk3c.11154$k4.233803@news1.nokia.com>
I've arranged to ignore all of his posts since that one.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 19 May 2004 14:14:44 GMT
From: "George Kinley" <georgekinley@hotmail.com>
Subject: Re: rmdir Question
Message-Id: <oZJqc.16808$k4.339012@news1.nokia.com>
hey, what is wrong with the question,
I want to know if it is possible to delete the dir, even if it is being
used, is it possible to do in perl,
all of as are not as good as your all are, but at least we can try,
it is not good to see comments like > I've arranged to ignore all of his
posts since that one.
"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrncampsj.6k8.tadmc@magna.augustmail.com...
> Jürgen Exner <jurgenex@hotmail.com> wrote:
> > George Kinley wrote:
> >> On Win2K, When I use rmdir , if the directory is open in other
> >> command window or in Explorer, it does not delete , and prints our
> >> "cannot remove %"#" ,
> >> my question is , is it possible to override this limitation
> >
> > And your Perl question is ....?
>
>
> He's made off-topic posts before too:
>
> Message-ID: <jmk3c.11154$k4.233803@news1.nokia.com>
>
> I've arranged to ignore all of his posts since that one.
>
>
> --
> Tad McClellan SGML consulting
> tadmc@augustmail.com Perl programming
> Fort Worth, Texas
------------------------------
Date: Wed, 19 May 2004 10:48:22 -0400
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: rmdir Question
Message-Id: <pan.2004.05.19.14.48.20.699199@remove.adelphia.net>
On Wed, 19 May 2004 14:14:44 +0000, George Kinley wrote:
> hey, what is wrong with the question,
> I want to know if it is possible to delete the dir, even if it is being
> used, is it possible to do in perl,
> all of as are not as good as your all are, but at least we can try,
> it is not good to see comments like > I've arranged to ignore all of his
> posts since that one.
Most of the time, *any* filesystem will *not* allow you to remove a
directory that is in use or is not empty. This is a protection of the
filesystem and *not* related to Perl in any way.
However, if you want to remove something using Perl, then read up on
'unlink' (`perldoc -f unlink`) and 'rmdir' (`perldoc -f rmdir`). And yes,
you should read *both* documents, because there is relavent information in
'unlink' as it pertains to 'rmdir'.
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
The trouble with a kitten is that When it grows up, it's always
a cat -- Ogden Nash.
------------------------------
Date: Wed, 19 May 2004 11:50:02 GMT
From: joe <jcharth@hotmail.com>
Subject: script aborting
Message-Id: <Xns94EE4F7E260EAjosephthecianet@207.69.154.202>
1/1000 times this statement fails msg = parsed->body; using email mime
modules. i am using strict on my pl file, is there a way to cause the
script to keep running when this statement fails? thanks.
------------------------------
Date: Wed, 19 May 2004 08:59:29 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: script aborting
Message-Id: <slrncamq21.6k8.tadmc@magna.augustmail.com>
joe <jcharth@hotmail.com> wrote:
> 1/1000 times this statement fails msg = parsed->body;
What does "fails" mean when you say it?
Are any messages issued? What do they say exactly?
> using email mime
> modules.
There are lots of them. Which one are you using?
> i am using strict on my pl file,
Are you getting messages about strict violations?
> is there a way to cause the
> script to keep running when this statement fails?
That depends on how it fails, and you haven't told us how it fails.
A diagnosis is much easier to make if you know a symptom or two...
Have you seen the Posting Guidelines that are posted here frequently?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 19 May 2004 10:58:11 +0100
From: "Richard Gration" <richard@zync.co.uk>
Subject: Re: SOLVED: How do I scope a variable if the variable name contains a variable?
Message-Id: <c8fb3d$fd2$1@news.freedom2surf.net>
In article <x7oeolos75.fsf@mail.sysarch.com>, "Uri Guttman"
<uri@stemsystems.com> wrote:
>>>>>> "D" == DavidFilmer <IneverReadAnythingSentToMe@hotmail.com>
>>>>>> writes:
<snip>
> D> use strict;
>
> D> my %array; #this is the hash that Uri mentioned
> D> my $foo = 'bar';
>
> D> @{$array{$foo}} = qw/a b c d e f g/; #or whatever
>
> D> print @{$array{$foo}}; #same as: @{$array{'bar'}}
>
> and you fell into the trap of the evil symref.
Did he? This looks like a plain case of using a variable to hold a hash
key ... ?
Confused, I am. Could you please explain what I'm missing?
Rich
------------------------------
Date: Wed, 19 May 2004 13:42:33 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: SOLVED: How do I scope a variable if the variable name contains a variable?
Message-Id: <x7d650pm7q.fsf@mail.sysarch.com>
>>>>> "RG" == Richard Gration <richard@zync.co.uk> writes:
RG> In article <x7oeolos75.fsf@mail.sysarch.com>, "Uri Guttman"
RG> <uri@stemsystems.com> wrote:
>>>>>>> "D" == DavidFilmer <IneverReadAnythingSentToMe@hotmail.com>
>>>>>>> writes:
RG> <snip>
D> use strict;
>>
D> my %array; #this is the hash that Uri mentioned
D> my $foo = 'bar';
>>
D> @{$array{$foo}} = qw/a b c d e f g/; #or whatever
>>
D> print @{$array{$foo}}; #same as: @{$array{'bar'}}
>>
>> and you fell into the trap of the evil symref.
RG> Did he? This looks like a plain case of using a variable to hold a hash
RG> key ... ?
RG> Confused, I am. Could you please explain what I'm missing?
on second thought it does look like hard refs and accidental
autovivification discovery. i just smelled symrefs from the OP and that
code at first glance looked like it was used.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
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 6581
***************************************