glob not working 
Author Message
 glob not working

Is there any reason, why glob doesn't work???

$tst = glob("*.pl");

puts "" $tst, any clues??

thanks.

--
                         Tiago Umm Pascoal
                    'The unstoppable mail machine'

 I believe in making trouble. If women have any duty at all, essentially
it's to be a pain in the arse. (avital ronell)



Tue, 25 Apr 2000 03:00:00 GMT  
 glob not working


Quote:
>Is there any reason, why glob doesn't work???

>$tst = glob("*.pl");

This statement sets $tst equal to the _first_ file found in the glob
array.  It does not copy the glob array to $tst.  Is this what you
want?

Quote:
>puts "" $tst, any clues??

Actually, it probably doesn't find any files with that pattern and so
doesn't put anything in $tst.  :-)  If you run -w, see is it tells you
that $tst is an uninitialized value.

Quote:
>thanks.

Any time.

Streben nach Wahrheit

Faust Gertz
Philosopher at Large



Tue, 25 Apr 2000 03:00:00 GMT  
 glob not working

: Is there any reason, why glob doesn't work???

You have not given us enough information to even tell if it is
working or not.

The result you give is "working right" if there are no files with
a '.pl' filename extension in the current directory.

Are there really some files named that way in the current directory?

Have you printed out what directory you are in?

: $tst = glob("*.pl");

glob() may return more than one filename.

Where would they go? (answer: the first one goes in $tst, the rest
                              are discarded...)

Maybe you want an array there instead?

: puts "" $tst, any clues??

--
    Tad McClellan                          SGML Consulting

    Fort Worth, Texas



Tue, 25 Apr 2000 03:00:00 GMT  
 glob not working

Quote:

>I'm aware of that. and it doesn't really matter, the first one will be
>enough. Because i'm using glob to determine the home of a user. :-)

why? there are environment variables for such things, and lots of other
less wasteful ways to do it.

--

NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>



Thu, 27 Apr 2000 03:00:00 GMT  
 glob not working

: : Is there any reason, why glob doesn't work???

: You have not given us enough information to even tell if it is
: working or not.

sorry.

: The result you give is "working right" if there are no files with
: a '.pl' filename extension in the current directory.

but there are. :-)

: glob() may return more than one filename.

: Where would they go? (answer: the first one goes in $tst, the rest
:                               are discarded...)

I'm aware of that. and it doesn't really matter, the first one will be
enough. Because i'm using glob to determine the home of a user. :-)

what i've discovered is (someone correct me if i'm wrong) perl relies on the
csh to glob, and i don't have csh installed. :-(

--
                         Tiago Umm Pascoal
                    'The unstoppable mail machine'

 I believe in making trouble. If women have any duty at all, essentially
it's to be a pain in the arse. (avital ronell)



Thu, 27 Apr 2000 03:00:00 GMT  
 glob not working

Quote:

>what i've discovered is (someone correct me if i'm wrong) perl relies on the
>csh to glob, and i don't have csh installed. :-(

On unix machines, perl uses the shell that it can find when you run
the Configure script, prefering the C-Shell to the Bourne shell if it
can find it.

If perl is trying to use the C shell, and there is none present, then
your perl is misconfigured. (Most likely, it was configured on a
machine that did have csh present and the binary and associated files
were copied to your machine with a different "Configuration".

On other with other operating systems, how it gets done depends on
what the person who did the port decided to do. They may have
implemented globbing internally, they may use a shell on the native
operating system, or may create their own separate executable that
will only the subset of shell functionality that they need.

--
Andrew Langmead



Thu, 27 Apr 2000 03:00:00 GMT  
 glob not working


: >what i've discovered is (someone correct me if i'm wrong) perl relies on the
: >csh to glob, and i don't have csh installed. :-(

: If perl is trying to use the C shell, and there is none present, then
: your perl is misconfigured. (Most likely, it was configured on a

:-( How can re-configure it? (presuming it can be done without recompiling)

: machine that did have csh present and the binary and associated files
: were copied to your machine with a different "Configuration".

i don't think so. Anyway i've tried to make a csh link to bash, and no
sucess either. Can this hack have some sort of sucess??

--
                         Tiago Umm Pascoal
                    'The unstoppable mail machine'

 I believe in making trouble. If women have any duty at all, essentially
it's to be a pain in the arse. (avital ronell)



Fri, 28 Apr 2000 03:00:00 GMT  
 glob not working

Quote:


>: If perl is trying to use the C shell, and there is none present, then
>: your perl is misconfigured. (Most likely, it was configured on a
>:-( How can re-configure it? (presuming it can be done without recompiling)

Reconfiguring is done by recompiling. If Configure is getting messed
up on thinking there is a csh, run Configure, and when it tells you it
is giving you the last opportunity to do a shell escape, edit the file
config.sh and change the variable d_csh to 'undef'
--
Andrew Langmead


Sat, 29 Apr 2000 03:00:00 GMT  
 glob not working


Quote:
> :-( How can re-configure it? (presuming it can be done without recompiling)

You can't reconfigure Perl without recompiling. Fortunately, recompiling
is easy to do. Get the latest Perl from CPAN; it comes with full
instructions. Good luck!

--
Tom Phoenix           http://www.teleport.com/~rootbeer/

Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



Mon, 01 May 2000 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. glob not working in dos

2. glob not working through browser

3. glob not working win32?

4. File glob not working properly

5. Count of items is EXCEPTION not RULE (was Re: Little perl annoyance #371: glob)

6. Win95 glob for filenames returns values but not into array

7. returning local glob refs doesn't work per pods

8. Not a GLOB reference at POSIX.pm line 332 (5.002beta)

9. Send mail script not working in 2nd server but working in 1st server

10. Send mail script not working in 2nd server but working in 1st server

11. DBD::XBase 'not' not working

12. Using glob() w/WinNT vs. glob() w/Win95

 

 
Powered by phpBB® Forum Software