Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

RE: Re: Can't open file within subroutine

by t0mas (Priest)
on Jun 14, 2000 at 18:48 UTC ( #18110=note: print w/replies, xml ) Need Help??


in reply to Re: Can't open file within subroutine
in thread Can't open file within subroutine

I'm not really sure what you are trying to do but here's a guess:
#!/usr/bin/perl opendir(DIR, '/export/home/cad/data/products') || die "Can't opendir D +ir: $!"; my @Dirs = grep { /^[^.].*/ && -d "/export/home/cad/data/products/$_" +} readdir(DIR); closedir DIR; foreach $name (@Dirs) { open(FILE,"</export/home/cad/data/products/$name/source/$name.bom" +) || die "Can't open $file: $!"; my @lines=<FILE>; close(FILE); foreach $line (@lines) { $line=~ s/BOARDPLACEMENT_BOM brd//; print "\n $line "; print "\n------------------------ \n"; } };
The thing I can't really figure out is why anyone would like to do that.

/brother t0mas

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://18110]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2023-12-05 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (25 votes). Check out past polls.

    Notices?