[17709] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5129 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 16 09:05:41 2000

Date: Sat, 16 Dec 2000 06:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <976975508-v9-i5129@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 16 Dec 2000     Volume: 9 Number: 5129

Today's topics:
    Re: [q] split in while loop <abe@ztreet.demon.nl>
        chmod under Win32 <bbgraph@scioto.net>
    Re: chmod under Win32 <willem@veenhoven.com>
    Re: Crazy RegExp please?-DONE <WebMaster3@qax.org>
    Re: Crazy RegExp please? <johngros@Spam.bigpond.net.au>
    Re: Crazy RegExp please? <WebMaster3@qax.org>
    Re: Crazy RegExp please? <bart.lateur@skynet.be>
    Re: Is Perl dying? <bart.lateur@skynet.be>
    Re: open window in Perl? <tick.toff@spam.com>
    Re: Perl programming (Martien Verbruggen)
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <bart.lateur@skynet.be>
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <johngros@Spam.bigpond.net.au>
        PPM question <johngros@Spam.bigpond.net.au>
    Re: PPM question <johngros@Spam.bigpond.net.au>
    Re: Problem using Image::Size on a webserver <bart.lateur@skynet.be>
    Re: Regular Expression Help <bart.lateur@skynet.be>
    Re: Windows cant recognize the original owner (Martijn Lievaart)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 16 Dec 2000 13:59:30 +0100
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: [q] split in while loop
Message-Id: <22pm3t067lgqb62itivm81o24sd988qfh2@4ax.com>

On Fri, 15 Dec 2000 15:13:50 GMT, Drew Myers <bh_ent@my-deja.com> wrote:

> Ok,
> 
> That solved the split issue.  The second problem I'm having.  It seems
> that the line:
> 
> next if (/avm/) {
>   $free = (split)[1];
>   print $free;
> }

That doesn't compile.
 
> matches the string avm, which is what I want.  The output from the
> print statement prints everything except the line with "avm".  How do I
> match just the second field of the following line?

Make it read the next line explicitly whenever it finds a line with
'avm'.

#!/usr/bin/perl -w
use strict;

while ( <DATA> ) {
	if ( /avm/ ) {
		my $free = (split ' ', <DATA>)[1];
		print "Free: $free\n";
	}
}

__DATA__
 avm     free  si   so   pi   po   fr   de   sr   in    sy   cs
62401  418249  0    0    0    0    0    0    0    74    99  268

CPU
    cpu          procs
us sy id    r    b    w
24  6 71    1    2    0

-- 
Good luck,
Abe
perl -wle '$_=q@Just\@another\@Perl\@hacker@;print qq@\@{[split/\@/]}@'


------------------------------

Date: Sat, 16 Dec 2000 13:53:08 GMT
From: "Bob" <bbgraph@scioto.net>
Subject: chmod under Win32
Message-Id: <8tK_5.569$Y2.8983@news>

I have read the docs for using the chmod command under ActiveState's perl
version but I am unsure as to the correct syntax.

I'd like to be able to chmod an entire directory of a group of files within
a directory from the command prompt rather than via Windows Explorer under
NT.

Has anyone used this successfully under NT?

Thanks

Bob




------------------------------

Date: Sat, 16 Dec 2000 14:54:25 +0100
From: willem veenhoven <willem@veenhoven.com>
Subject: Re: chmod under Win32
Message-Id: <3A3B7411.EC307171@veenhoven.com>

Bob wrote:
> 
> I'd like to be able to chmod an entire directory of a group of files
> within a directory from the command prompt rather than via Windows
> Explorer under NT.

Uhh? You do not need and even can't chmod under NT ... 

willem


------------------------------

Date: Sat, 16 Dec 2000 13:34:10 +0000
From: Kul <WebMaster3@qax.org>
To: bart.lateur@skynet.be
Subject: Re: Crazy RegExp please?-DONE
Message-Id: <3A3B6F52.1EE13C31@qax.org>

Bart,    Your the best,
I knew it was possible in a short lump of code,
All I now need to do is look through your snipet, and understand it properly, for now and for my future coding.
I had succeded with a couple of loops, but the code was 30+ lines, your version is exactly what I was looking for, and only 2 lines, and what annoyed me the most was I could see it would be possible.  wonderfully, and short, compact.

MANY MANY MANY MANY thanks,
Best Regards
Kul
+------- ------ ----- ---- --- -- - - -  -   -    -     -      -
"Scientia est Potentia" - "Knowledge is Power" ...... if you ain't got it, then blag it!
+------- ------ ----- ---- --- -- - - -  -   -    -     -      -
 Any Syntax or Spelling Errors are nothing to do with me,
      They must be Transmission Errors !
+------- ------ ----- ---- --- -- - - -  -   -    -     -      -

Bart Lateur wrote:

> Kul wrote:
>
> >input =  a string of words/chars, some may be enclosed in quotes, and some may not, as well as other junk characters which I dont want.
> >I would like to grab all the text between two quotes, (a phrase), and then from the remainer grab all the words/chars that are seperated by non alphanumeric chars.  Order is unimportant!  - It could also contain an odd number of quotes, then I would like it to grab from the last quote until the end of the variable, as if it had a traling quote.  I do not want the quotes in the end result, but removing these later with all the non alphanumberic chars is not a problem for me.
> >It just the spliting of the string that mashed my head up  :-(
> >
> >Some example (invented) data in a single input ($inputvar):
> >"john and 7374398 paul"   $%£  nobody"jim" "jon" somebody else "*-())8are all friends" oh yes"excelent man9999
> >
> >I would like the following output,  in an @outputstuff  if poss :
> >john and paul
> >nobody
> >jim
> >jon
> >somebody
> >else
> >are all friends
> >oh
> >yes
> >excelent man
>
> Don't try this in one step. Try it in two. First: parse of the chunk of
> data which you want. Two: postprocess this, extracting all words from
> it, and joining these words together into one string, with one space
> between the words. This will work:
>
>         $\ = $, = "\n";
>         $_ = '"john and 7374398 paul"   $%£  nobody"jim" "jon" somebody
> else "*-())8are all friends" oh yes"excelent man9999';
>         my @result;
>         while(/("[^"]*"?|[a-zA-Z]+)/g) {
>                 push @result, join ' ', $1 =~ /([a-zA-Z]+)/g;
>         }
>         print @result;
>
> You might have a small problem with empty matches from quoted strings.
> You may want to filter those from @result.
>
> --
>         Bart.



------------------------------

Date: Sat, 16 Dec 2000 08:18:02 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: Crazy RegExp please?
Message-Id: <_yF_5.20402$xW4.160009@news-server.bigpond.net.au>

I suggest you strip everything that is not a letter or a quote then in a
loop pluck out what is inside the first quotes as one entry, then strip out
the words on spaces till you get to the next quote and then go through the
loop again. Someone else might be able to do it in one line but I see two
regex's in one loop.
"John Michael" <johnm@acadiacom.net> wrote in message
news:3a3ae422@news.acadiacom.net...
Perl has an excellent book on regular expressions that could teach you how
to do it.  It is an O'Reilly book as well if you don't get the help from
someone else.  I don't have the book with me and can't do it from my head.
I think someone will probably need more information.
Here is what I think the process would be.
Since it looks like you are identifying words by A-Z, a-z
Start from beginning of line.
Get rid of everything that isn't (A-Z,a-z) with a substitution operator with
nothing in it.
Split it on white space into an array and you have your words.
Hope this helps


In Perl, Heres an easy one for you all, how can I split the following type
of input?
input =  a string of words/chars, some may be enclosed in quotes, and some
may not, as well as other junk characters which I dont want.
I would like to grab all the text between two quotes, (a phrase), and then
from the remainer grab all the words/chars that are seperated by non
alphanumeric chars.  Order is unimportant!  - It could also contain an odd
number of quotes, then I would like it to grab from the last quote until the
end of the variable, as if it had a traling quote.  I do not want the quotes
in the end result, but removing these later with all the non alphanumberic
chars is not a problem for me.
It just the spliting of the string that mashed my head up  :-(
Some example (invented) data in a single input ($inputvar):
"john and 7374398 paul"   $%£  nobody"jim" "jon" somebody else "*-())8are
all friends" oh yes"excelent man9999
I would like the following output,  in an @outputstuff  if poss :
john and paul
nobody
jim
jon
somebody
else
are all friends
oh
yes
excelent man
Any help (beyond the "O'Reilly - Programming Perl and Perl Cookbook" would
be useful, as Ive read them both and cant find a way of doing it.
Best Regards
Colin
+------- ------ ----- ---- --- -- - - -  -   -    -     -      -
"Scientia est Potentia" - "Knowledge is Power" ...... if you ain't got it,
then blag it!
+------- ------ ----- ---- --- -- - - -  -   -    -     -      -
 Any Syntax or Spelling Errors are nothing to do with me,
      They must be Transmission Errors !
+------- ------ ----- ---- --- -- - - -  -   -    -     -      -




------------------------------

Date: Sat, 16 Dec 2000 11:49:56 +0000
From: Kul <WebMaster3@qax.org>
Subject: Re: Crazy RegExp please?
Message-Id: <3A3B56E4.549B9B6@qax.org>

Thats the only way I could think of doing it, Normally some bright spark has some super cool whizzy regexp that always defeats my loops.  So for once I thought I would see what others thought on it !
Oh well it'll have to be the messy way I suppose !

Best Regards
Colin
+------- ------ ----- ---- --- -- - - -  -   -    -     -      -
"Scientia est Potentia" - "Knowledge is Power" ...... if you ain't got it, then blag it!
+------- ------ ----- ---- --- -- - - -  -   -    -     -      -
 Any Syntax or Spelling Errors are nothing to do with me,
      They must be Transmission Errors !
+------- ------ ----- ---- --- -- - - -  -   -    -     -      -

John Boy Walton wrote:

> I suggest you strip everything that is not a letter or a quote then in a
> loop pluck out what is inside the first quotes as one entry, then strip out
> the words on spaces till you get to the next quote and then go through the
> loop again. Someone else might be able to do it in one line but I see two
> regex's in one loop.
> "John Michael" <johnm@acadiacom.net> wrote in message
> news:3a3ae422@news.acadiacom.net...
> Perl has an excellent book on regular expressions that could teach you how
> to do it.  It is an O'Reilly book as well if you don't get the help from
> someone else.  I don't have the book with me and can't do it from my head.
> I think someone will probably need more information.
> Here is what I think the process would be.
> Since it looks like you are identifying words by A-Z, a-z
> Start from beginning of line.
> Get rid of everything that isn't (A-Z,a-z) with a substitution operator with
> nothing in it.
> Split it on white space into an array and you have your words.
> Hope this helps
>
> In Perl, Heres an easy one for you all, how can I split the following type
> of input?
> input =  a string of words/chars, some may be enclosed in quotes, and some
> may not, as well as other junk characters which I dont want.
> I would like to grab all the text between two quotes, (a phrase), and then
> from the remainer grab all the words/chars that are seperated by non
> alphanumeric chars.  Order is unimportant!  - It could also contain an odd
> number of quotes, then I would like it to grab from the last quote until the
> end of the variable, as if it had a traling quote.  I do not want the quotes
> in the end result, but removing these later with all the non alphanumberic
> chars is not a problem for me.
> It just the spliting of the string that mashed my head up  :-(
> Some example (invented) data in a single input ($inputvar):
> "john and 7374398 paul"   $%£  nobody"jim" "jon" somebody else "*-())8are
> all friends" oh yes"excelent man9999
> I would like the following output,  in an @outputstuff  if poss :
> john and paul
> nobody
> jim
> jon
> somebody
> else
> are all friends
> oh
> yes
> excelent man
> Any help (beyond the "O'Reilly - Programming Perl and Perl Cookbook" would
> be useful, as Ive read them both and cant find a way of doing it.
> Best Regards
> Colin
> +------- ------ ----- ---- --- -- - - -  -   -    -     -      -
> "Scientia est Potentia" - "Knowledge is Power" ...... if you ain't got it,
> then blag it!
> +------- ------ ----- ---- --- -- - - -  -   -    -     -      -
>  Any Syntax or Spelling Errors are nothing to do with me,
>       They must be Transmission Errors !
> +------- ------ ----- ---- --- -- - - -  -   -    -     -      ---



------------------------------

Date: Sat, 16 Dec 2000 11:49:45 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Crazy RegExp please?
Message-Id: <film3togfqsn9lltogn0uqkco87crrc8o4@4ax.com>

Kul wrote:

>input =  a string of words/chars, some may be enclosed in quotes, and some may not, as well as other junk characters which I dont want.
>I would like to grab all the text between two quotes, (a phrase), and then from the remainer grab all the words/chars that are seperated by non alphanumeric chars.  Order is unimportant!  - It could also contain an odd number of quotes, then I would like it to grab from the last quote until the end of the variable, as if it had a traling quote.  I do not want the quotes in the end result, but removing these later with all the non alphanumberic chars is not a problem for me.
>It just the spliting of the string that mashed my head up  :-(
>
>Some example (invented) data in a single input ($inputvar):
>"john and 7374398 paul"   $%£  nobody"jim" "jon" somebody else "*-())8are all friends" oh yes"excelent man9999
>
>I would like the following output,  in an @outputstuff  if poss :
>john and paul
>nobody
>jim
>jon
>somebody
>else
>are all friends
>oh
>yes
>excelent man

Don't try this in one step. Try it in two. First: parse of the chunk of
data which you want. Two: postprocess this, extracting all words from
it, and joining these words together into one string, with one space
between the words. This will work:

	$\ = $, = "\n";
	$_ = '"john and 7374398 paul"   $%£  nobody"jim" "jon" somebody
else "*-())8are all friends" oh yes"excelent man9999';
	my @result;
	while(/("[^"]*"?|[a-zA-Z]+)/g) {
		push @result, join ' ', $1 =~ /([a-zA-Z]+)/g;
	}
	print @result;

You might have a small problem with empty matches from quoted strings.
You may want to filter those from @result.

-- 
	Bart.


------------------------------

Date: Sat, 16 Dec 2000 10:57:05 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Is Perl dying?
Message-Id: <uiim3t8qusneokv5rhjvil4lhq0hk572bo@4ax.com>

John Hunter wrote:

>Quick BASIC
>Thus I embarked on writing a full
>application, including a real time digital oscilloscope and every
>other goddam feature in the world in a language with no libraries and
>little language support.  I had to write my own max functions

Oh yeah. Perl is much better in that regard.

    ;-)

-- 
	Bart.


------------------------------

Date: Sat, 16 Dec 2000 10:40:25 GMT
From: "SuperGumby" <tick.toff@spam.com>
Subject: Re: open window in Perl?
Message-Id: <tEH_5.20544$xW4.160893@news-server.bigpond.net.au>

SO,,, let's move the whole thing into the perl domain

text of learner1.pl ----------------------------------------
#!c:\perl\bin -w
use strict;

use CGI;

my $cgiobject = new CGI;
print $cgiobject->header;

my $twobits = <<twobits;
<html>
<head>
<title>Learner1.pl</title>

<script>
function openWindow()
 {

window.open("learner2.pl","MainWindow","toolbar=no,location=no,directories=n
o,status=no,menubar=no,scrollbars,resizable=no,copyhistory=yes,width=500,hei
ght=350")
 }
</script>
</head>
<body>

<form name=poll action="learner2.pl" method="post" target="MainWindow"
onSubmit="openWindow()">
<input type=submit value="Submit">
</form>

twobits

# DO SOME PERL STUFF HERE

print "$twobits";

print "</body>\n";

print "</html>";
end learner1.pl -------------------------------------------

text of learner2.pl ------------------------------------------
#!c:\perl\bin -w
use strict;

use CGI;

my $cgiobject = new CGI;
print $cgiobject->header;

my $twobits = <<twobits;
<html>
<head>
<title>Learner2.pl</title>
</head>
<body>

This is an HTML/SCRIPT thing really


twobits

# DO SOME PERL STUFF HERE

print "$twobits";

print "</body>\n";

print "</html>";
end of learner2.pl ------------------------------------


manon_bertolini@mantacorp.com wrote in message
<915h8b$hiq$1@nnrp1.deja.com>...
>Hi there,this may be a very silly question ...
>
>i am a newbie - I need to generate the HTML to open a new small window,
>but this does not actually have a HTML URL ...  is this possible?  May I
>please have a sample snippet?
>
>ie:
>print "WIndow.open(NO_URL ...,param2.param3
>print "<HTML>\n";
>print "<HEAD>\n";
>print "<TITLE>POLL RESULTS</TITLE>\n";
>print "</HEAD>\n";
>
>etc...
>
>Manon
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.




------------------------------

Date: Sat, 16 Dec 2000 22:00:27 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Perl programming
Message-Id: <slrn93miqb.83e.mgjv@martien.heliotrope.home>

On Sat, 16 Dec 2000 08:01:36 GMT,
	SuperGumby <tick.toff@spam.com> wrote:
> 
> Martien Verbruggen wrote in message ...
>>[Please, in the future, put your reply _after_ the text you reply to.
>>It's the convention on this group, and Usenet in general, and makes your
>>post much easier to read]
> 
> I leave arguments about jeopardy posting to people who can't understand that
> the great majority of newsgroup users are using a newsreader with a preview
> pane and capable of 'threading'. I find it amusing that you 'jeopardied'
> this comment.

The comment isn't jeopardied. It was placed in the normally acceptable
place for such a comment.

> For best context integrity interspersed replies should be used.

Yes. AFTER the bit you respond to.

> As someone who has used newsgroup type services since their (indirect)
> developement from newswire services (25 years ago) where the accepted format
> was:

Nonsense.

> Ignore me, but I won't try to enforce my preference on you.

*sigh*

>>On Sat, 16 Dec 2000 03:24:50 GMT,
>> SuperGumby <tick.toff@spam.com> wrote:
>>
>>[article reformaotted and reordered]
>>
>>> Jay Flaherty wrote in message ...
>>>>"Anuj" <anujm2000@hotmail.com> wrote in message
>>>>news:t3jlkdmaeoku6a@corp.supernews.com...
>>>>> In the DOS prompt i have to write "PATH=/perl/bin" always
>>>>> before running the script and then writing the initializing command
>>>>> i.e "perl hello.pl" ( An example file hello.pl) . Is there a way that i
>>>>> dont need to always write the PATH=/perl/bin command so that i can
>>>>> directly run the scripts from the DOS prompt by typing "perl hello.pl".
>>>>
>>>>edit autoexec.bat and add the line:
>>>>
>>>>SET PATH=%PATH%;C:\perl\bin
>>
>>I find it hard to fathom why you chose to follow up to this post with
>>the stuff below. I am sure there is some reason somewhere.
>>
>>> slight mod though
>>>
>>> I recently went through the perl install from scratch and the more I
>>> read the more it seems to me that there should be a BIG RED WARNING
>>> during perl install - "Install this product into /usr/bin/perl, it's a
>>> *nix convention but you'll save yourself some pain in future if you do
>>> this". Or am I wrong ?
>>
>>You are wrong. The ocnvention in most cases would be /usr/local, and
>>some systems have it installed in /usr. I always install in
>>/opt/perl-$VERSION. I've seen many other places.
> 
> I did ask "Or am I wrong ?". Possibly due to some recent scripts I had
> viewed referring to /usr/bin/perl I did not think to ask if it should be
> /usr/local/bin/perl or maybe usr/local/perl.

And thus I said (see the first three words of that paragraph above: "You
are wrong".

> Maybe I should have prefaced the whole thing with (a usually redundant)
> IMHO.

You would still have been wrong, and I still would have commented.

> The reason I have formed this opinion is that I expect to move scripts
> between the system I develop on (Win 9x/NT) and *nix. As you suggest,
> Win32 will accept installation to any path, as it seems will *nix. My
> idea is that the first line of scripts "#!/usr/bin/perl" (cut and
> pasted from a quick yahoo search on "bin perl") has more significance
> to *nix systems than Win32, so by installing using a *nix paradigm I
> may lessen the changes required to move a script between OS's.

The path to perl in the first line of that script has no effect on Win*.
The only bits read (on Win* not by the OS, but by Perl alone) are the
flags to Perl.

*sigh* And you even quoted my signature. But, of course, everyone knows
that the whole world has been jeopardy posting, upside down quoting, and
quoting signatures since 700 BC, when they started using carrier
pigeons.

*plonk*

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd.   | cynical. It's perfectly easy to be
NSW, Australia                  | cynical.


------------------------------

Date: Sat, 16 Dec 2000 10:53:08 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <fcim3tsflc76es4nhr6sr4j9k9u5vv8d18@4ax.com>

John Stanley wrote:

>Philip 'Yes, that's my address' Newton <nospam.newton@gmx.li> wrote:

>>> This isn't the Internet, it's USENET.
>>
>>Why the caps?
>
>Because there is a difference between "internet" as "a connection
>between many networks" and "Internet", which is the particular
>interconnected network that most people use.

I bet he was talking about the caps in "USENET".

-- 
	Bart.


------------------------------

Date: Sat, 16 Dec 2000 13:49:21 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <BpK_5.20876$xW4.162757@news-server.bigpond.net.au>


"Tad McClellan" <tadmc@metronet.com> wrote in message
news:slrn93c7bs.s1.tadmc@maxim.metronet.com...
>
> Here is a start on some Posting Guidelines for our newsgroup.
>
> Please review it and _post_ your comments (no email).
No wonder you complained about my jepardous posts!
So many mistakes, I hang my head in shame.




------------------------------

Date: Sat, 16 Dec 2000 13:20:20 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: PPM question
Message-Id: <o_J_5.20827$xW4.162470@news-server.bigpond.net.au>

I have added five repositories to PPM and now searching takes forever. Way
more than five times my initial search time. Is it wrong to search all the
repositories?




------------------------------

Date: Sat, 16 Dec 2000 13:29:28 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: PPM question
Message-Id: <Y6K_5.20841$xW4.161801@news-server.bigpond.net.au>

It is OK the results finally came back.
"John Boy Walton" <johngros@Spam.bigpond.net.au> wrote in message
news:o_J_5.20827$xW4.162470@news-server.bigpond.net.au...
> I have added five repositories to PPM and now searching takes forever. Way
> more than five times my initial search time. Is it wrong to search all the
> repositories?
>
>




------------------------------

Date: Sat, 16 Dec 2000 11:07:40 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Problem using Image::Size on a webserver
Message-Id: <voim3tc7020krsmlmp75o7ru7acnu0t15n@4ax.com>

Geoff Soper wrote:

>Now why isn't the path '/home/soundh/cgi-bin/required' in that array?

>$require_dir = '/home/soundh/cgi-bin/required';
>
>if ($require_dir ne '') {
>    push(@INC, $require_dir);
>}
 ...
>use Image::Size;

It's a matter of WHEN it got added. The first part is executed when the
script is run, when the compilation of the whole script is complete.
Call it in "pass 2" if you like. But the "use" statement is executed as
soon as IT is compiled. That is, before the rest of the script is even
compiled, thus, in "pass 1". Before the directory got added.

That's why it doesn't work. A quick solution, is to put the if statement
plus block inside a BEGIN block:

	BEGIN {
		if ...
		   ... 
		}
	}

Which, at least, would execute the code at the appropriate time: as soon
as the entire BEGIN block got compiled. But the preferred solution is
using use lib:
	
	use lib '/home/soundh/cgi-bin/required';

See perlfaq8.

A "use" statement always gets executed as soon as it is compiled. As an
aside: the arguments for use lib may even contain perl code, for
example:

	use lib grep -d, @dir_list;

if @dir_list contain a list of lib directories on different systems (but
always harmless paths on any system). Of course, if you do use an array
variable, don't forget to set it in a BEGIN block.

-- 
	Bart.


------------------------------

Date: Sat, 16 Dec 2000 11:19:18 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Regular Expression Help
Message-Id: <ihjm3t0m51h7t4ua7084rgpmacko5qhhvs@4ax.com>

Garry Heaton wrote:

>I'm new at this game but here goes:
>
>/<a href\s*=\s*['"]([^'"]+)['"]/
>
>Then access the parenthesised subexpression with $1

I'd rather make that:

	href\s*=\s*(?:'([^']*)'|"([^"]*)"|([a-zA-Z0-9.-]+))

and use $+  (contents of the last matching parentheses)


>Might be a load of rubbish.

No, it's a fairly decent way, except that for otherwise formatted tags,
it won't work:

  * what if href is not the first attribute?
  * what if the tag is split across multiple lines?

That's why a parser like something derived from HTML::Parser is a
better, i.e. more general solution: it can accept ANY kind of legal
format of tags, and properly extract the atributes' values for you.

-- 
	Bart.


------------------------------

Date: 16 Dec 2000 13:19:23 GMT
From: xnews.public.home@bogus.rtij.nl (Martijn Lievaart)
Subject: Re: Windows cant recognize the original owner
Message-Id: <Xns900C91089youdontwannaknow@194.109.6.74>

Alessandro Augusto <Alessandro.Augusto@br.bosch.com> wrote in
<3A3A3868.2CDAD4AD@br.bosch.com>: 

>sorry but I think you are confunsing everything.
>
>the question is not about at command. BTW, a normal user cannot
>schedule task with at. Only administrators are allowed to do it.

But only an administrator is allowed to take ownership! So you must already 
be administrator to do what was asked.

What I reacted to was that this is a security feature. It /tries/ to be, 
but even Microsoft acknowledges that this is not really working. To many 
ways around it.

>
>The question here is:
>How do get the older owner, set the administrator as the owner,
>change some permissions of this object, then set back the original
>owner. 
>
>How do I do that on a object (file or folder) that the administrator
>permissions
>were removed?
>

Write a service that runs under the system account. Or use at to run a 
program under the system account. Or use srvany.exe to run a program under 
the system account. Otherwise there is no way to do it, as you may not have 
access to read the original owner and/or permissions.

You'll need administrator rights for this, but if not using at, only for 
installing the service.

But why would you want to anyhow?

HTH,
M4


------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 5129
**************************************


home help back first fref pref prev next nref lref last post