[25956] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8175 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 16 03:05:29 2005

Date: Thu, 16 Jun 2005 00:05:07 -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           Thu, 16 Jun 2005     Volume: 10 Number: 8175

Today's topics:
        "END failed" -- but why? <smurf@smurf.noris.de>
    Re: "END failed" -- but why? <chriss@activestate.com>
        File-Find and Samba share <tlviewer@yahoo.com>
        Mac Users cannot access perl CGI <Admin@GoMonitor.com>
    Re: Mac Users cannot access perl CGI <1usa@llenroc.ude.invalid>
    Re: Mac Users cannot access perl CGI <Admin@GoMonitor.com>
    Re: Mac Users cannot access perl CGI <tim@vegeta.ath.cx>
    Re: Mac Users cannot access perl CGI <smurf@smurf.noris.de>
    Re: Masking by columns for grep <shanen@cashette.com>
        Module to match file names against a wildcard spec? <lawshouse.public@btconnect.com>
    Re: Module to match file names against a wildcard spec? <abigail@abigail.nl>
    Re: Module to match file names against a wildcard spec? <apeiron+usenet@coitusmentis.info>
    Re: Module to match file names against a wildcard spec? <lawshouse.public@btconnect.com>
    Re: Module to match file names against a wildcard spec? <chriss@activestate.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 16 Jun 2005 06:06:58 +0200
From: Matthias Urlichs <smurf@smurf.noris.de>
Subject: "END failed" -- but why?
Message-Id: <pan.2005.06.16.04.06.47.230085@smurf.noris.de>

One of my programs exits with these lines, after its last line has
executed:

Use of uninitialized value in null operation, <F> line 1796.
Undefined subroutine &main:: called, <F> line 1796.
END failed--call queue aborted at tools/mig.strings line 1, <F> line 1796.

Well, that's helpful.  :-/
Any ideas on how to figure out *where* and *why* that happens would be
greatly appreciated.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Diplomacy is to do and say, the nastiest thing in the nicest way.
		-- Balfour



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

Date: Wed, 15 Jun 2005 23:12:24 -0700
From: Chris <chriss@activestate.com>
Subject: Re: "END failed" -- but why?
Message-Id: <d8r5ol$a45$2@nntp.itservices.ubc.ca>

Matthias Urlichs wrote:
> One of my programs exits with these lines, after its last line has
> executed:
> 
> Use of uninitialized value in null operation, <F> line 1796.
> Undefined subroutine &main:: called, <F> line 1796.
> END failed--call queue aborted at tools/mig.strings line 1, <F> line 1796.
> 
> Well, that's helpful.  :-/
> Any ideas on how to figure out *where* and *why* that happens would be
> greatly appreciated.
> 

Are you able to reproduce it in a smaller script (less than 1800 lines)?
If not, can you post your END block(s)?

-chris


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

Date: Thu, 16 Jun 2005 05:50:20 GMT
From: tlviewer <tlviewer@yahoo.com>
Subject: File-Find and Samba share
Message-Id: <wq8se.21103$h86.13036@tornado.socal.rr.com>

hello,

my $wdir = '//CompName/EBooks/CHM/perl/';
find( {wanted => \&CheckCHM}, $wdir ); 

In WinNT 5, the above code works. The UNC path is
seemless. However in SuSE 9.2 Linux, the find() call
returns a 
        Can't stat //CompName/EBooks/CHM/perl: No such file or directory
 at /windows/h/temp/earl/scripts/earl_populate.pl line 129

I also tried
my $wdir = 'smb://CompName/EBooks/CHM/perl/';

The EBooks folder is correctly shared via Samba.
I must use this method to name the folder.

thanks in advance,
tlviewer


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

Date: Wed, 15 Jun 2005 20:50:52 -0400
From: "GMI" <Admin@GoMonitor.com>
Subject: Mac Users cannot access perl CGI
Message-Id: <11b1jnehnu8a963@corp.supernews.com>

I am devaloping a web site on IIS on a Win2K sysem. the system works fine
when using IE on Windows but Mac users get an error message that say it does
not recognize ".PL"

Also when I am using FireFox as a browsed it starts to download the HTML
contents as a file!!
Any help is appreciated.




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

Date: Thu, 16 Jun 2005 01:04:16 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Mac Users cannot access perl CGI
Message-Id: <Xns9676D6573A203asu1cornelledu@127.0.0.1>

"GMI" <Admin@GoMonitor.com> wrote in
news:11b1jnehnu8a963@corp.supernews.com: 

> Any help is appreciated.

Please read the posting guidelines for this group. They contain valuable 
information on how you can help yourself, and help others help you.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

Date: Wed, 15 Jun 2005 21:11:59 -0400
From: "GMI" <Admin@GoMonitor.com>
Subject: Re: Mac Users cannot access perl CGI
Message-Id: <11b1kv46713gdf@corp.supernews.com>

I know hoe to help myself. If I could find any article on this subject, I
would not post this message. If you have any idea about the problem please
let us know otherwise do not waste your time.


"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns9676D6573A203asu1cornelledu@127.0.0.1...
> "GMI" <Admin@GoMonitor.com> wrote in
> news:11b1jnehnu8a963@corp.supernews.com:
>
> > Any help is appreciated.
>
> Please read the posting guidelines for this group. They contain valuable
> information on how you can help yourself, and help others help you.
>
> Sinan
>
> -- 
> A. Sinan Unur <1usa@llenroc.ude.invalid>
> (reverse each component and remove .invalid for email address)
>
> comp.lang.perl.misc guidelines on the WWW:
> http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html




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

Date: Thu, 16 Jun 2005 01:54:45 GMT
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: Mac Users cannot access perl CGI
Message-Id: <slrndb1mt2.mt.tim@vegeta.saiyix>

GMI <Admin@GoMonitor.com> wrote:
>  I am devaloping a web site on IIS on a Win2K sysem. the system works fine
>  when using IE on Windows but Mac users get an error message that say it does
>  not recognize ".PL"
>  
>  Also when I am using FireFox as a browsed it starts to download the HTML
>  contents as a file!!
>  Any help is appreciated.

Sounds like a web server configuration error.

Can't offer much more help than that.  The only thing remotely linking
your question to perl is the mention of a ".PL" extension.

If you want to include more information, we'd be better able to point
you to the correct CGI or IIS-related newsgroup for further help.

HTH,
Tim Hammerquist


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

Date: Thu, 16 Jun 2005 05:59:56 +0200
From: Matthias Urlichs <smurf@smurf.noris.de>
Subject: Re: Mac Users cannot access perl CGI
Message-Id: <pan.2005.06.16.03.59.54.747155@smurf.noris.de>

Hi, GMI wrote:

> I know hoe to help myself. If I could find any article on this subject, I
> would not post this message. If you have any idea about the problem please
> let us know otherwise do not waste your time.
> 
Would you please actually *read* the posting guidelines?

>>      Is there a better place to ask your question?
>>       - Question should be about Perl, not about the application area

Your question is not a Perl question.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Q:	What is orange and goes "click, click?"
A:	A ball point carrot.



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

Date: Thu, 16 Jun 2005 08:31:45 +0900
From: "Shannon Jacobs" <shanen@cashette.com>
Subject: Re: Masking by columns for grep
Message-Id: <42b0ba60$0$1025$44c9b20d@news3.asahi-net.or.jp>

Anno Siegel wrote:
> Damian James  <djames@thehub.com.au> wrote in comp.lang.perl.misc:
>> On 14 Jun 2005 11:16:37 GMT, Anno Siegel said:
>>> ...
>>> Rewriting it
>>>
>>>     @foo = grep /\G\Q$theString/, map { pos = 50; $_ } @foo;
>>>
>>> still suffers from the fact that the elements that map() returns
>>> don't have their pos() set.  I admit that I don't quite understand
>>> that.
>>
>> Me either from my reading of the docs.
>>
>>> $_ in map should be an alias to the current element of @foo, and
>>> grep should see an alias to that, with its position set.
>>>
>>> This works as intended:
>>>
>>>     pos = 50 for @foo;
>>>     @foo = grep /\G\Q$theString/, @foo;
>>
>> Curious. I would find the following more obvious about what it does:
>>
>>     @foo = grep { pos = 50; /\G\Q$theString/ } @foo;
>
> Of course!  Much better.
>
>> I don't really understand where the position is being kept in your
>> version (or rather, how grep() knows about it).
>
> The position is a property of every string and lives as long as
> the string lives.  Once the position is set for all strings in @foo,
> the regex in grep() can use it.
>
> The position is fragile in that it isn't copied with the string:
>
>    $x = '123';
>    pos $x = 2;
>    $y = $x;
>
> leaves $x with a position of 2, but $y has undefined position.
>
> Anno

Thanks very much. This has been a typically enlightening discussion. I very 
much like that aspect of Perl, though programming in it still makes me feel 
a bit queasy sometimes.

(And I still think I should replace the entire kludgy program, but no one 
offered any pointers in that direction. I suppose part of what is bothering 
me about the approach is the fundamental distortion as you pass through the 
CGI--on one side you are thinking in HTML trivialities, but on the other 
side you have Perl, where you must think abstractly in a way that is 
anything but trivial.) 



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

Date: Wed, 15 Jun 2005 23:31:34 +0100
From: Henry Law <lawshouse.public@btconnect.com>
Subject: Module to match file names against a wildcard spec?
Message-Id: <81a1b15pauh1gusnnboci9nbuu50s9bsbt@4ax.com>

I've searched CPAN and the web for an answer to this without finding
anything (but I confess I found it hard to structure a query so I may
have missed something).  Maybe someone can point me in the right
direction.

A Perl program I'm writing reads in file names from a specified
directory amd then processes them (how doesn't matter).  If
subdirectories are found they are processed recursively.

I need to be able to restrict its operation by specifying groups of
files via a wild card; the control syntax looks a bit like this

	# Include contents of C:\foo and all its subdirectories
	include C:\foo
	# But don't do text files in the root of \foo
	exclude C:\foo\*.txt
	# Note that text files elsewhere in the \foo tree, such as
	# C:\foo\bar\bletch.txt should be processed.

(The above is Windows, obviously, but I need to write this so it works
on Unix too).

I'm getting really tangled up trying to turn my exclude specifications
into regexes which I can then use to exclude relevant files; not only
am I not a very experienced Perl coder but the logic of the task turns
out to be quite complicated.  For example

#! /usr/bin/perl
use strict;
use warnings;
my @names =
("F:/NOTES/DATA/ABBC2.NSF","F:/NOTES/DATA/FURBLE/ABBC2.NSF");
my $excl_spec = "F:/NOTES/DATA/.*\.NSF";

for (@names) {
   if (/$excl_spec/i) {
      print "$_ matches\n";
   } else {
      print "$_ doesn't match\n";
   }
}

When run this gives
	F:/NOTES/DATA/ABBC2.NSF matches
	F:/NOTES/DATA/FURBLE/ABBC2.NSF matches

 ... which isn't what I want because the .* eats up the additional
subdirectory FURBLE as well.

I've looked at File::Spec and File::CheckTree without finding what I
want. Can anyone suggest either (1) A module that would help with
wildcard processing of file names, or (2) A better way of coding this
kind of thing?
-- 

Henry Law       <><     Manchester, England 


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

Date: 15 Jun 2005 22:48:29 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Module to match file names against a wildcard spec?
Message-Id: <slrndb1c1s.14f.abigail@alexandra.abigail.nl>

Henry Law (lawshouse.public@btconnect.com) wrote on MMMMCCCVI September
MCMXCIII in <URL:news:81a1b15pauh1gusnnboci9nbuu50s9bsbt@4ax.com>:
$$  I've searched CPAN and the web for an answer to this without finding
$$  anything (but I confess I found it hard to structure a query so I may
$$  have missed something).  Maybe someone can point me in the right
$$  direction.


Did you check out the glob() function and the File::Find module?


Abigail
-- 
sub J::FETCH{Just   }$_.='print+"@{[map';sub J::TIESCALAR{bless\my$J,J}
sub A::FETCH{Another}$_.='{tie my($x),$';sub A::TIESCALAR{bless\my$A,A}
sub P::FETCH{Perl   }$_.='_;$x}qw/J A P';sub P::TIESCALAR{bless\my$P,P}
sub H::FETCH{Hacker }$_.=' H/]}\n"';eval;sub H::TIESCALAR{bless\my$H,H}


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

Date: 15 Jun 2005 23:32:05 GMT
From: Christopher Nehren <apeiron+usenet@coitusmentis.info>
Subject: Re: Module to match file names against a wildcard spec?
Message-Id: <slrndb1ejl.1kgd.apeiron+usenet@prophecy.dyndns.org>

On 2005-06-15, Henry Law scribbled these
curious markings:
> I've searched CPAN and the web for an answer to this without finding
> anything (but I confess I found it hard to structure a query so I may
> have missed something).  Maybe someone can point me in the right
> direction.
>
> A Perl program I'm writing reads in file names from a specified
> directory amd then processes them (how doesn't matter).  If
> subdirectories are found they are processed recursively.
> [...]
> I've looked at File::Spec and File::CheckTree without finding what I
> want. Can anyone suggest either (1) A module that would help with
> wildcard processing of file names, or (2) A better way of coding this
> kind of thing?

File::Find perhaps? Maybe File::Find::Rule if you find File::Find too
difficult (though I can't imagine why; I've found it to be delightfully
easy-to-use)?

Best Regards,
Christopher Nehren
-- 
I abhor a system designed for the "user", if that word is a coded
pejorative meaning "stupid and unsophisticated". -- Ken Thompson
If you ask the wrong people questions, you get "Joel on Software".
Unix is user friendly. However, it isn't idiot friendly.


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

Date: Thu, 16 Jun 2005 06:44:01 +0100
From: Henry Law <lawshouse.public@btconnect.com>
Subject: Re: Module to match file names against a wildcard spec?
Message-Id: <2q32b1dv4ofh99ccg2bo2365viojkgelas@4ax.com>

On 15 Jun 2005 23:32:05 GMT, Christopher Nehren
<apeiron+usenet@coitusmentis.info> wrote:

>On 2005-06-15, Henry Law scribbled these
>curious markings:

>> A Perl program I'm writing reads in file names from a specified
>> directory amd then processes them (how doesn't matter).  If
>> subdirectories are found they are processed recursively.
>> [...]
>> I've looked at File::Spec and File::CheckTree without finding what I
>> want. Can anyone suggest either (1) A module that would help with
>> wildcard processing of file names, or (2) A better way of coding this
>> kind of thing?
>
>File::Find perhaps?

Yes, I'm familiar with File::Find and there are two reasons why I'm
not using it.  Firstly I can't prevent it from scanning sub-trees

	include C:\some\path
	exclude C:\some\path\huge\subdirectory

and secondly when it invokes its "wanted" function I'm still faced
with working out whether $File::Find::name matches my "exclude"
specification, which is the bit I'm stuck on.  My tree-following logic
probably isn't perfect but it works well enough.
-- 

Henry Law       <><     Manchester, England 


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

Date: Wed, 15 Jun 2005 23:10:03 -0700
From: Chris <chriss@activestate.com>
Subject: Re: Module to match file names against a wildcard spec?
Message-Id: <d8r5k7$a45$1@nntp.itservices.ubc.ca>

Henry Law wrote:
> On 15 Jun 2005 23:32:05 GMT, Christopher Nehren
> <apeiron+usenet@coitusmentis.info> wrote:
> 
> 
>>On 2005-06-15, Henry Law scribbled these
>>curious markings:
> 
> 
>>>A Perl program I'm writing reads in file names from a specified
>>>directory amd then processes them (how doesn't matter).  If
>>>subdirectories are found they are processed recursively.
>>>[...]
>>>I've looked at File::Spec and File::CheckTree without finding what I
>>>want. Can anyone suggest either (1) A module that would help with
>>>wildcard processing of file names, or (2) A better way of coding this
>>>kind of thing?
>>
>>File::Find perhaps?
> 
> 
> Yes, I'm familiar with File::Find and there are two reasons why I'm
> not using it.  Firstly I can't prevent it from scanning sub-trees
> 
> 	include C:\some\path
> 	exclude C:\some\path\huge\subdirectory

File::Find has a "preprocess" option that may help here. From the 
documentation:

"The value should be a code reference. This code reference is used to 
    preprocess the current directory. <snip> Your preprocessing function 
is called after readdir(), but before the loop that calls the wanted() 
function. <snip> The code can be used to sort the file/directory names 
alphabetically, numerically, or to filter out directory entries based on 
their name alone."
> 
> and secondly when it invokes its "wanted" function I'm still faced
> with working out whether $File::Find::name matches my "exclude"
> specification, which is the bit I'm stuck on.  My tree-following logic
> probably isn't perfect but it works well enough.

It looks like the problem is in your regex. You put:

     my $excl_spec = "F:/NOTES/DATA/.*\.NSF";

which matched "F:/NOTES/DATA/ABBC2.NSF" and 
"F:/NOTES/DATA/FURBLE/ABBC2.NSF". The reason it matched the second 
string is because of the ".*" - you probably don't want to match ANY 
character. For instance, you probably don't want to match the directory 
separator "/". Try it with:

     my $excl_spec = "F:/NOTES/DATA/[^/]*\.NSF";

That should only match .NSF files in that directory.

Hope that helps :)

-chris


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

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 8175
***************************************


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