Ask a Question related to PERL Miscellaneous, Design and Development.
-
Zoran #1
some terrible problems with glob
Hello guys,some things in my code are happening,which I don't
understand.I am trying to open different directories and to load a
bunch of files.But this don't work.
It is all fine,when I am working in my home directoy.But if I change
it the glob-function don't work.
Here is the code:
#!/usr/local/bin/perl -w
print "\nHi please tell me your directory!\n";
chomp ($directory = <STDIN>);
print "\nOK now tell me the glob name!\n";
chomp ($opname = <STDIN>);
print "\nWorking ... \n";
###########################
if (!opendir VH,$directory)
{
print "\nThe directory $directory was not found !!\n";
return;}
print "\nEnter 2 \n";
$MJJ=-1;
foreach $datei (readdir VH){
$MJJ=$MJJ+1;
$files[$MJJ]=$datei;
print "$files[$MJJ]\n";
}
print "\n@files \n";
@files=glob "*$opname*";
print "\n$opname \n";
print "\nEnter 3 \n";
print "\n@files \n";
Zoran Guest
-
#38022 [Com]: glob() problems
ID: 38022 Comment by: francois at tekwire dot net Reported By: flconseil at yahoo dot fr Status: Open Bug... -
My graphics look terrible!!
I'm creating an 8 page brochure and when I import my beautiful jpeg pictures scanned thru Photoshop-they look horrible. My process is >File>Place>and... -
I made a terrible mistake...
Hi there, I am desperate to unpublish my first attempt at using Contribute. Instead of taking the time to read through the manual, I thought I... -
Why does Photoshop CS have terrible screen redraw??
Christopher, Yes Painter is terrible on screen re-draws. I have used Painter since version 3 on windows and Painter ran bad then too; the problem... -
variable file glob into grep without glob()
Hope I don't get shot for posting again, but I really need help with this ... I want to process lots (thousands) of files. I want to take a file... -
Eric J. Roode #2
Re: some terrible problems with glob
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Zoran <zoran@iehk.rwth-aachen.de> wrote in
news:fh8lgv4b8m8n9qj57kgd70f4kmk3attbnf@4ax.com:
....>
> Hello guys,some things in my code are happening,which I don't
> understand.I am trying to open different directories and to load a
> bunch of files.But this don't work.
> It is all fine,when I am working in my home directoy.But if I change
> it the glob-function don't work.
>
> Here is the code:FYI, this whole loop is unnecessary. You could just do:> $MJJ=-1;
> foreach $datei (readdir VH){
> $MJJ=$MJJ+1;
> $files[$MJJ]=$datei;
> print "$files[$MJJ]\n";
> }
@files = readdir VH;
This glob happens in the current directory, not in $directory.> print "\n@files \n";
>
> @files=glob "*$opname*";
Perhaps you should do
chdir $directory;
first.
- --
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPwqxgmPeouIeTNHoEQLTnwCbBwVDuKCuUZ4FCYWguGm19j 9aEvIAoJ2n
4092UqAWX+H3TZuyeDPi8zxn
=HDT4
-----END PGP SIGNATURE-----
Eric J. Roode Guest



Reply With Quote

